Belle II Software  release-08-01-10
ChebFitter Class Reference

Unbinned Maximum Likelihood fitter with a possibility to use Chebyshev interpolation. More...

#include <ChebFitter.h>

Collaboration diagram for ChebFitter:

Public Member Functions

void setDataAndFunction (std::function< double(double, Pars)> fun, const std::vector< double > &data)
 Set the fitted data and the fitted function, should be called before init.
 
void init (int Size, double xMin, double xMax)
 Initialize the fitter (the Chebyshev coefficients)
 
double operator() (const double *par) const
 Evaluate the log likelihood.
 
std::pair< Pars, Eigen::MatrixXd > fitData (Pars pars, Limits limits, bool UseCheb=true)
 Fit the data with specified initial values of parameters and limits on them.
 

Private Member Functions

Eigen::VectorXd getLogFunction (Pars pars) const
 Get the -2*log(p(x)) on the Cheb nodes.
 
double getLogLikelihoodSlow (const Pars &pars) const
 Calculate log likelihood using exact formula.
 
double getLogLikelihoodFast (const Pars &pars) const
 Calculate log likelihood using approximation based on Chebyshev polynomials (typically faster)
 
Eigen::VectorXd getDataGrid () const
 Calculate Chebyshev coefficients for the data set.
 
std::pair< Eigen::VectorXd, Eigen::MatrixXd > getDataGridWithCov () const
 Calculate Chebyshev coefficients with the covariance (useful for toy studies)
 
double getFunctionFast (const Pars &pars, double x)
 Evaluate the fitted function approximated with the Chebyshev polynomial, typically runs faster.
 

Private Attributes

std::vector< double > m_data
 vector with the data points to be fitted
 
Eigen::VectorXd m_dataGrid
 vector with the data points related to the cheb nodes (m_dataGrid.size = nodes.size)
 
Eigen::MatrixXd m_dataGridCov
 vector with the data points covariances (useful for toy studies)
 
Eigen::MatrixXd m_coefsMat
 transformation matrix from chebPol to gridPoints
 
Eigen::VectorXd m_nodes
 vector with cheb nodes
 
Eigen::VectorXd m_weights
 vector with cheb weights for integration
 
std::vector< std::string > m_parNames
 vector with names of the parameters
 
bool m_useCheb = true
 flag to use approximation based on Chebyshev polynomials
 
std::function< double(double, Pars)> m_myFun
 function to fit
 

Detailed Description

Unbinned Maximum Likelihood fitter with a possibility to use Chebyshev interpolation.

Definition at line 32 of file ChebFitter.h.


The documentation for this class was generated from the following files: