Class implementing the standard chi square function, which is the sum of the squares of the figures-of-merit calculated for each measurement point, the individual figures-of-merit being: (the Value predicted by the model-measured Value)/standard deviation.
Definition at line 43 of file FumiliStandardChi2FCN.h.
Public Member Functions | |
| FumiliStandardChi2FCN (const ParametricFunction &modelFCN, std::span< const double > meas, std::span< const double > pos, std::span< const double > mvar) | |
| Constructor which initializes chi square function for one-dimensional model function. | |
| FumiliStandardChi2FCN (const ParametricFunction &modelFCN, std::span< const double > meas, std::span< const std::vector< double > > pos, std::span< const double > mvar) | |
| Constructor which initializes the multi-dimensional model function. | |
| virtual unsigned int | Dimension () |
| return number of function variable (parameters) , i.e. | |
| std::vector< double > | Elements (std::vector< double > const &par) const override |
| Evaluates the model function for the different measurement points and the Parameter values supplied, calculates a figure-of-merit for each measurement and returns a vector containing the result of this evaluation. | |
| virtual double | ErrorDef () const |
| Error definition of the function. | |
| void | EvaluateAll (std::vector< double > const &par) override |
| 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). | |
| const std::vector< double > & | GetMeasurement (int Index) const override |
| Accessor to the position of the measurement (x coordinate). | |
| int | GetNumberOfMeasurements () const override |
| Accessor to the number of measurements used for calculating the chi-square. | |
| 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 |
| const ParametricFunction * | ModelFunction () const |
| Returns the model function used for the data. | |
| double | operator() (std::vector< double > const &par) const override |
| Calculates the sum of Elements squared, ie the chi-square. | |
| virtual void | SetErrorDef (double) |
| add interface to set dynamically a new error definition Re-implement this function if needed. | |
| void | SetModelFunction (const ParametricFunction &modelFCN) |
| Sets the model function for the data (for example gaussian+linear for a peak). | |
| double | Up () const override |
| ! | |
| 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 |
| std::vector< double > | fInvErrors |
| std::vector< double > | fMeasurements |
| const ParametricFunction * | fModelFunction = nullptr |
| unsigned int | fNumberOfParameters |
| std::vector< std::vector< double > > | fPositions |
| double | fValue |
#include <Minuit2/FumiliStandardChi2FCN.h>
|
inline |
Constructor which initializes chi square function for one-dimensional model function.
| modelFCN | the model function used for describing the data. |
| meas | vector containing the measured values. |
| pos | vector containing the x values corresponding to the measurements |
| mvar | vector containing the variances corresponding to each measurement (where the variance equals the standard deviation squared). If the variances are zero, a Value of 1 is used (as it is done in ROOT/PAW) |
Definition at line 63 of file FumiliStandardChi2FCN.h.
|
inline |
Constructor which initializes the multi-dimensional model function.
| modelFCN | the model function used for describing the data. |
| meas | vector containing the measured values. |
| pos | vector containing the x values corresponding to the measurements |
| mvar | vector containing the variances corresponding to each measurement (where the variance equals the standard deviation squared). If the variances are zero, a Value of 1 is used (as it is done in ROOT/PAW) |
Definition at line 104 of file FumiliStandardChi2FCN.h.
|
inlinevirtualinherited |
return number of function variable (parameters) , i.e.
function dimension
Definition at line 121 of file FumiliFCNBase.h.
|
overridevirtual |
Evaluates the model function for the different measurement points and the Parameter values supplied, calculates a figure-of-merit for each measurement and returns a vector containing the result of this evaluation.
The figure-of-merit is (Value predicted by the model function-measured Value)/standard deviation.
| par | vector of Parameter values to feed to the model function. |
Implements ROOT::Minuit2::FumiliChi2FCN.
Definition at line 19 of file FumiliStandardChi2FCN.cxx.
|
inlinevirtualinherited |
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!!!!!!!!!!!!!!!!!
|
overridevirtual |
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 |
Implements ROOT::Minuit2::FumiliFCNBase.
Definition at line 57 of file FumiliStandardChi2FCN.cxx.
|
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.
|
overridevirtual |
Accessor to the position of the measurement (x coordinate).
| Index | Index of the measuerement the position of which to return. |
Implements ROOT::Minuit2::FumiliChi2FCN.
Definition at line 45 of file FumiliStandardChi2FCN.cxx.
|
overridevirtual |
Accessor to the number of measurements used for calculating the chi-square.
Implements ROOT::Minuit2::FumiliChi2FCN.
Definition at line 51 of file FumiliStandardChi2FCN.cxx.
|
inlineprotectedinherited |
Definition at line 138 of file FumiliFCNBase.h.
|
inlinevirtualinherited |
Return cached Value of function Gradient estimated previously using the FumiliFCNBase::EvaluateAll method.
Definition at line 97 of file FumiliFCNBase.h.
|
inlineoverridevirtualinherited |
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 |
|
inlinevirtualinherited |
Reimplemented in ROOT::Minuit2::FCNAdapter.
|
inlineoverridevirtualinherited |
Reimplemented from ROOT::Minuit2::FCNBase.
Definition at line 56 of file FumiliFCNBase.h.
|
inlinevirtualinherited |
Reimplemented in ROOT::Minuit2::FCNAdapter.
|
inlineprotectedinherited |
Definition at line 140 of file FumiliFCNBase.h.
|
inlineoverridevirtualinherited |
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.
|
inlinevirtualinherited |
Definition at line 108 of file FumiliFCNBase.h.
|
inlineprotectedvirtualinherited |
initialize and reset values of gradien and Hessian
Definition at line 128 of file FumiliFCNBase.h.
|
inlineinherited |
Returns the model function used for the data.
Definition at line 70 of file FumiliChi2FCN.h.
|
inlineoverridevirtualinherited |
Calculates the sum of Elements squared, ie the chi-square.
The user must implement in a class which inherits from FumiliChi2FCN the member function Elements() which will supply the Elements for the sum.
| par | vector containing the Parameter values for the model function |
Implements ROOT::Minuit2::FCNBase.
Definition at line 128 of file FumiliChi2FCN.h.
|
inlinevirtualinherited |
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 >.
|
inlineprotectedinherited |
Definition at line 136 of file FumiliFCNBase.h.
|
inlineinherited |
Sets the model function for the data (for example gaussian+linear for a peak).
| modelFCN | a reference to the model function. |
Definition at line 60 of file FumiliChi2FCN.h.
|
inlineoverridevirtualinherited |
!
!!!!!!!!!!! to be commented
Implements ROOT::Minuit2::FCNBase.
Definition at line 147 of file FumiliChi2FCN.h.
|
inlinevirtualinherited |
Return cached Value of objective function estimated previously using the FumiliFCNBase::EvaluateAll method.
Definition at line 91 of file FumiliFCNBase.h.
|
privateinherited |
Definition at line 145 of file FumiliFCNBase.h.
|
privateinherited |
Definition at line 146 of file FumiliFCNBase.h.
|
private |
Definition at line 183 of file FumiliStandardChi2FCN.h.
|
private |
Definition at line 180 of file FumiliStandardChi2FCN.h.
|
privateinherited |
Definition at line 151 of file FumiliChi2FCN.h.
|
privateinherited |
Definition at line 143 of file FumiliFCNBase.h.
|
private |
Definition at line 182 of file FumiliStandardChi2FCN.h.
|
privateinherited |
Definition at line 144 of file FumiliFCNBase.h.