BCHistogramFitter.cxx
30 BCHistogramFitter::BCHistogramFitter(const TH1& hist, const TF1& func, const std::string& name) :
155 double BCHistogramFitter::CalculatePValueFast(const std::vector<double>& pars, unsigned nIterations)
169 expected[ibin] = Integral(pars, fHistogram.GetBinLowEdge(ibin + 1), fHistogram.GetBinLowEdge(ibin + 2));
188 const double yexp = Integral(pars, fHistogram.GetBinLowEdge(ibin), fHistogram.GetBinLowEdge(ibin + 1));
206 double BCHistogramFitter::CalculatePValueLeastSquares(const std::vector<double>& pars, bool weightExpect)
217 const double yexp = Integral(pars, fHistogram.GetBinLowEdge(ibin), fHistogram.GetBinLowEdge(ibin + 1));
void PrintShortFitSummary()
Prints a short summary of the fit results on the screen.
Definition: BCFitter.cxx:212
double CalculatePValueLeastSquares(const std::vector< double > &par, bool weightExpect=true)
Calculate the p-value using approximate chi^2 distribution of squared difference for conventional wei...
Definition: BCHistogramFitter.cxx:206
virtual double LogLikelihood(const std::vector< double > ¶meters)
The log of the conditional probability.
Definition: BCHistogramFitter.cxx:65
void SetBounds(unsigned index, double lower_bound, double upper_bound, bool fixed=false)
Set bounds for data values.
Definition: BCDataSet.cxx:267
void SetMarginalizationMethod(BCIntegrate::BCMarginalizationMethod method)
Definition: BCIntegrate.h:465
bool AddDataPoint(const BCDataPoint &datapoint)
Adds a data point to the data set.
Definition: BCDataSet.cxx:209
TGraph * GetErrorBandGraph(double level1, double level2) const
Definition: BCFitter.cxx:249
double FastPValue(const std::vector< unsigned > &observed, const std::vector< double > &expected, unsigned nIterations=1e5, unsigned seed=0)
Calculate the p value using fast MCMC for a histogram and the likelihood as test statistic.
Definition: BCMath.cxx:310
void DrawFit(const std::string &options="HIST", bool flaglegend=false)
Draw the fit in the current pad.
Definition: BCHistogramFitter.cxx:109
std::vector< double > FindMode(std::vector< double > start=std::vector< double >())
Do the mode finding using a method set via SetOptimizationMethod.
Definition: BCIntegrate.cxx:1022
BCHistogramFitter(const TH1 &hist, const TF1 &func, const std::string &name="histogram_fitter_model")
Constructor.
Definition: BCHistogramFitter.cxx:30
void SetFitFunctionIndices(int indexx, int indexy)
Sets indices of the x and y values in function fits.
Definition: BCFitter.h:187
BCAux::BCTrash< TObject > fObjectTrash
Storage for plot objects with proper clean-up.
Definition: BCEngineMCMC.h:1832
double CalculatePValueLikelihood(const std::vector< double > &par)
Calculate the p-value using approximate chi^2 distribution of scaled likelihood.
Definition: BCHistogramFitter.cxx:177
BCIntegrate::BCOptimizationMethod GetOptimizationMethod() const
Definition: BCIntegrate.h:264
double Integral(const std::vector< double > ¶meters, double xmin, double xmax)
Compute the integral of the fit function between xmin and xmax.
Definition: BCFitter.cxx:196
double LogPoisson(double x, double lambda)
Calculate the natural logarithm of a poisson distribution.
Definition: BCMath.cxx:53
void SetFillErrorBand(bool flag=true)
Turn on or off the filling of the error band during the MCMC run.
Definition: BCFitter.h:154
virtual double GraphCorrection(unsigned ibin) const
Take care of bin width when creating a graph from the fit function.
Definition: BCHistogramFitter.cxx:236
double CalculatePValueFast(const std::vector< double > &par, unsigned nIterations=100000)
Calculate the p-value using fast-MCMC and the likelihood as test statistic.
Definition: BCHistogramFitter.cxx:155
virtual const std::vector< double > & GetBestFitParameters() const
Definition: BCIntegrate.cxx:274
bool fFlagIntegration
Flag for using the ROOT TH1::Integral method (true), or linear interpolation (false) ...
Definition: BCFitter.h:297
void SetOptimizationMethod(BCIntegrate::BCOptimizationMethod method)
Definition: BCIntegrate.h:456