BayesianAnalysisToolkit
0.9.3
|
The class for testing model hypotheses. More...
#include <BCGoFTest.h>
Public Member Functions | |
Constructors and destructors | |
BCGoFTest (const char *name) | |
~BCGoFTest () | |
Member functions (get) | |
double | GetCalculatedPValue (bool flag_histogram=false) |
TH1D * | GetHistogramLogProb () |
BCModel * | GetTestModel () |
Member functions (set) | |
void | SetTestModel (BCModel *testmodel) |
int | SetTestPoint (std::vector< double > parameters) |
Member functions (miscellaneous methods) | |
double | LogLikelihood (const std::vector< double > ¶meters) |
double | LogAPrioriProbability (const std::vector< double > &) |
void | MCMCUserIterationInterface () |
![]() | |
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 | 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) |
virtual double | CDF (const std::vector< double > &, int, bool) |
![]() | |
BCIntegrate () | |
BCIntegrate (const BCIntegrate &bcintegrate) | |
virtual | ~BCIntegrate () |
BCIntegrate & | operator= (const BCIntegrate &bcintegrate) |
int | ReadMarginalizedFromFile (const char *file) |
BCH1D * | GetMarginalized (const BCParameter *parameter) |
BCH1D * | GetMarginalized (const char *name) |
BCH1D * | GetMarginalized (unsigned index) |
BCH2D * | GetMarginalized (const BCParameter *parameter1, const BCParameter *parameter2) |
BCH2D * | GetMarginalized (const char *name1, const char *name2) |
BCH2D * | GetMarginalized (unsigned index1, unsigned index2) |
int | PrintAllMarginalized1D (const char *filebase) |
int | PrintAllMarginalized2D (const char *filebase) |
int | PrintAllMarginalized (const char *file, std::string options1d="BTsiB3CS1D0pdf0Lmeanmode", std::string options2d="BTfB3CS1meangmode", unsigned int hdiv=1, unsigned int ndiv=1) |
double | GetIntegral () const |
BCIntegrate::BCOptimizationMethod | GetOptimizationMethod () const |
BCIntegrate::BCIntegrationMethod | GetIntegrationMethod () const |
BCIntegrate::BCMarginalizationMethod | GetMarginalizationMethod () const |
BCIntegrate::BCSASchedule | GetSASchedule () const |
void | GetRandomVectorUnitHypercube (std::vector< double > &x) const |
void | GetRandomVectorInParameterSpace (std::vector< double > &x) const |
double | GetRandomPoint (std::vector< double > &x) |
int | GetNIterationsMin () const |
int | GetNIterationsMax () const |
int | GetNIterationsPrecisionCheck () const |
int | GetNIterationsOutput () const |
int | GetNIterations () const |
double | GetRelativePrecision () const |
double | GetAbsolutePrecision () const |
BCCubaMethod | GetCubaIntegrationMethod () const |
const BCCubaOptions::Vegas & | GetCubaVegasOptions () const |
const BCCubaOptions::Suave & | GetCubaSuaveOptions () const |
const BCCubaOptions::Divonne & | GetCubaDivonneOptions () const |
const BCCubaOptions::Cuhre & | GetCubaCuhreOptions () const |
BCH1D * | GetSlice (const BCParameter *parameter, const std::vector< double > parameters=std::vector< double >(0), int bins=0, bool flag_norm=true) |
BCH1D * | GetSlice (const char *name, const std::vector< double > parameters=std::vector< double >(0), int nbins=0, bool flag_norm=true) |
BCH2D * | GetSlice (const BCParameter *parameter1, const BCParameter *parameter2, const std::vector< double > parameters=std::vector< double >(0), int bins=0, bool flag_norm=true) |
BCH2D * | GetSlice (const char *name1, const char *name2, const std::vector< double > parameters=std::vector< double >(0), int nbins=0, bool flag_norm=true) |
BCH2D * | GetSlice (unsigned index1, unsigned index2, const std::vector< double > parameters=std::vector< double >(0), int nbins=0, bool flag_norm=true) |
double | GetError () const |
TMinuit * | GetMinuit () |
int | GetMinuitErrorFlag () const |
double | GetSAT0 () const |
double | GetSATmin () const |
double | GetBestFitParameter (unsigned index) const |
double | GetBestFitParameterError (unsigned index) const |
double | GetLogMaximum () |
const std::vector< double > & | GetBestFitParameters () const |
const std::vector< double > & | GetBestFitParameterErrors () const |
void | SetMinuitArlist (double *arglist) |
void | SetFlagIgnorePrevOptimization (bool flag) |
void | SetOptimizationMethod (BCIntegrate::BCOptimizationMethod method) |
void | SetIntegrationMethod (BCIntegrate::BCIntegrationMethod method) |
void | SetMarginalizationMethod (BCIntegrate::BCMarginalizationMethod method) |
void | SetSASchedule (BCIntegrate::BCSASchedule schedule) |
void | SetNIterationsMin (int niterations) |
void | SetNIterationsMax (int niterations) |
void | SetNIterationsPrecisionCheck (int niterations) |
void | SetNIterationsOutput (int niterations) |
void | SetRelativePrecision (double relprecision) |
void | SetAbsolutePrecision (double absprecision) |
void | SetCubaIntegrationMethod (BCCubaMethod type) |
void | SetCubaOptions (const BCCubaOptions::Vegas &options) |
void | SetCubaOptions (const BCCubaOptions::Suave &options) |
void | SetCubaOptions (const BCCubaOptions::Divonne &options) |
void | SetCubaOptions (const BCCubaOptions::Cuhre &options) |
void | SetSAT0 (double T0) |
void | SetSATmin (double Tmin) |
void | SetFlagWriteSAToFile (bool flag) |
TTree * | GetSATree () |
void | InitializeSATree () |
double | Normalize () |
double | Integrate (BCIntegrationMethod intmethod) |
double | Integrate () |
double | Integrate (BCIntegrationMethod type, tRandomizer randomizer, tEvaluator evaluator, tIntegralUpdater updater, std::vector< double > &sums) |
double | EvaluatorMC (std::vector< double > &sums, const std::vector< double > &point, bool &accepted) |
int | MarginalizeAll () |
int | MarginalizeAll (BCMarginalizationMethod margmethod) |
virtual void | MarginalizePreprocess () |
virtual void | MarginalizePostprocess () |
void | SAInitialize () |
std::vector< double > | FindMode (std::vector< double > start=std::vector< double >()) |
std::vector< double > | FindMode (BCIntegrate::BCOptimizationMethod optmethod, std::vector< double > start=std::vector< double >()) |
double | SATemperature (double t) |
double | SATemperatureBoltzmann (double t) |
double | SATemperatureCauchy (double t) |
virtual double | SATemperatureCustom (double t) |
std::vector< double > | GetProposalPointSA (const std::vector< double > &x, int t) |
std::vector< double > | GetProposalPointSABoltzmann (const std::vector< double > &x, int t) |
std::vector< double > | GetProposalPointSACauchy (const std::vector< double > &x, int t) |
virtual std::vector< double > | GetProposalPointSACustom (const std::vector< double > &x, int t) |
std::vector< double > | SAHelperGetRandomPointOnHypersphere () |
double | SAHelperGetRadialCauchy () |
double | SAHelperSinusToNIntegral (int dim, double theta) |
virtual void | ResetResults () |
std::string | DumpIntegrationMethod (BCIntegrationMethod type) |
std::string | DumpCurrentIntegrationMethod () |
std::string | DumpUsedIntegrationMethod () |
std::string | DumpMarginalizationMethod (BCMarginalizationMethod type) |
std::string | DumpCurrentMarginalizationMethod () |
std::string | DumpUsedMarginalizationMethod () |
std::string | DumpOptimizationMethod (BCOptimizationMethod type) |
std::string | DumpCurrentOptimizationMethod () |
std::string | DumpUsedOptimizationMethod () |
std::string | DumpCubaIntegrationMethod (BCCubaMethod type) |
std::string | DumpCubaIntegrationMethod () |
void | SetBestFitParameters (const std::vector< double > &x) |
void | SetBestFitParameters (const std::vector< double > &x, const double &new_value, double &old_value) |
unsigned | GetNIntegrationVariables () |
double | CalculateIntegrationVolume () |
bool | CheckMarginalizationAvailability (BCMarginalizationMethod type) |
bool | CheckMarginalizationIndices (TH1 *hist, const std::vector< unsigned > &index) |
![]() | |
void | WriteMarkovChain (bool flag) |
BCEngineMCMC () | |
BCEngineMCMC (const BCEngineMCMC &enginemcmc) | |
virtual | ~BCEngineMCMC () |
BCEngineMCMC & | operator= (const BCEngineMCMC &engineMCMC) |
unsigned | MCMCGetNChains () const |
unsigned | MCMCGetNLag () const |
const std::vector< unsigned > & | MCMCGetNIterations () const |
unsigned | MCMCGetCurrentIteration () const |
unsigned | MCMCGetCurrentChain () const |
unsigned | MCMCGetNIterationsConvergenceGlobal () const |
bool | MCMCGetFlagConvergenceGlobal () const |
unsigned | MCMCGetNIterationsMax () const |
unsigned | MCMCGetNIterationsRun () const |
unsigned | MCMCGetNIterationsPreRunMin () const |
unsigned | MCMCGetNIterationsUpdate () const |
unsigned | MCMCGetNIterationsUpdateMax () const |
std::vector< int > | MCMCGetNTrialsTrue () const |
int | MCMCGetNTrials () const |
const std::vector< double > & | MCMCGetprobMean () const |
const std::vector< double > & | MCMCGetVariance () const |
const std::vector< double > & | MCMCGetTrialFunctionScaleFactor () const |
std::vector< double > | MCMCGetTrialFunctionScaleFactor (unsigned ichain) const |
double | MCMCGetTrialFunctionScaleFactor (unsigned ichain, unsigned ipar) |
const std::vector< double > & | MCMCGetx () const |
std::vector< double > | MCMCGetx (unsigned ichain) |
double | MCMCGetx (unsigned ichain, unsigned ipar) const |
const std::vector< double > & | MCMCGetLogProbx () const |
double | MCMCGetLogProbx (unsigned ichain) |
int | MCMCGetPhase () const |
const std::vector< double > & | MCMCGetMaximumPoints () const |
std::vector< double > | MCMCGetMaximumPoint (unsigned i) const |
const std::vector< double > & | MCMCGetMaximumLogProb () const |
int | MCMCGetFlagInitialPosition () const |
double | MCMCGetRValueCriterion () const |
double | MCMCGetRValueParametersCriterion () const |
double | MCMCGetRValue () const |
double | MCMCGetRValueParameters (unsigned i) |
bool | MCMCGetRValueStrict () const |
bool | MCMCGetFlagRun () const |
TTree * | MCMCGetMarkovChainTree (unsigned i) |
BCH1D * | MCMCGetH1Marginalized (unsigned i) |
BCH2D * | MCMCGetH2Marginalized (unsigned i, unsigned j) |
BCParameter * | GetParameter (int index) const |
BCParameter * | GetParameter (const char *name) const |
unsigned int | GetNParameters () const |
unsigned int | GetNFixedParameters () |
unsigned int | GetNFreeParameters () |
const std::vector< double > & | GetBestFitParametersMarginalized () const |
void | MCMCSetTrialFunctionScaleFactor (std::vector< double > scale) |
void | MCMCSetNChains (unsigned n) |
void | MCMCSetNLag (unsigned n) |
void | MCMCSetNIterationsMax (unsigned n) |
void | MCMCSetNIterationsRun (unsigned n) |
void | MCMCSetNIterationsPreRunMin (unsigned n) |
void | MCMCSetNIterationsUpdate (unsigned n) |
void | MCMCSetNIterationsUpdateMax (unsigned n) |
void | MCMCSetMinimumEfficiency (double efficiency) |
void | MCMCSetMaximumEfficiency (double efficiency) |
void | MCMCSetRandomSeed (unsigned seed) |
void | MCMCSetWriteChainToFile (bool flag) |
void | MCMCSetWritePreRunToFile (bool flag) |
void | MCMCSetInitialPositions (const std::vector< double > &x0s) |
void | MCMCSetInitialPositions (std::vector< std::vector< double > > x0s) |
void | MCMCSetFlagInitialPosition (int flag) |
void | MCMCSetFlagOrderParameters (bool flag) |
void | MCMCSetFlagFillHistograms (bool flag) |
void | MCMCSetFlagPreRun (bool flag) |
void | MCMCSetRValueCriterion (double r) |
void | MCMCSetRValueParametersCriterion (double r) |
void | MCMCSetRValueStrict (bool strict=true) |
void | MCMCSetMarkovChainTrees (const std::vector< TTree * > &trees) |
void | MCMCInitializeMarkovChainTrees () |
int | SetMarginalized (unsigned index, TH1D *h) |
int | SetMarginalized (unsigned index1, unsigned index2, TH2D *h) |
void | MCMCSetValuesDefault () |
void | MCMCSetValuesQuick () |
void | MCMCSetValuesDetail () |
void | MCMCSetPrecision (BCEngineMCMC::Precision precision) |
void | SetNbins (unsigned int nbins) |
void | Copy (const BCEngineMCMC &enginemcmc) |
virtual int | AddParameter (const char *name, double min, double max, const char *latexname="") |
virtual void | MCMCTrialFunction (unsigned ichain, std::vector< double > &x) |
virtual double | MCMCTrialFunctionSingle (unsigned ichain, unsigned ipar) |
bool | MCMCGetProposalPointMetropolis (unsigned chain, std::vector< double > &x) |
bool | MCMCGetProposalPointMetropolis (unsigned chain, unsigned parameter, std::vector< double > &x) |
bool | MCMCGetNewPointMetropolis (unsigned chain=0) |
bool | MCMCGetNewPointMetropolis (unsigned chain, unsigned parameter) |
void | MCMCInChainCheckMaximum () |
void | MCMCInChainUpdateStatistics () |
void | MCMCInChainFillHistograms () |
void | MCMCInChainTestConvergenceAllChains () |
void | MCMCInChainWriteChains () |
int | MCMCMetropolis () |
int | MCMCMetropolisPreRun () |
void | MCMCResetRunStatistics () |
void | MCMCInitializeMarkovChains () |
int | MCMCInitialize () |
void | ClearParameters (bool hard=false) |
virtual void | MCMCIterationInterface () |
virtual void | MCMCCurrentPointInterface (std::vector< double > &, int, bool) |
Private Attributes | |
std::vector< int > | fMapDataPoint |
std::vector< int > | fMapDataValue |
int | fPValueBelow |
int | fPValueAbove |
BCModel * | fTestModel |
BCDataSet * | fTemporaryDataSet |
double | fLogLikelihood |
double | fLogLikelihoodMin |
double | fLogLikelihoodMax |
TH1D * | fHistogramLogProb |
Additional Inherited Members | |
![]() | |
enum | BCOptimizationMethod { kOptEmpty, kOptSimAnn, kOptMetropolis, kOptMinuit, kOptDefault, NOptMethods } |
enum | BCIntegrationMethod { kIntEmpty, kIntMonteCarlo, kIntCuba, kIntGrid, kIntDefault, NIntMethods } |
enum | BCMarginalizationMethod { kMargEmpty, kMargMetropolis, kMargMonteCarlo, kMargGrid, kMargDefault, NMargMethods } |
enum | BCSASchedule { kSACauchy, kSABoltzmann, kSACustom, NSAMethods } |
enum | BCCubaMethod { kCubaVegas, kCubaSuave, kCubaDivonne, kCubaCuhre, NCubaMethods } |
typedef void(BCIntegrate::* | tRandomizer )(std::vector< double > &) const |
typedef double(BCIntegrate::* | tEvaluator )(std::vector< double > &, const std::vector< double > &, bool &) |
typedef void(* | tIntegralUpdater )(const std::vector< double > &, const int &, double &, double &) |
![]() | |
static void | IntegralUpdaterMC (const std::vector< double > &sums, const int &nIterations, double &integral, double &absprecision) |
static int | CubaIntegrand (const int *ndim, const double xx[], const int *ncomp, double ff[], void *userdata) |
static void | FCNLikelihood (int &npar, double *grad, double &fval, double *par, int flag) |
![]() | |
unsigned | IntegrationOutputFrequency () const |
void | LogOutputAtStartOfIntegration (BCIntegrationMethod type, BCCubaMethod cubatype) |
void | LogOutputAtIntegrationStatusUpdate (BCIntegrationMethod type, double integral, double absprecision, int nIterations) |
void | LogOutputAtEndOfIntegration (double integral, double absprecision, double relprecision, int nIterations) |
void | Copy (const BCIntegrate &bcintegrate) |
![]() | |
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 |
The class for testing model hypotheses.
Definition at line 34 of file BCGoFTest.h.
BCGoFTest::BCGoFTest | ( | const char * | name) |
BCGoFTest::~BCGoFTest | ( | ) |
Default destructor.
Definition at line 52 of file BCGoFTest.cxx.
double BCGoFTest::GetCalculatedPValue | ( | bool | flag_histogram = false ) |
Calculated the p-value.
flag_histogram | A histogram is either filled or not. |
Definition at line 227 of file BCGoFTest.cxx.
|
inline |
|
inline |
|
inlinevirtual |
Returns natural logarithm of the prior probability. Method needs to be overloaded by the user.
parameters | A set of parameter values |
Reimplemented from BCModel.
Definition at line 92 of file BCGoFTest.h.
|
virtual |
Calculates natural logarithm of the likelihood. Method needs to be overloaded by the user.
params | A set of parameter values |
Implements BCModel.
Definition at line 77 of file BCGoFTest.cxx.
|
virtual |
Method executed for every iteration of the MCMC. User's code should be provided via overloading in the derived class
Reimplemented from BCEngineMCMC.
Definition at line 92 of file BCGoFTest.cxx.
|
inline |
Set the model to be tested.
testmodel | pointer to the model to be tested |
Definition at line 77 of file BCGoFTest.h.
int BCGoFTest::SetTestPoint | ( | std::vector< double > | parameters) |
Sets the set of parameters which the p-values is calculated for.
parameters | parameters |
Definition at line 123 of file BCGoFTest.cxx.
|
private |
The distribution of log(likelihood).
Definition at line 127 of file BCGoFTest.h.
|
private |
The log(likelihood) and its range.
Definition at line 121 of file BCGoFTest.h.
|
private |
Definition at line 123 of file BCGoFTest.h.
|
private |
Definition at line 122 of file BCGoFTest.h.
|
private |
A map of data points and data values.
Definition at line 103 of file BCGoFTest.h.
|
private |
Definition at line 104 of file BCGoFTest.h.
|
private |
Definition at line 109 of file BCGoFTest.h.
|
private |
Counter for the evaluation of the p-value.
Definition at line 108 of file BCGoFTest.h.
|
private |
A data set used for temporary storage.
Definition at line 117 of file BCGoFTest.h.
|
private |
A pointer to the model which is tested.
Definition at line 113 of file BCGoFTest.h.