Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Fit::FitUtil Namespace Reference

namespace defining utility free functions using in Fit for evaluating the various fit method functions (chi2, likelihood, etc..) given the data and the model function More...

Classes

struct  Evaluate
 
class  IntegralEvaluator
 
class  LikelihoodAux
 
class  LikelihoodAux< double >
 
struct  ParamDerivFunc
 
class  SimpleGradientCalculator
 

Typedefs

typedef ROOT::Math::IParamMultiGradFunction IGradModelFunction
 
template<class T >
using IGradModelFunctionTempl = ROOT::Math::IParamMultiGradFunctionTempl< T >
 
typedef ROOT::Math::IParamMultiFunction IModelFunction
 
template<class T >
using IModelFunctionTempl = ROOT::Math::IParamMultiFunctionTempl< T >
 

Functions

template<class GFunc >
void CalculateGradientIntegral (const GFunc &gfunc, const double *x1, const double *x2, const double *p, double *g)
 
bool CheckInfNaNValue (double &rval)
 
double CorrectValue (double rval)
 
double EvaluateChi2 (const IModelFunction &func, const BinData &data, const double *p, unsigned int &nPoints, ::ROOT::EExecutionPolicy executionPolicy, unsigned nChunks=0)
 Chi2 Functions.
 
double EvaluateChi2Effective (const IModelFunction &func, const BinData &data, const double *x, unsigned int &nPoints)
 evaluate the effective Chi2 given a model function and the data at the point x.
 
void EvaluateChi2Gradient (const IModelFunction &func, const BinData &data, const double *p, double *grad, unsigned int &nPoints, ::ROOT::EExecutionPolicy executionPolicy=::ROOT::EExecutionPolicy::kSequential, unsigned nChunks=0)
 evaluate the Chi2 gradient given a model function and the data at the point p.
 
double EvaluateChi2Residual (const IModelFunction &func, const BinData &data, const double *p, unsigned int ipoint, double *g=nullptr, double *h=nullptr, bool hasGrad=false, bool fullHessian=false)
 evaluate the residual contribution to the Chi2 given a model function and the BinPoint data and if the pointer g is not null evaluate also the gradient of the residual.
 
double EvaluateLogL (const IModelFunction &func, const UnBinData &data, const double *p, int iWeight, bool extended, unsigned int &nPoints, ::ROOT::EExecutionPolicy executionPolicy, unsigned nChunks=0)
 evaluate the LogL given a model function and the data at the point x.
 
void EvaluateLogLGradient (const IModelFunction &func, const UnBinData &data, const double *p, double *grad, unsigned int &nPoints, ::ROOT::EExecutionPolicy executionPolicy=::ROOT::EExecutionPolicy::kSequential, unsigned nChunks=0)
 evaluate the LogL gradient given a model function and the data at the point p.
 
double EvaluatePdf (const IModelFunction &func, const UnBinData &data, const double *p, unsigned int ipoint, double *g=nullptr, double *h=nullptr, bool hasGrad=false, bool fullHessian=false)
 evaluate the pdf contribution to the LogL given a model function and the BinPoint data.
 
double EvaluatePoissonBinPdf (const IModelFunction &func, const BinData &data, const double *x, unsigned int ipoint, double *g=nullptr, double *h=nullptr, bool hasGrad=false, bool fullHessian=false)
 evaluate the pdf contribution to the Poisson LogL given a model function and the BinPoint data.
 
double EvaluatePoissonLogL (const IModelFunction &func, const BinData &data, const double *p, int iWeight, bool extended, unsigned int &nPoints, ::ROOT::EExecutionPolicy executionPolicy, unsigned nChunks=0)
 evaluate the Poisson LogL given a model function and the data at the point p.
 
void EvaluatePoissonLogLGradient (const IModelFunction &func, const BinData &data, const double *p, double *grad, unsigned int &nPoints, ::ROOT::EExecutionPolicy executionPolicy=::ROOT::EExecutionPolicy::kSequential, unsigned nChunks=0)
 evaluate the Poisson LogL given a model function and the data at the point p.
 
unsigned setAutomaticChunking (unsigned nEvents)
 

Detailed Description

namespace defining utility free functions using in Fit for evaluating the various fit method functions (chi2, likelihood, etc..) given the data and the model function

Typedef Documentation

◆ IGradModelFunction

◆ IGradModelFunctionTempl

Definition at line 68 of file FitUtil.h.

◆ IModelFunction

◆ IModelFunctionTempl

Definition at line 71 of file FitUtil.h.

Function Documentation

◆ CalculateGradientIntegral()

template<class GFunc >
void ROOT::Fit::FitUtil::CalculateGradientIntegral ( const GFunc gfunc,
const double x1,
const double x2,
const double p,
double g 
)

Definition at line 202 of file FitUtil.cxx.

◆ CheckInfNaNValue()

bool ROOT::Fit::FitUtil::CheckInfNaNValue ( double rval)

Definition at line 181 of file FitUtil.cxx.

◆ CorrectValue()

double ROOT::Fit::FitUtil::CorrectValue ( double  rval)

Definition at line 167 of file FitUtil.cxx.

◆ EvaluateChi2()

double ROOT::Fit::FitUtil::EvaluateChi2 ( const IModelFunction func,
const BinData data,
const double p,
unsigned int nPoints,
::ROOT::EExecutionPolicy  executionPolicy,
unsigned  nChunks = 0 
)

Chi2 Functions.

evaluate the Chi2 given a model function and the data at the point x. return also nPoints as the effective number of used points in the Chi2 evaluation

Definition at line 226 of file FitUtil.cxx.

◆ EvaluateChi2Effective()

double ROOT::Fit::FitUtil::EvaluateChi2Effective ( const IModelFunction func,
const BinData data,
const double x,
unsigned int nPoints 
)

evaluate the effective Chi2 given a model function and the data at the point x.

The effective chi2 uses the errors on the coordinates : W = 1/(sigma_y**2 + ( sigma_x_i * df/dx_i )**2 ) return also nPoints as the effective number of used points in the Chi2 evaluation

Definition at line 424 of file FitUtil.cxx.

◆ EvaluateChi2Gradient()

void ROOT::Fit::FitUtil::EvaluateChi2Gradient ( const IModelFunction func,
const BinData data,
const double p,
double grad,
unsigned int nPoints,
::ROOT::EExecutionPolicy  executionPolicy = ::ROOT::EExecutionPolicy::kSequential,
unsigned  nChunks = 0 
)

evaluate the Chi2 gradient given a model function and the data at the point p.

return also nPoints as the effective number of used points in the Chi2 evaluation

◆ EvaluateChi2Residual()

double ROOT::Fit::FitUtil::EvaluateChi2Residual ( const IModelFunction func,
const BinData data,
const double p,
unsigned int  i,
double g = nullptr,
double h = nullptr,
bool  hasGrad = false,
bool  useFullHessian = false 
)

evaluate the residual contribution to the Chi2 given a model function and the BinPoint data and if the pointer g is not null evaluate also the gradient of the residual.

evaluate the chi2 contribution (residual term) only for data with no coord-errors This function is used in the specialized least square algorithms like FUMILI or L.M.

If the function provides parameter derivatives they are used otherwise a simple derivative calculation is used

if we have error on the coordinates the residual weight depends on the function value and the approximation used by Fumili and Levenberg-Marquardt cannot be used. Also the expected error and bin integral options should not be used in this case

Definition at line 545 of file FitUtil.cxx.

◆ EvaluateLogL()

double ROOT::Fit::FitUtil::EvaluateLogL ( const IModelFunction func,
const UnBinData data,
const double p,
int  iWeight,
bool  extended,
unsigned int nPoints,
::ROOT::EExecutionPolicy  executionPolicy,
unsigned  nChunks = 0 
)

evaluate the LogL given a model function and the data at the point x.

return also nPoints as the effective number of used points in the LogL evaluation

◆ EvaluateLogLGradient()

void ROOT::Fit::FitUtil::EvaluateLogLGradient ( const IModelFunction func,
const UnBinData data,
const double p,
double grad,
unsigned int nPoints,
::ROOT::EExecutionPolicy  executionPolicy = ::ROOT::EExecutionPolicy::kSequential,
unsigned  nChunks = 0 
)

evaluate the LogL gradient given a model function and the data at the point p.

return also nPoints as the effective number of used points in the LogL evaluation

◆ EvaluatePdf()

double ROOT::Fit::FitUtil::EvaluatePdf ( const IModelFunction func,
const UnBinData data,
const double p,
unsigned int  ipoint,
double g = nullptr,
double h = nullptr,
bool  hasGrad = false,
bool  fullHessian = false 
)

evaluate the pdf contribution to the LogL given a model function and the BinPoint data.

If the pointer g is not null evaluate also the gradient of the pdf. If the function provides parameter derivatives they are used otherwise a simple derivative calculation is used

Definition at line 891 of file FitUtil.cxx.

◆ EvaluatePoissonBinPdf()

double ROOT::Fit::FitUtil::EvaluatePoissonBinPdf ( const IModelFunction func,
const BinData data,
const double x,
unsigned int  ipoint,
double g = nullptr,
double h = nullptr,
bool  hasGrad = false,
bool  fullHessian = false 
)

evaluate the pdf contribution to the Poisson LogL given a model function and the BinPoint data.

evaluate the pdf (Poisson) contribution to the logl (return actually log of pdf) and its gradient (gradient of log(pdf))

If the pointer g is not null evaluate also the gradient of the Poisson pdf. If the function provides parameter derivatives they are used otherwise a simple derivative calculation is used

Definition at line 1297 of file FitUtil.cxx.

◆ EvaluatePoissonLogL()

double ROOT::Fit::FitUtil::EvaluatePoissonLogL ( const IModelFunction func,
const BinData data,
const double p,
int  iWeight,
bool  extended,
unsigned int nPoints,
::ROOT::EExecutionPolicy  executionPolicy,
unsigned  nChunks = 0 
)

evaluate the Poisson LogL given a model function and the data at the point p.

return also nPoints as the effective number of used points in the LogL evaluation By default is extended, pass extend to false if want to be not extended (MultiNomial)

◆ EvaluatePoissonLogLGradient()

void ROOT::Fit::FitUtil::EvaluatePoissonLogLGradient ( const IModelFunction func,
const BinData data,
const double p,
double grad,
unsigned int nPoints,
::ROOT::EExecutionPolicy  executionPolicy = ::ROOT::EExecutionPolicy::kSequential,
unsigned  nChunks = 0 
)

evaluate the Poisson LogL given a model function and the data at the point p.

return also nPoints as the effective number of used points in the LogL evaluation

◆ setAutomaticChunking()

unsigned ROOT::Fit::FitUtil::setAutomaticChunking ( unsigned  nEvents)

Definition at line 1841 of file FitUtil.cxx.