![]() |
OpenMS
|
Implements a fitter for the Gumbel distribution. More...
#include <OpenMS/MATH/STATISTICS/GumbelMaxLikelihoodFitter.h>
Classes | |
| struct | GumbelDistributionFitResult |
| struct to represent the parameters of a gumbel distribution More... | |
Public Member Functions | |
| GumbelMaxLikelihoodFitter () | |
| Default constructor. | |
| GumbelMaxLikelihoodFitter (GumbelDistributionFitResult init) | |
| Default constructor. | |
| virtual | ~GumbelMaxLikelihoodFitter () |
| Destructor. | |
| void | setInitialParameters (const GumbelDistributionFitResult &result) |
| sets the gumbel distribution start parameters a and b for the fitting | |
| GumbelDistributionFitResult | fitWeighted (const std::vector< double > &x, const std::vector< double > &w) |
Fits a Gumbel (maximum) distribution to the data points x with weights w by weighted maximum likelihood. | |
Protected Attributes | |
| GumbelDistributionFitResult | init_param_ |
Private Member Functions | |
| GumbelMaxLikelihoodFitter (const GumbelMaxLikelihoodFitter &rhs) | |
| Copy constructor (not implemented) | |
| GumbelMaxLikelihoodFitter & | operator= (const GumbelMaxLikelihoodFitter &rhs) |
| assignment operator (not implemented) | |
Implements a fitter for the Gumbel distribution.
This class fits a Gumbel distribution to a number of data points. The results as well as the initial guess are specified using the struct GumbelDistributionFitResult.
The formula with the fitted parameters can be transformed into a gnuplot formula using getGnuplotFormula() after fitting.
Default constructor.
Default constructor.
|
virtual |
Destructor.
|
private |
Copy constructor (not implemented)
| GumbelDistributionFitResult fitWeighted | ( | const std::vector< double > & | x, |
| const std::vector< double > & | w | ||
| ) |
Fits a Gumbel (maximum) distribution to the data points x with weights w by weighted maximum likelihood.
The scale parameter is the unique root of the (monotone) profile score equation, which is solved by safeguarded Newton iterations; the location parameter then follows in closed form. Data points with non-finite values or non-positive weights are ignored. The scale parameter of the initial parameters is the starting point of the iterations (warm start). If no data point remains, the initial parameters are returned. The fitted parameters are used as initial parameters of the next call.
| [in] | x | Input x values |
| [in] | w | Input weights (same length as x) |
| Exception::InvalidParameter | is thrown if x and w differ in size |
| Exception::UnableToFit | is thrown if fitting cannot be performed (e.g. the data have no spread) |
|
private |
assignment operator (not implemented)
| void setInitialParameters | ( | const GumbelDistributionFitResult & | result | ) |
sets the gumbel distribution start parameters a and b for the fitting
|
protected |