Extension of the FCNBase for the Fumili method.
Fumili applies only to minimization problems used for fitting. The method is based on a linearization of the model function negleting second derivatives. User needs to provide the model function. The figure-of-merit describing the difference between the model function and the actual measurements has to be implemented by the user in a subclass of FumiliFCNBase. For an example see the FumiliChi2FCN and FumiliStandardChi2FCN classes.
Definition at line 46 of file FumiliFCNBase.h.
Public Member Functions | |
| FumiliFCNBase () | |
| Default Constructor. | |
| FumiliFCNBase (unsigned int npar) | |
| Constructor which initializes the class with the function provided by the user for modeling the data. | |
| virtual unsigned int | Dimension () |
| return number of function variable (parameters) , i.e. | |
| virtual double | ErrorDef () const |
| Error definition of the function. | |
| virtual void | EvaluateAll (std::vector< double > const &par)=0 |
| Evaluate function Value, Gradient and Hessian using Fumili approximation, for values of parameters p The result is cached inside and is return from the FumiliFCNBase::Value , FumiliFCNBase::Gradient and FumiliFCNBase::Hessian methods. | |
| virtual std::vector< double > | G2 (std::vector< double > const &) const |
| Return the diagonal elements of the Hessian (second derivatives). | |
| virtual const std::vector< double > & | Gradient () const |
| Return cached Value of function Gradient estimated previously using the FumiliFCNBase::EvaluateAll method. | |
| std::vector< double > | Gradient (std::vector< double > const &) const override |
| Return the gradient vector of the function at the given parameter point. | |
| virtual std::vector< double > | GradientWithPrevResult (std::vector< double > const ¶meters, double *, double *, double *) const |
| virtual GradientParameterSpace | gradParameterSpace () const |
| virtual bool | HasG2 () const |
| bool | HasGradient () const override |
| virtual bool | HasHessian () const |
| std::vector< double > | Hessian (std::vector< double > const &) const override |
| Return Value of the i-th j-th element of the Hessian matrix estimated previously using the FumiliFCNBase::EvaluateAll method. | |
| virtual double | Hessian (unsigned int row, unsigned int col) const |
| virtual double | operator() (std::vector< double > const &v) const =0 |
| The meaning of the vector of parameters is of course defined by the user, who uses the values of those parameters to calculate their function Value. | |
| virtual void | SetErrorDef (double) |
| add interface to set dynamically a new error definition Re-implement this function if needed. | |
| virtual double | Up () const =0 |
| Error definition of the function. | |
| virtual double | Value () const |
| Return cached Value of objective function estimated previously using the FumiliFCNBase::EvaluateAll method. | |
Protected Member Functions | |
| std::vector< double > & | Gradient () |
| std::vector< double > & | Hessian () |
| virtual void | InitAndReset (unsigned int npar) |
| initialize and reset values of gradien and Hessian | |
| void | SetFCNValue (double value) |
Private Attributes | |
| std::vector< double > | fGradient |
| std::vector< double > | fHessian |
| unsigned int | fNumberOfParameters |
| double | fValue |
#include <Minuit2/FumiliFCNBase.h>
|
inline |
Default Constructor.
Need in this case to create when implementing EvaluateAll the Gradient and Hessian vectors with the right size
Definition at line 54 of file FumiliFCNBase.h.
|
inline |
Constructor which initializes the class with the function provided by the user for modeling the data.
| npar | the number of parameters |
Definition at line 67 of file FumiliFCNBase.h.
return number of function variable (parameters) , i.e.
function dimension
Definition at line 121 of file FumiliFCNBase.h.
Error definition of the function.
MINUIT defines Parameter errors as the change in Parameter Value required to change the function Value by up. Normally, for chisquared fits it is 1, and for negative log likelihood, its Value is 0.5. If the user wants instead the 2-sigma errors for chisquared fits, it becomes 4, as Chi2(x+n*sigma) = Chi2(x) + n*n.
Comment a little bit better with links!!!!!!!!!!!!!!!!!
|
pure virtual |
Evaluate function Value, Gradient and Hessian using Fumili approximation, for values of parameters p The result is cached inside and is return from the FumiliFCNBase::Value , FumiliFCNBase::Gradient and FumiliFCNBase::Hessian methods.
| par | vector of parameters |
Implemented in ROOT::Minuit2::FumiliStandardChi2FCN, ROOT::Minuit2::FumiliStandardMaximumLikelihoodFCN, and ROOT::Minuit2::FumiliFCNAdapter< Function >.
|
inlinevirtualinherited |
Return the diagonal elements of the Hessian (second derivatives).
By default, returns an empty vector. Override this method if analytic second derivatives (per-parameter curvature) are available.
| v | Parameter vector. |
Reimplemented in ROOT::Minuit2::FCNAdapter.
|
inlineprotected |
Definition at line 138 of file FumiliFCNBase.h.
|
inlinevirtual |
Return cached Value of function Gradient estimated previously using the FumiliFCNBase::EvaluateAll method.
Definition at line 97 of file FumiliFCNBase.h.
|
inlineoverridevirtual |
Return the gradient vector of the function at the given parameter point.
By default, returns an empty vector (no analytic gradient provided). Override this method if an analytic gradient is available.
| v | Parameter vector. |
Reimplemented from ROOT::Minuit2::FCNBase.
Definition at line 98 of file FumiliFCNBase.h.
|
inlinevirtualinherited |
Reimplemented in ROOT::Minuit2::FCNAdapter.
|
inlineoverridevirtual |
Reimplemented from ROOT::Minuit2::FCNBase.
Definition at line 56 of file FumiliFCNBase.h.
Reimplemented in ROOT::Minuit2::FCNAdapter.
|
inlineprotected |
Definition at line 140 of file FumiliFCNBase.h.
|
inlineoverridevirtual |
Return Value of the i-th j-th element of the Hessian matrix estimated previously using the FumiliFCNBase::EvaluateAll method.
| row | row Index of the matrix |
| col | col Index of the matrix |
Reimplemented from ROOT::Minuit2::FCNBase.
Definition at line 107 of file FumiliFCNBase.h.
|
inlinevirtual |
Definition at line 108 of file FumiliFCNBase.h.
initialize and reset values of gradien and Hessian
Definition at line 128 of file FumiliFCNBase.h.
|
pure virtualinherited |
The meaning of the vector of parameters is of course defined by the user, who uses the values of those parameters to calculate their function Value.
The order and the position of these parameters is strictly the one specified by the user when supplying the starting values for minimization. The starting values must be specified by the user, either via an std::vector<double> or the MnUserParameters supplied as input to the MINUIT minimizers such as VariableMetricMinimizer or MnMigrad. Later values are determined by MINUIT as it searches for the Minimum or performs whatever analysis is requested by the user.
| v | function parameters as defined by the user. |
Implemented in ROOT::Minuit2::FumiliChi2FCN, ROOT::Minuit2::FumiliMaximumLikelihoodFCN, ROOT::Minuit2::FCNAdapter, ROOT::Minuit2::FumiliFCNAdapter< Function >, and ROOT::Minuit2::ParametricFunction.
add interface to set dynamically a new error definition Re-implement this function if needed.
Reimplemented in ROOT::Minuit2::FCNAdapter, and ROOT::Minuit2::FumiliFCNAdapter< Function >.
|
inlineprotected |
Definition at line 136 of file FumiliFCNBase.h.
Error definition of the function.
MINUIT defines Parameter errors as the change in Parameter Value required to change the function Value by up. Normally, for chisquared fits it is 1, and for negative log likelihood, its Value is 0.5. If the user wants instead the 2-sigma errors for chisquared fits, it becomes 4, as Chi2(x+n*sigma) = Chi2(x) + n*n.
Implemented in ROOT::Minuit2::FCNAdapter, ROOT::Minuit2::FumiliChi2FCN, ROOT::Minuit2::FumiliFCNAdapter< Function >, and ROOT::Minuit2::FumiliMaximumLikelihoodFCN.
Return cached Value of objective function estimated previously using the FumiliFCNBase::EvaluateAll method.
Definition at line 91 of file FumiliFCNBase.h.
|
private |
Definition at line 145 of file FumiliFCNBase.h.
|
private |
Definition at line 146 of file FumiliFCNBase.h.
|
private |
Definition at line 143 of file FumiliFCNBase.h.
|
private |
Definition at line 144 of file FumiliFCNBase.h.