BCModelManager Class Reference

#include <BCModelManager.h>

Collaboration diagram for BCModelManager:

Collaboration graph
[legend]

List of all members.


Detailed Description

A class representing a set of BCModels.

Author:
Daniel Kollar

Kevin Kröninger

Version:
1.0
Date:
08.2008 This class represents a manager for BCModels. It handles common data sets and performs operations on BCModels simultaneously. Model comparsion in terms of a posteriori probabilities is only possible with this class.

Definition at line 30 of file BCModelManager.h.


Public Member Functions

Member functions (miscellaneous methods)


void AddDataPoint (BCDataPoint *datapoint)
void AddModel (BCModel *model, double probability=0.)
void CalculatePValue (bool flag_histogram=false)
void FindMode ()
void MarginalizeAll ()
void Normalize ()
void PrintResults ()
void PrintSummary (const char *filename=0)
int ReadDataFromFileTree (const char *filename, const char *treename, const char *branchnames)
int ReadDataFromFileTxt (const char *filename, int nbranches)
int ReadDataFromFileUser (const char *filename, std::vector< int > options_int, std::vector< double > options_double)
void ResetDataSet ()
void WriteMarkovChain (bool flag)
Constructors and destructors


 BCModelManager (const BCModelManager &modelmanager)
 BCModelManager ()
virtual ~BCModelManager ()
Member functions (set)


void FixDataAxis (int index, bool fixed)
void SetDataBoundaries (int index, double lowerboundary, double upperboundary)
void SetDataPointLowerBoundaries (BCDataPoint *datasetlowerboundaries)
void SetDataPointLowerBoundary (int index, double lowerboundary)
void SetDataPointUpperBoundaries (BCDataPoint *datasetupperboundaries)
void SetDataPointUpperBoundary (int index, double upperboundary)
void SetDataSet (BCDataSet *dataset)
void SetFitFunctionIndexX (int index)
void SetFitFunctionIndexY (int index)
void SetFitFunctionIndices (int indexx, int indexy)
void SetFlagPCA (bool flag)
void SetIntegrationMethod (BCIntegrate::BCIntegrationMethod method)
void SetMarginalizationMethod (BCIntegrate::BCMarginalizationMethod method)
void SetNbins (int n)
void SetNChains (int n)
void SetNiterationsPerDimension (int niterations)
void SetNSamplesPer2DBin (int n)
void SetOptimizationMethod (BCIntegrate::BCOptimizationMethod method)
void SetRelativePrecision (double relprecision)
void SetSingleDataPoint (BCDataSet *dataset, int index)
void SetSingleDataPoint (BCDataPoint *datapoint)
Member functions (get)


BCDataPointGetDataPoint (int index)
BCDataSetGetDataSet ()
BCModelGetModel (int index)
int GetNDataPoints ()
int GetNModels ()
Assignment operators


BCModelManageroperator= (const BCModelManager &modelmanager)

Private Member Functions

void Copy (BCModelManager &modelmanager) const

Private Attributes

BCDataSetfDataSet
BCModelContainerfModelContainer

Constructor & Destructor Documentation

BCModelManager::BCModelManager (  ) 

The default constructor.

Definition at line 18 of file BCModelManager.cxx.

BCModelManager::BCModelManager ( const BCModelManager modelmanager  ) 

The default copy constructor.

Definition at line 41 of file BCModelManager.cxx.

BCModelManager::~BCModelManager (  )  [virtual]

The default destructor.

Definition at line 29 of file BCModelManager.cxx.


Member Function Documentation

void BCModelManager::AddDataPoint ( BCDataPoint datapoint  )  [inline]

Adds a data point to the data container.

Parameters:
datapoint The data point

Definition at line 257 of file BCModelManager.h.

void BCModelManager::AddModel ( BCModel model,
double  probability = 0. 
)

Adds a model to the container

Parameters:
model The model
probability The a priori probability
See also:
AddModel(BCModel * model)

SetModelPrior(BCModel * model, double probability)

Definition at line 109 of file BCModelManager.cxx.

void BCModelManager::CalculatePValue ( bool  flag_histogram = false  ) 

Definition at line 550 of file BCModelManager.cxx.

void BCModelManager::Copy ( BCModelManager modelmanager  )  const [private]

Definition at line 650 of file BCModelManager.cxx.

void BCModelManager::FindMode (  ) 

Does the mode finding

Definition at line 515 of file BCModelManager.cxx.

void BCModelManager::FixDataAxis ( int  index,
bool  fixed 
)

Definition at line 330 of file BCModelManager.cxx.

BCDataPoint* BCModelManager::GetDataPoint ( int  index  )  [inline]

Returns a data point of the common data set at an index.

Parameters:
index The index of the data point in the data set.
Returns:
The data point.

Definition at line 94 of file BCModelManager.h.

BCDataSet* BCModelManager::GetDataSet (  )  [inline]

Returns the common data set.

Returns:
The data set.

Definition at line 101 of file BCModelManager.h.

BCModel* BCModelManager::GetModel ( int  index  )  [inline]

Returns the BCModel at a certain index of this BCModelManager.

Parameters:
index The index of the model in the BCModelManager.
Returns:
The BCModel at the index.

Definition at line 79 of file BCModelManager.h.

int BCModelManager::GetNDataPoints (  )  [inline]

Returns the number of entries in the common data set.

Returns:
The number of entries.

Definition at line 86 of file BCModelManager.h.

int BCModelManager::GetNModels (  )  [inline]

Returns:
The number of models.

Definition at line 71 of file BCModelManager.h.

void BCModelManager::MarginalizeAll (  ) 

Marginalize all probabilities wrt. single parameters and all combinations of two parameters for all models.

Definition at line 527 of file BCModelManager.cxx.

void BCModelManager::Normalize (  ) 

Calculates the normalization of the likelihood for each model in the container.

Definition at line 487 of file BCModelManager.cxx.

BCModelManager & BCModelManager::operator= ( const BCModelManager modelmanager  ) 

The defaut assignment operator

Definition at line 50 of file BCModelManager.cxx.

void BCModelManager::PrintResults (  ) 

Definition at line 639 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

Parameters:
filename name of the file to write into.

Definition at line 561 of file BCModelManager.cxx.

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.

Parameters:
filename The filename of the ROOT file
treename The name of the ROOT tree
branchnames A vector of the names of the branches
See also:
ReadDataFromFileHist(char * filename, char * histname, const char* branchnames);

ReadDataFromFileTxt(char * filename, int nbranches);

Definition at line 365 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.

Parameters:
filename The filename of the ROOT file
nbranches The number of variables
See also:
ReadDataFromFileTree(char * filename, char * treename, std::vector<char*> branchnames)

ReadDataFromFileHist(char * filename, char * histname, const char * branchnames);

Definition at line 447 of file BCModelManager.cxx.

int BCModelManager::ReadDataFromFileUser ( const char *  filename,
std::vector< int >  options_int,
std::vector< double >  options_double 
)

Reads data from a file (user specifies). Opens a file and creates data set containing the values read from the file (user specifies).

Parameters:
filename The filename of the ROOT file
options_int Arbitrary integer options.
options_double Arbitrary double options.
See also:
ReadDataFromFileTree(char * filename, char * treename, std::vector<char*> branchnames)

ReadDataFromFileHist(char * filename, char * histname, const char * branchnames);

ReadDataFromFileTxt(char * filename, int nbranches);

Definition at line 407 of file BCModelManager.cxx.

void BCModelManager::ResetDataSet (  )  [inline]

Resets the data set

Definition at line 321 of file BCModelManager.h.

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 318 of file BCModelManager.cxx.

void BCModelManager::SetDataPointLowerBoundaries ( BCDataPoint datasetlowerboundaries  ) 

Sets the data point containing the lower boundaries of possible data values

Definition at line 270 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 294 of file BCModelManager.cxx.

void BCModelManager::SetDataPointUpperBoundaries ( BCDataPoint datasetupperboundaries  ) 

Sets the data point containing the upper boundaries of possible data values

Definition at line 282 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 306 of file BCModelManager.cxx.

void BCModelManager::SetDataSet ( BCDataSet dataset  ) 

Sets the data set common to all BCModels in this BCModelManager.

Parameters:
dataset A data set

Definition at line 62 of file BCModelManager.cxx.

void BCModelManager::SetFitFunctionIndexX ( int  index  ) 

Sets index of the x values in function fits.

Parameters:
index Index of the x values

Definition at line 234 of file BCModelManager.cxx.

void BCModelManager::SetFitFunctionIndexY ( int  index  ) 

Sets index of the y values in function fits.

Parameters:
index Index of the y values

Definition at line 246 of file BCModelManager.cxx.

void BCModelManager::SetFitFunctionIndices ( int  indexx,
int  indexy 
)

Definition at line 258 of file BCModelManager.cxx.

void BCModelManager::SetFlagPCA ( bool  flag  ) 

Definition at line 353 of file BCModelManager.cxx.

void BCModelManager::SetIntegrationMethod ( BCIntegrate::BCIntegrationMethod  method  ) 

Parameters:
method The integration method

Definition at line 150 of file BCModelManager.cxx.

void BCModelManager::SetMarginalizationMethod ( BCIntegrate::BCMarginalizationMethod  method  ) 

Sets the maximum number of iterations for the Monte Carlo integration for all BCModels in this BCModelManager.

Parameters:
niterations 
method The marginalization method

Definition at line 162 of file BCModelManager.cxx.

void BCModelManager::SetNbins ( int  n  ) 

Parameters:
n Number of bins per dimension for the marginalized distributions. Default is 100. Minimum number allowed is 2.

Definition at line 222 of file BCModelManager.cxx.

void BCModelManager::SetNChains ( int  n  ) 

Definition at line 341 of file BCModelManager.cxx.

void BCModelManager::SetNiterationsPerDimension ( int  niterations  ) 

Parameters:
niterations Number of iterations per dimension for Monte Carlo integration.

Definition at line 186 of file BCModelManager.cxx.

void BCModelManager::SetNSamplesPer2DBin ( int  n  ) 

Parameters:
n Number of samples per 2D bin per variable in the Metropolis marginalization. Default is 100.

Definition at line 198 of file BCModelManager.cxx.

void BCModelManager::SetOptimizationMethod ( BCIntegrate::BCOptimizationMethod  method  ) 

Parameters:
method The mode finding method

Definition at line 174 of file BCModelManager.cxx.

void BCModelManager::SetRelativePrecision ( double  relprecision  ) 

Parameters:
relprecision The relative precision envisioned for Monte Carlo integration

Definition at line 210 of file BCModelManager.cxx.

void BCModelManager::SetSingleDataPoint ( BCDataSet dataset,
int  index 
)

Sets a single data point as a common data set.

Parameters:
dataset A data set.
index The index of the data point in the data set specified.
See also:
SetSingleDataPoint(BCDataPoint * datapoint)

SetDataSet(BCDataSet * dataset)

Definition at line 97 of file BCModelManager.cxx.

void BCModelManager::SetSingleDataPoint ( BCDataPoint datapoint  ) 

Sets a single data point as a common data set.

Parameters:
datapoint A data point
See also:
SetSingleDataPoint(BCDataSet * dataset, int index)

SetDataSet(BCDataSet * dataset)

Definition at line 78 of file BCModelManager.cxx.

void BCModelManager::WriteMarkovChain ( bool  flag  ) 

Definition at line 539 of file BCModelManager.cxx.


Member Data Documentation

The data set common to all models.

Definition at line 358 of file BCModelManager.h.

The BCModelContainer containing all BCModels.

Definition at line 353 of file BCModelManager.h.


Generated on Mon Sep 15 17:04:30 2008 for Bayesian Analysis Toolkit by  doxygen 1.5.6