Belle II Software development
|
Unbinned Maximum Likelihood fitter with a possibility to use Chebyshev interpolation. More...
#include <ChebFitter.h>
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 | |
Unbinned Maximum Likelihood fitter with a possibility to use Chebyshev interpolation.
Definition at line 32 of file ChebFitter.h.
|
inline |
Set the fitted data and the fitted function, should be called before init.
Definition at line 37 of file ChebFitter.h.
|
private |
transformation matrix from chebPol to gridPoints
Definition at line 81 of file ChebFitter.h.
|
private |
vector with the data points to be fitted
Definition at line 78 of file ChebFitter.h.
|
private |
vector with the data points related to the cheb nodes (m_dataGrid.size = nodes.size)
Definition at line 79 of file ChebFitter.h.
|
private |
vector with the data points covariances (useful for toy studies)
Definition at line 80 of file ChebFitter.h.
|
private |
function to fit
Definition at line 89 of file ChebFitter.h.
|
private |
vector with cheb nodes
Definition at line 83 of file ChebFitter.h.
|
private |
vector with names of the parameters
Definition at line 86 of file ChebFitter.h.
|
private |
flag to use approximation based on Chebyshev polynomials
Definition at line 87 of file ChebFitter.h.
|
private |
vector with cheb weights for integration
Definition at line 84 of file ChebFitter.h.