BCGraphFitter.cxx
23 BCGraphFitter::BCGraphFitter(const TGraphErrors& graph, const TF1& func, const std::string& name)
29 throw std::invalid_argument(std::string(__PRETTY_FUNCTION__) + ": TGraphErrors needs at least two points.");
38 throw std::invalid_argument(std::string(__PRETTY_FUNCTION__) + ": TGraphErrors has NO errors set on Y. Not able to fit.");
95 BCLog::OutDetail(Form("Fitting %d data points with function of %d parameters", GetNDataPoints(), GetNParameters()));
97 BCLog::OutWarning(Form("Number of parameters (%d) lower than or equal to number of points (%d).", GetNParameters(), GetNDataPoints()));
169 chi = (GetDataSet()->GetDataPoint(i)[1] - f.Eval(GetDataSet()->GetDataPoint(i)[0])) / GetDataSet()->GetDataPoint(i)[3];
void PrintShortFitSummary()
Prints a short summary of the fit results on the screen.
Definition: BCFitter.cxx:212
virtual double CalculatePValue(const std::vector< double > &pars, bool ndf=true)
Calculate p value from chi^2 distribution, with assumption of Gaussian distribution for all data poin...
Definition: BCGraphFitter.cxx:177
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
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
void SetFitFunctionIndices(int indexx, int indexy)
Sets indices of the x and y values in function fits.
Definition: BCFitter.h:187
void AdjustBoundForUncertainties(unsigned i, double nSigma, unsigned i_err1, int i_err2=-1)
Recalculate a data axis bound accounting for uncertainties specified by other data axes...
Definition: BCDataSet.cxx:232
BCAux::BCTrash< TObject > fObjectTrash
Storage for plot objects with proper clean-up.
Definition: BCEngineMCMC.h:1832
BCDataPoint & GetDataPoint(unsigned index)
Safer, but slower, access to data points.
Definition: BCDataSet.h:87
double LogGaus(double x, double mean=0, double sigma=1, bool norm=false)
Calculate the natural logarithm of a normal distribution function.
Definition: BCMath.cxx:24
BCIntegrate::BCOptimizationMethod GetOptimizationMethod() const
Definition: BCIntegrate.h:264
virtual double LogLikelihood(const std::vector< double > ¶meters)
The log of the conditional probability.
Definition: BCGraphFitter.cxx:64
void DrawFit(const std::string &options="", bool flaglegend=false)
Draw the fit in the current pad.
Definition: BCGraphFitter.cxx:119
BCGraphFitter(const TGraphErrors &graph, const TF1 &func, const std::string &name="graph_fitter_model")
Constructor.
Definition: BCGraphFitter.cxx:23
virtual const std::vector< double > & GetBestFitParameters() const
Definition: BCIntegrate.cxx:274
void SetOptimizationMethod(BCIntegrate::BCOptimizationMethod method)
Definition: BCIntegrate.h:456
virtual double CalculateChi2(const std::vector< double > &pars)
Calculate chi^2, the sum of [(y-f(x))/sigma_y]^2 for all data points.
Definition: BCGraphFitter.cxx:160