OpenMS
Loading...
Searching...
No Matches
GumbelMaxLikelihoodFitter Class Reference

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)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ GumbelMaxLikelihoodFitter() [1/3]

Default constructor.

◆ GumbelMaxLikelihoodFitter() [2/3]

◆ ~GumbelMaxLikelihoodFitter()

virtual ~GumbelMaxLikelihoodFitter ( )
virtual

Destructor.

◆ GumbelMaxLikelihoodFitter() [3/3]

Copy constructor (not implemented)

Member Function Documentation

◆ fitWeighted()

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.

Parameters
[in]xInput x values
[in]wInput weights (same length as x)
Exceptions
Exception::InvalidParameteris thrown if x and w differ in size
Exception::UnableToFitis thrown if fitting cannot be performed (e.g. the data have no spread)

◆ operator=()

GumbelMaxLikelihoodFitter & operator= ( const GumbelMaxLikelihoodFitter &  rhs)
private

assignment operator (not implemented)

◆ setInitialParameters()

void setInitialParameters ( const GumbelDistributionFitResult &  result)

sets the gumbel distribution start parameters a and b for the fitting

Member Data Documentation

◆ init_param_

GumbelDistributionFitResult init_param_
protected