FitMethodFunction class Interface for objective functions (like chi2 and likelihood used in the fit) In addition to normal function interface provide interface for calculating each data contribution to the function which is required by some algorithm (like Fumili)
Definition at line 38 of file FitMethodFunction.h.
Public Types | |
typedef FunctionType::BaseFunc | BaseFunction |
enum | Type_t { kUndefined = 0 , kLeastSquare , kLogLikelihood , kPoissonLikelihood } |
enumeration specifying the possible fit method types More... | |
Public Member Functions | |
BasicFitMethodFunction (int dim, int npoint) | |
~BasicFitMethodFunction () override | |
Virtual Destructor (no operations) | |
virtual double | DataElement (const double *x, unsigned int i, double *g=nullptr, double *h=nullptr, bool fullHessian=false) const =0 |
method returning the data i-th contribution to the fit objective function For example the residual for the least square functions or the pdf element for the likelihood functions. | |
virtual bool | G2 (const double *, double *) const |
Computes the Second derivatives. | |
virtual bool | HasHessian () const |
virtual bool | Hessian (const double *x, double *hess) const |
Computes the full Hessian. | |
bool | IsAGradFCN () |
virtual unsigned int | NCalls () const |
return the total number of function calls (override if needed) | |
unsigned int | NDim () const override |
Number of dimension (parameters) . | |
virtual unsigned int | NPoints () const |
return the number of data points used in evaluating the function | |
virtual void | ResetNCalls () |
reset number of function calls | |
virtual Type_t | Type () const |
return the type of method, override if needed | |
virtual void | UpdateNCalls () const |
update number of calls | |
Static Public Member Functions | |
static bool | IsAGradFCN () |
Static function to indicate if a function is supporting gradient. | |
Private Attributes | |
unsigned int | fNCalls |
unsigned int | fNDim |
unsigned int | fNPoints |
#include <Math/FitMethodFunction.h>
typedef FunctionType::BaseFunc ROOT::Math::BasicFitMethodFunction< FunctionType >::BaseFunction |
Definition at line 43 of file FitMethodFunction.h.
enum ROOT::Math::BasicFitMethodFunction::Type_t |
enumeration specifying the possible fit method types
Enumerator | |
---|---|
kUndefined | |
kLeastSquare | |
kLogLikelihood | |
kPoissonLikelihood |
Definition at line 46 of file FitMethodFunction.h.
|
inline |
Definition at line 49 of file FitMethodFunction.h.
|
inlineoverride |
Virtual Destructor (no operations)
Definition at line 58 of file FitMethodFunction.h.
|
pure virtual |
method returning the data i-th contribution to the fit objective function For example the residual for the least square functions or the pdf element for the likelihood functions.
Estimating also the gradient of the data element if the passed pointer is not null and the Hessian. The flag fullHessian is set when one needs to compute the full Hessian (not the approximated one) and should be used when the full second derivatives of the model functions are available
Implemented in ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >, ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType >, and ROOT::Fit::LogLikelihoodFCN< DerivFunType, ModelFunType >.
|
inlinevirtual |
Computes the Second derivatives.
Return false if this is not supported
Definition at line 104 of file FitMethodFunction.h.
|
inlinevirtual |
|
inlinevirtual |
Computes the full Hessian.
Return false if Hessian is not supported
Definition at line 81 of file FitMethodFunction.h.
|
inlinestatic |
Static function to indicate if a function is supporting gradient.
Definition at line 135 of file FitMethodFunction.h.
|
inline |
Definition at line 149 of file FitMethodFunction.h.
|
inlinevirtual |
return the total number of function calls (override if needed)
Definition at line 119 of file FitMethodFunction.h.
|
inlineoverride |
Number of dimension (parameters) .
From IGenMultiFunction interface
Definition at line 63 of file FitMethodFunction.h.
|
inlinevirtual |
return the number of data points used in evaluating the function
Definition at line 109 of file FitMethodFunction.h.
|
inlinevirtual |
reset number of function calls
Definition at line 129 of file FitMethodFunction.h.
|
inlinevirtual |
return the type of method, override if needed
Reimplemented in ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType >, ROOT::Fit::LogLikelihoodFCN< DerivFunType, ModelFunType >, and ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >.
Definition at line 114 of file FitMethodFunction.h.
|
inlinevirtual |
update number of calls
Definition at line 124 of file FitMethodFunction.h.
|
mutableprivate |
Definition at line 143 of file FitMethodFunction.h.
|
private |
Definition at line 141 of file FitMethodFunction.h.
|
private |
Definition at line 142 of file FitMethodFunction.h.