BAT
0.9.4
The Bayesian analysis toolkit
|
A class representing a set of BCModels. More...
#include <BCModelManager.h>
Public Member Functions | |
Constructors and destructors | |
BCModelManager () | |
BCModelManager (const BCModelManager &modelmanager) | |
virtual | ~BCModelManager () |
Assignment operators | |
BCModelManager & | operator= (const BCModelManager &modelmanager) |
Member functions (get) | |
unsigned int | GetNModels () |
BCModel * | GetModel (int index) |
int | GetNDataPoints () |
BCDataPoint * | GetDataPoint (int index) |
BCDataSet * | GetDataSet () |
Member functions (set) | |
void | SetDataSet (BCDataSet *dataset) |
void | SetSingleDataPoint (BCDataPoint *datapoint) |
void | SetSingleDataPoint (BCDataSet *dataset, unsigned int index) |
void | SetNIterationsMax (int niterations) |
void | SetNIterationsMin (int niterations) |
void | SetNIterationsPrecisionCheck (int niterations) |
void | SetNIterationsOutput (int niterations) |
void | SetMarginalizationMethod (BCIntegrate::BCMarginalizationMethod method) |
void | SetIntegrationMethod (BCIntegrate::BCIntegrationMethod method) |
void | SetOptimizationMethod (BCIntegrate::BCOptimizationMethod method) |
void | SetRelativePrecision (double relprecision) |
void | SetAbsolutePrecision (double absprecision) |
void | SetNbins (unsigned int n) |
void | SetDataPointLowerBoundaries (BCDataPoint *datasetlowerboundaries) |
void | SetDataPointUpperBoundaries (BCDataPoint *datasetupperboundaries) |
void | SetDataPointLowerBoundary (int index, double lowerboundary) |
void | SetDataPointUpperBoundary (int index, double upperboundary) |
void | SetDataBoundaries (int index, double lowerboundary, double upperboundary) |
void | SetNChains (unsigned int n) |
Member functions (miscellaneous methods) | |
void | AddModel (BCModel *model, double probability=0.) |
void | AddDataPoint (BCDataPoint *datapoint) |
int | ReadDataFromFile (const char *filename, const char *treename, const char *branchnames) |
int | ReadDataFromFile (const char *filename, int nvariables) |
int | ReadDataFromFileTree (const char *filename, const char *treename, const char *branchnames) |
int | ReadDataFromFileTxt (const char *filename, int nbranches) |
void | Integrate () |
double | BayesFactor (const unsigned int imodel1, const unsigned int imodel2) |
void | FindMode () |
void | MarginalizeAll () |
void | WriteMarkovChain (bool flag) |
void | ResetDataSet () |
void | PrintModelComparisonSummary (const char *filename=0) |
void | PrintSummary (const char *filename=0) |
void | PrintResults () |
void | CalculatePValue (bool flag_histogram=false) |
A class representing a set of BCModels.
Definition at line 32 of file BCModelManager.h.
BCModelManager::BCModelManager | ( | ) |
The default constructor.
Definition at line 23 of file BCModelManager.cxx.
BCModelManager::BCModelManager | ( | const BCModelManager & | modelmanager | ) |
The default copy constructor.
Definition at line 39 of file BCModelManager.cxx.
|
virtual |
The default destructor.
Definition at line 31 of file BCModelManager.cxx.
|
inline |
Adds a data point to the data container.
datapoint | The data point |
Definition at line 208 of file BCModelManager.h.
void BCModelManager::AddModel | ( | BCModel * | model, |
double | probability = 0. |
||
) |
Adds a model to the container
model | The model |
probability | The a priori probability |
Definition at line 92 of file BCModelManager.cxx.
double BCModelManager::BayesFactor | ( | const unsigned int | imodel1, |
const unsigned int | imodel2 | ||
) |
Calculate Bayes factor for two models.
imodel1 | index of model 1 (numerator) |
imodel2 | index of model 2 (denominator) |
Definition at line 329 of file BCModelManager.cxx.
void BCModelManager::CalculatePValue | ( | bool | flag_histogram = false | ) |
Calculates the p-value for all models.
Definition at line 404 of file BCModelManager.cxx.
void BCModelManager::FindMode | ( | ) |
Does the mode finding
Definition at line 377 of file BCModelManager.cxx.
|
inline |
Returns a data point of the common data set at an index.
index | The index of the data point in the data set. |
Definition at line 87 of file BCModelManager.h.
|
inline |
|
inline |
Returns the BCModel at a certain index of this BCModelManager.
index | The index of the model in the BCModelManager. |
Definition at line 74 of file BCModelManager.h.
|
inline |
Returns the number of entries in the common data set.
Definition at line 80 of file BCModelManager.h.
|
inline |
Definition at line 67 of file BCModelManager.h.
void BCModelManager::Integrate | ( | ) |
Calculates the normalization of the likelihood for each model in the container.
Definition at line 306 of file BCModelManager.cxx.
void BCModelManager::MarginalizeAll | ( | ) |
Marginalize all probabilities wrt. single parameters and all combinations of two parameters for all models.
Definition at line 386 of file BCModelManager.cxx.
BCModelManager & BCModelManager::operator= | ( | const BCModelManager & | modelmanager | ) |
The defaut assignment operator
Definition at line 46 of file BCModelManager.cxx.
void BCModelManager::PrintModelComparisonSummary | ( | const char * | filename = 0 | ) |
Prints a summary of model comparison into a file. If filename is omitted the summary will be printed onto the screen
filename | name of the file to write into. |
Definition at line 477 of file BCModelManager.cxx.
void BCModelManager::PrintResults | ( | ) |
Prints summaries of all files
Definition at line 553 of file BCModelManager.cxx.
void BCModelManager::PrintSummary | ( | const char * | filename = 0 | ) |
Prints a summary into a file. If filename is omitted the summary will be printed onto the screen. This method is obsolete. Use PrintResults() instead.
filename | name of the file to write into. |
Definition at line 413 of file BCModelManager.cxx.
|
inline |
Reads data from a file. For a description see the following member functions.
Definition at line 214 of file BCModelManager.h.
int BCModelManager::ReadDataFromFileTree | ( | const char * | filename, |
const char * | treename, | ||
const char * | branchnames | ||
) |
Reads tree data from a ROOT file. Opens a ROOT file and gets a ROOT tree. It creates data set containing the values read from the file.
filename | The filename of the ROOT file |
treename | The name of the ROOT tree |
branchnames | A vector of the names of the branches |
Definition at line 242 of file BCModelManager.cxx.
int BCModelManager::ReadDataFromFileTxt | ( | const char * | filename, |
int | nbranches | ||
) |
Reads data from a txt file. Opens a txt file and creates data set containing the values read from the file.
filename | The filename of the ROOT file |
nbranches | The number of variables |
Definition at line 274 of file BCModelManager.cxx.
|
inline |
Resets the data set
Definition at line 268 of file BCModelManager.h.
void BCModelManager::SetAbsolutePrecision | ( | double | absprecision | ) |
Set absolute precision of the numerical integation
Definition at line 171 of file BCModelManager.cxx.
void BCModelManager::SetDataBoundaries | ( | int | index, |
double | lowerboundary, | ||
double | upperboundary | ||
) |
Set the lower and upper boundaries for possible data values for a particular variable
Definition at line 225 of file BCModelManager.cxx.
void BCModelManager::SetDataPointLowerBoundaries | ( | BCDataPoint * | datasetlowerboundaries | ) |
Sets the data point containing the lower boundaries of possible data values
Definition at line 189 of file BCModelManager.cxx.
void BCModelManager::SetDataPointLowerBoundary | ( | int | index, |
double | lowerboundary | ||
) |
Sets the lower boundary of possible data values for a particular variable
Definition at line 207 of file BCModelManager.cxx.
void BCModelManager::SetDataPointUpperBoundaries | ( | BCDataPoint * | datasetupperboundaries | ) |
Sets the data point containing the upper boundaries of possible data values
Definition at line 198 of file BCModelManager.cxx.
void BCModelManager::SetDataPointUpperBoundary | ( | int | index, |
double | upperboundary | ||
) |
Sets the upper boundary of possible data values for a particular variable
Definition at line 216 of file BCModelManager.cxx.
void BCModelManager::SetDataSet | ( | BCDataSet * | dataset | ) |
Sets the data set common to all BCModels in this BCModelManager.
dataset | A data set |
Definition at line 56 of file BCModelManager.cxx.
void BCModelManager::SetIntegrationMethod | ( | BCIntegrate::BCIntegrationMethod | method | ) |
method | The integration method |
Definition at line 134 of file BCModelManager.cxx.
void BCModelManager::SetMarginalizationMethod | ( | BCIntegrate::BCMarginalizationMethod | method | ) |
method | The marginalization method |
Definition at line 144 of file BCModelManager.cxx.
void BCModelManager::SetNbins | ( | unsigned int | n | ) |
n | Number of bins per dimension for the marginalized distributions. Default is 100. Minimum number allowed is 2. |
Definition at line 180 of file BCModelManager.cxx.
void BCModelManager::SetNChains | ( | unsigned int | n | ) |
Sets the number of Markov chains
Definition at line 233 of file BCModelManager.cxx.
void BCModelManager::SetNIterationsMin | ( | int | niterations | ) |
Sets the minimum number of iterations for the Monte Carlo integration for all BCModels in this BCModelManager.
niterations |
Definition at line 112 of file BCModelManager.cxx.
void BCModelManager::SetNIterationsOutput | ( | int | niterations | ) |
niterations | interval for outputting during integration. If negative, frequency is autogenerated. |
Definition at line 126 of file BCModelManager.cxx.
void BCModelManager::SetNIterationsPrecisionCheck | ( | int | niterations | ) |
niterations | interval for checking precision in integration routines |
Definition at line 119 of file BCModelManager.cxx.
void BCModelManager::SetOptimizationMethod | ( | BCIntegrate::BCOptimizationMethod | method | ) |
method | The mode finding method |
Definition at line 153 of file BCModelManager.cxx.
void BCModelManager::SetRelativePrecision | ( | double | relprecision | ) |
relprecision | The relative precision envisioned for Monte Carlo integration |
Definition at line 162 of file BCModelManager.cxx.
void BCModelManager::SetSingleDataPoint | ( | BCDataPoint * | datapoint | ) |
Sets a single data point as a common data set.
datapoint | A data point |
Definition at line 68 of file BCModelManager.cxx.
void BCModelManager::SetSingleDataPoint | ( | BCDataSet * | dataset, |
unsigned int | index | ||
) |
Sets a single data point as a common data set.
dataset | A data set. |
index | The index of the data point in the data set specified. |
Definition at line 82 of file BCModelManager.cxx.
void BCModelManager::WriteMarkovChain | ( | bool | flag | ) |
Flag for writing Markov chain to file
Definition at line 395 of file BCModelManager.cxx.