BAT
0.9.4
The Bayesian analysis toolkit
|
A class for fitting graphs with functions. More...
#include <BCGraphFitter.h>
Public Member Functions | |
Constructors and destructors | |
BCGraphFitter () | |
BCGraphFitter (const char *name) | |
BCGraphFitter (TGraphErrors *graph, TF1 *func) | |
BCGraphFitter (const char *name, TGraphErrors *graph, TF1 *func) | |
~BCGraphFitter () | |
Member functions (get) | |
TGraphErrors * | GetGraph () |
TF1 * | GetFitFunction () |
TGraph * | GetErrorBand () |
TGraph * | GetGraphFitFunction () |
Member functions (set) | |
int | SetGraph (TGraphErrors *graph) |
int | SetFitFunction (TF1 *func) |
Member functions (miscellaneous methods) | |
double | LogLikelihood (const std::vector< double > ¶meters) |
double | FitFunction (const std::vector< double > &x, const std::vector< double > ¶meters) |
int | Fit () |
int | Fit (TGraphErrors *graph, TF1 *func) |
void | DrawFit (const char *options="", bool flaglegend=false) |
virtual double | CDF (const std::vector< double > ¶meters, int index, bool lower=false) |
![]() | |
BCFitter () | |
BCFitter (const char *name) | |
~BCFitter () | |
TGraph * | GetErrorBand () |
TH2D * | GetErrorBandXY () const |
TH2D * | GetErrorBandXY_yellow (double level=.68, int nsmooth=0) const |
std::vector< double > | GetErrorBand (double level) const |
TGraph * | GetErrorBandGraph (double level1, double level2) const |
TGraph * | GetFitFunctionGraph (const std::vector< double > ¶meters) |
TGraph * | GetFitFunctionGraph () |
TGraph * | GetFitFunctionGraph (const std::vector< double > ¶meters, double xmin, double xmax, int n=1000) |
void | FixDataAxis (unsigned int index, bool fixed) |
bool | GetFixedDataAxis (unsigned int index) const |
void | SetFillErrorBand (bool flag=true) |
void | SetErrorBandHisto (TH2D *h) |
void | UnsetFillErrorBand () |
void | SetFitFunctionIndexX (int index) |
void | SetFitFunctionIndexY (int index) |
void | SetFitFunctionIndices (int indexx, int indexy) |
void | SetErrorBandContinuous (bool flag) |
int | ReadErrorBandFromFile (const char *file) |
void | MCMCIterationInterface () |
void | MarginalizePreprocess () |
void | MarginalizePostprocess () |
void | FillErrorBand () |
![]() | |
BCModel (const char *name="model") | |
BCModel (const BCModel &bcmodel) | |
virtual | ~BCModel () |
BCModel & | operator= (const BCModel &bcmodel) |
const std::string & | GetName () const |
double | GetModelAPrioriProbability () const |
double | GetModelAPosterioriProbability () const |
BCDataSet * | GetDataSet () const |
BCDataPoint * | GetDataPointLowerBoundaries () const |
BCDataPoint * | GetDataPointUpperBoundaries () const |
double | GetDataPointLowerBoundary (unsigned int index) const |
double | GetDataPointUpperBoundary (unsigned int index) const |
bool | GetFlagBoundaries () const |
unsigned | GetNDataPoints () const |
BCDataPoint * | GetDataPoint (unsigned int index) const |
void | SetName (const char *name) |
void | SetModelAPrioriProbability (double probability) |
void | SetModelAPosterioriProbability (double probability) |
virtual int | AddParameter (BCParameter *parameter) |
void | SetDataSet (BCDataSet *dataset) |
void | SetSingleDataPoint (BCDataPoint *datapoint) |
void | SetSingleDataPoint (BCDataSet *dataset, unsigned int index) |
void | SetDataBoundaries (unsigned int index, double lowerboundary, double upperboundary, bool fixed=false) |
void | SetDataPointLowerBoundaries (BCDataPoint *datasetlowerboundaries) |
void | SetDataPointUpperBoundaries (BCDataPoint *datasetupperboundaries) |
void | SetDataPointLowerBoundary (int index, double lowerboundary) |
void | SetDataPointUpperBoundary (int index, double upperboundary) |
int | SetPrior (int index, TF1 *f) |
int | SetPrior (const char *name, TF1 *f) |
int | SetPriorDelta (int index, double value) |
int | SetPriorDelta (const char *name, double value) |
int | SetPriorGauss (int index, double mean, double sigma) |
int | SetPriorGauss (const char *name, double mean, double sigma) |
int | SetPriorGauss (int index, double mean, double sigmadown, double sigmaup) |
int | SetPriorGauss (const char *name, double mean, double sigmadown, double sigmaup) |
int | SetPrior (int index, TH1 *h, bool flag=false) |
int | SetPrior (const char *name, TH1 *h, bool flag=false) |
int | SetPriorConstant (int index) |
int | SetPriorConstant (const char *name) |
int | SetPriorConstantAll () |
void | Copy (const BCModel &bcmodel) |
double | APrioriProbability (const std::vector< double > ¶meters) |
virtual double | LogAPrioriProbability (const std::vector< double > ¶meters) |
virtual double | Likelihood (const std::vector< double > ¶ms) |
double | ProbabilityNN (const std::vector< double > ¶ms) |
double | LogProbabilityNN (const std::vector< double > ¶meters) |
double | Probability (const std::vector< double > ¶meter) |
double | LogProbability (const std::vector< double > ¶meter) |
virtual double | SamplingFunction (const std::vector< double > ¶meters) |
double | Eval (const std::vector< double > ¶meters) |
virtual double | LogEval (const std::vector< double > ¶meters) |
virtual void | CorrelateDataPointValues (std::vector< double > &x) |
double | GetPvalueFromChi2 (const std::vector< double > &par, int sigma_index) |
double | GetPvalueFromKolmogorov (const std::vector< double > &par, int index) |
double | GetPvalueFromChi2NDoF (std::vector< double > par, int sigma_index) |
BCH1D * | CalculatePValue (std::vector< double > par, bool flag_histogram=false) |
double | GetPValue () |
double | GetPValueNDoF () |
double | GetChi2NDoF () |
std::vector< double > | GetChi2Runs (int dataIndex, int sigmaIndex) |
void | SetGoFNIterationsMax (int n) |
void | SetGoFNIterationsRun (int n) |
void | SetGoFNChains (int n) |
double | HessianMatrixElement (const BCParameter *parameter1, const BCParameter *parameter2, std::vector< double > point) |
void | PrintSummary () |
void | PrintResults (const char *file) |
void | PrintShortFitSummary (int chi2flag=0) |
void | PrintHessianMatrix (std::vector< double > parameters) |
Additional Inherited Members | |
![]() | |
TH2D * | fErrorBandXY |
![]() | |
std::string | fName |
double | fModelAPriori |
double | fModelAPosteriori |
BCDataSet * | fDataSet |
BCDataPoint * | fDataPointLowerBoundaries |
BCDataPoint * | fDataPointUpperBoundaries |
std::vector< bool > | fDataFixedValues |
double | fPValue |
double | fChi2NDoF |
double | fPValueNDoF |
bool | flag_discrete |
int | fGoFNIterationsMax |
int | fGoFNIterationsRun |
int | fGoFNChains |
std::vector< TNamed * > | fPriorContainer |
bool | fPriorConstantAll |
std::vector< bool > | fPriorContainerConstant |
std::vector< bool > | fPriorContainerInterpolate |
A class for fitting graphs with functions.
Definition at line 35 of file BCGraphFitter.h.
BCGraphFitter::BCGraphFitter | ( | ) |
Default constructor
Definition at line 27 of file BCGraphFitter.cxx.
BCGraphFitter::BCGraphFitter | ( | const char * | name | ) |
BCGraphFitter::BCGraphFitter | ( | TGraphErrors * | graph, |
TF1 * | func | ||
) |
Constructor
graph | pointer to TGraphErrors |
func | pointer to TF1 |
Definition at line 53 of file BCGraphFitter.cxx.
BCGraphFitter::BCGraphFitter | ( | const char * | name, |
TGraphErrors * | graph, | ||
TF1 * | func | ||
) |
Constructor
name | name of the model |
graph | pointer to TGraphErrors |
func | pointer to TF1 |
Definition at line 69 of file BCGraphFitter.cxx.
BCGraphFitter::~BCGraphFitter | ( | ) |
The default destructor.
Definition at line 206 of file BCGraphFitter.cxx.
|
virtual |
1dim cumulative distribution function of the probability to get the data f(x_i|param) for a single measurement, assumed to be of identical functional form for all measurements
parameters | The parameter values at which point to compute the cdf |
index | The data point index starting at 0,1...N-1 |
lower | only needed for discrete distributions! Return the CDF for the count one less than actually observed, e.g. in Poisson process, if 3 actually observed, then CDF(2) is returned |
Reimplemented from BCModel.
Definition at line 383 of file BCGraphFitter.cxx.
|
virtual |
Draw the fit in the current pad.
Implements BCFitter.
Definition at line 330 of file BCGraphFitter.cxx.
|
virtual |
Performs the fit. The graph and the function has to be set beforehand.
Implements BCFitter.
Definition at line 281 of file BCGraphFitter.cxx.
int BCGraphFitter::Fit | ( | TGraphErrors * | graph, |
TF1 * | func | ||
) |
Performs the fit of the graph with the function.
graph | pointer to TGraphErrors object |
func | pointer to TF1 object |
Definition at line 262 of file BCGraphFitter.cxx.
|
virtual |
Returns the value of the 1D fit function for a given set of parameters at a given x.
x | point to calculate the function value at |
parameters | parameters of the function |
Reimplemented from BCFitter.
Definition at line 247 of file BCGraphFitter.cxx.
|
inline |
Definition at line 85 of file BCGraphFitter.h.
|
inline |
Definition at line 80 of file BCGraphFitter.h.
|
inline |
Definition at line 75 of file BCGraphFitter.h.
|
inline |
Definition at line 90 of file BCGraphFitter.h.
|
virtual |
The log of the prior probability. It is set to be flat in all parameters.
parameters | vector containing the parameter values The log of the conditional probability. |
parameters | vector containing the parameter values |
Implements BCModel.
Definition at line 213 of file BCGraphFitter.cxx.
int BCGraphFitter::SetFitFunction | ( | TF1 * | func | ) |
func | pointer to TF1 object |
Definition at line 162 of file BCGraphFitter.cxx.
int BCGraphFitter::SetGraph | ( | TGraphErrors * | graph | ) |
graph | pointer to TGraphErrors object |
Definition at line 85 of file BCGraphFitter.cxx.