Abstract Minimizer class, defining the interface for the various minimizer (like Minuit2, Minuit, GSL, etc..) Plug-in's exist in ROOT to be able to instantiate the derived classes like ROOT::Math::GSLMinimizer or ROOT::Math::Minuit2Minimizer via the plug-in manager. Provides interface for setting the function to be minimized. The function must implemente the multi-dimensional generic interface ROOT::Math::IBaseFunctionMultiDim. If the function provides gradient calculation (implements the ROOT::Math::IGradientFunctionMultiDim interface) this will be used by the Minimizer. It Defines also interface for setting the initial values for the function variables (which are the parameters in of the model function in case of solving for fitting) and especifying their limits. It defines the interface to set and retrieve basic minimization parameters (for specific Minimizer parameters one must use the derived classes). Then it defines the interface to retrieve the result of minimization ( minimum X values, function value, gradient, error on the mimnimum, etc...) @ingroup MultiMin
virtual | ~Minimizer() |
virtual void | Clear() |
virtual bool | Contour(unsigned int ivar, unsigned int jvar, unsigned int& npoints, double* xi, double* xj) |
virtual double | Correlation(unsigned int i, unsigned int j) const |
virtual double | CovMatrix(unsigned int ivar, unsigned int jvar) const |
virtual int | CovMatrixStatus() const |
virtual double | Edm() const |
double | ErrorDef() const |
virtual const double* | Errors() const |
virtual bool | FixVariable(unsigned int ivar) |
virtual bool | GetCovMatrix(double* covMat) const |
virtual bool | GetHessianMatrix(double* hMat) const |
virtual bool | GetMinosError(unsigned int ivar, double& errLow, double& errUp, int option = 0) |
virtual bool | GetVariableSettings(unsigned int ivar, ROOT::Fit::ParameterSettings&) const |
virtual double | GlobalCC(unsigned int ivar) const |
virtual bool | Hesse() |
virtual bool | IsFixedVariable(unsigned int ivar) const |
bool | IsValidError() const |
unsigned int | MaxFunctionCalls() const |
unsigned int | MaxIterations() const |
virtual const double* | MinGradient() const |
virtual bool | Minimize() |
virtual double | MinValue() const |
virtual unsigned int | NCalls() const |
virtual unsigned int | NDim() const |
virtual unsigned int | NFree() const |
virtual unsigned int | NIterations() const |
virtual ROOT::Math::MinimizerOptions | Options() const |
double | Precision() const |
int | PrintLevel() const |
virtual void | PrintResults() |
virtual bool | ProvidesError() const |
virtual bool | ReleaseVariable(unsigned int ivar) |
virtual bool | Scan(unsigned int ivar, unsigned int& nstep, double* x, double* y, double xmin = 0, double xmax = 0) |
void | SetDefaultOptions() |
void | SetErrorDef(double up) |
virtual bool | SetFixedVariable(unsigned int ivar, const string& name, double val) |
virtual void | SetFunction(const ROOT::Math::IMultiGenFunction& func) |
virtual void | SetFunction(const ROOT::Math::IMultiGradFunction& func) |
virtual bool | SetLimitedVariable(unsigned int ivar, const string& name, double val, double step, double lower, double upper) |
virtual bool | SetLowerLimitedVariable(unsigned int ivar, const string& name, double val, double step, double lower) |
void | SetMaxFunctionCalls(unsigned int maxfcn) |
void | SetMaxIterations(unsigned int maxiter) |
void | SetOptions(const ROOT::Math::MinimizerOptions& opt) |
void | SetPrecision(double prec) |
void | SetPrintLevel(int level) |
void | SetStrategy(int strategyLevel) |
void | SetTolerance(double tol) |
virtual bool | SetUpperLimitedVariable(unsigned int ivar, const string& name, double val, double step, double upper) |
void | SetValidError(bool on) |
virtual bool | SetVariable(unsigned int ivar, const string& name, double val, double step) |
virtual bool | SetVariableInitialRange(unsigned int, double, double) |
virtual bool | SetVariableLimits(unsigned int ivar, double lower, double upper) |
virtual bool | SetVariableLowerLimit(unsigned int ivar, double lower) |
virtual bool | SetVariableStepSize(unsigned int ivar, double value) |
virtual bool | SetVariableUpperLimit(unsigned int ivar, double upper) |
virtual bool | SetVariableValue(unsigned int ivar, double value) |
virtual bool | SetVariableValues(const double* x) |
int | Status() const |
int | Strategy() const |
double | Tolerance() const |
virtual int | VariableIndex(const string& name) const |
virtual string | VariableName(unsigned int ivar) const |
virtual const double* | X() const |
ROOT::Math::MinimizerOptions | fOptions | minimizer options |
int | fStatus | status of minimizer |
bool | fValidError | flag to control if errors have been validated (Hesse has been run in case of Minuit) |
set a function to minimize using gradient
set a new free variable
set a new lower limit variable (override if minimizer supports them )
set a new upper limit variable (override if minimizer supports them )
set a new fixed variable (override if minimizer supports them )
set the value of an already existing variable
set the values of all existing variables (array must be dimensioned to the size of the existing parameters)
set the step size of an already existing variable
set the lower-limit of an already existing variable
set the upper-limit of an already existing variable
set the limits of an already existing variable
query if an existing variable is fixed (i.e. considered constant in the minimization) note that by default all variables are not fixed
get variable settings in a variable object (like ROOT::Fit::ParamsSettings)
set the initial range of an existing variable
return expected distance reached from the minimum (re-implement if minimizer provides it
{ return -1; }
return pointer to gradient values at the minimum
{ return NULL; }
this is <= Function().NDim() which is the total number of variables (free+ constrained ones)
number of free variables (real dimension of the problem) this is <= Function().NDim() which is the total (re-implement if minimizer supports bounded parameters)
{ return NDim(); }
return covariance matrices element for variables ivar,jvar if the variable is fixed the return value is zero The ordering of the variables is the same as in the parameter and errors vectors
Fill the passed array with the covariance matrix elements if the variable is fixed or const the value is zero. The array will be filled as cov[i *ndim + j] The ordering of the variables is the same as in errors and parameter value. This is different from the direct interface of Minuit2 or TMinuit where the values were obtained only to variable parameters
Fill the passed array with the Hessian matrix elements The Hessian matrix is the matrix of the second derivatives and is the inverse of the covariance matrix If the variable is fixed or const the values for that variables are zero. The array will be filled as h[i *ndim + j]
return status of covariance matrix using Minuit convention {0 not calculated 1 approximated 2 made pos def , 3 accurate} Minimizer who implements covariance matrix calculation will re-implement the method
return correlation coefficient between variable i and j. If the variable is fixed or const the return value is zero
return global correlation coefficient for variable i This is a number between zero and one which gives the correlation between the i-th parameter and that linear combination of all other parameters which is most strongly correlated with i. Minimizer must overload method if implemented
minos error for variable i, return false if Minos failed or not supported and the lower and upper errors are returned in errLow and errUp An extra flag specifies if only the lower (option=-1) or the upper (option=+1) error calculation is run (This feature is not yet implemented)
find the contour points (xi, xj) of the function for parameter ivar and jvar around the minimum The contour will be find for value of the function = Min + ErrorUp();
return reference to the objective function virtual const ROOT::Math::IGenFunction & Function() const = 0; print the result according to set level (implemented for TMinuit for mantaining Minuit-style printing)
{}
get name of variables (override if minimizer support storing of variable names) return an empty string if variable is not found
get index of variable given a variable given a name return -1 if variable is not found
minimizer configuration parameters set print level
{ return fOptions.PrintLevel(); }
max number of function calls
{ return fOptions.MaxFunctionCalls(); }
precision of minimizer in the evaluation of the objective function ( a value <=0 corresponds to the let the minimizer choose its default one)
return the statistical scale used for calculate the error is typically 1 for Chi2 and 0.5 for likelihood minimization
set maximum of function calls
{ if (maxfcn > 0) fOptions.SetMaxFunctionCalls(maxfcn); }
set maximum iterations (one iteration can have many function calls)
{ if (maxiter > 0) fOptions.SetMaxIterations(maxiter); }
set in the minimizer the objective function evaluation precision ( a value <=0 means the minimizer will choose its optimal value automatically, i.e. default case)
{ fOptions.SetPrecision(prec); }
flag to check if minimizer needs to perform accurate error analysis (e.g. run Hesse for Minuit)
{ fValidError = on; }