BCModelManager.cxx
173 fAPosterioriProbability[i] = (fModels[i]->GetIntegral() * fAPrioriProbability[i]) / normalization;
190 BCLOG_ERROR(Form(" Model %s (index %d) not normalized. Cannot calculate Bayes factor.", fModels[imodel1]->GetName().data(), imodel1));
197 BCLOG_ERROR(Form(" Model %s (index %d) not normalized. Cannot calculate Bayes factor.", fModels[imodel2]->GetName().data(), imodel2));
202 if (norm2 < std::numeric_limits<double>::min() && norm1 >= std::numeric_limits<double>::min()) {
203 BCLOG_ERROR(Form(" Model %s (index %d) has ZERO probability. Bayes factor is infinite.", fModels[imodel2]->GetName().data(), imodel2));
209 BCLOG_WARNING(Form("Models %s and %s have ZERO probability. Bayes factor is unknown. Returning 1.", fModels[imodel2]->GetName().data(), fModels[imodel1]->GetName().data()));
254 void BCModelManager::WriteMarkovChain(const std::string& prefix, const std::string& option, bool flag_run, bool flag_prerun)
257 GetModel(i)->WriteMarkovChain(prefix + GetModel(i)->GetSafeName() + ".root", option, flag_run, flag_prerun);
293 BCLog::OutSummary(Form(" (%u) p(%s) = %f", i, fModels[i]->GetName().data(), fAPrioriProbability[i]));
297 BCLog::OutSummary(Form(" (%u) p(%s | data) = %f", i, fModels[i]->GetName().data(), fAPosterioriProbability[i]));
303 BCLog::OutSummary(Form(" K := p(data | %s) / p(data | %s) = %f", fModels[i]->GetName().data(), fModels[j]->GetName().data(),
void WriteMarkovChainRun(bool flag)
Turn on/off writing of Markov chain to root file during run for all models.
Definition: BCModelManager.cxx:240
void SetAbsolutePrecision(double absprecision)
Set absolute precision of the numerical integation.
Definition: BCModelManager.cxx:136
void SetRelativePrecision(double relprecision)
Definition: BCModelManager.cxx:129
void SetOptimizationMethod(BCIntegrate::BCOptimizationMethod method)
Definition: BCModelManager.cxx:122
void SetMarginalizationMethod(BCIntegrate::BCMarginalizationMethod method)
Definition: BCIntegrate.h:465
void AddModel(BCModel *model, double prior_probability=0.)
Adds a model to the container.
Definition: BCModelManager.cxx:66
void SetNIterationsPrecisionCheck(int niterations)
Definition: BCIntegrate.h:485
void SetIntegrationMethod(BCIntegrate::BCIntegrationMethod method)
Definition: BCModelManager.cxx:108
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 WriteMarkovChain(bool flag)
Turn on/off writing of Markov chain to root file.
Definition: BCEngineMCMC.h:1016
BCModel * GetModel(unsigned index)
Returns the BCModel at a certain index of this BCModelManager.
Definition: BCModelManager.h:79
void SetAbsolutePrecision(double absprecision)
Set absolute precision of the numerical integation.
Definition: BCIntegrate.h:496
void SetPrecision(BCEngineMCMC::Precision precision)
Set the precision for the MCMC run.
Definition: BCEngineMCMC.cxx:353
void SetIntegrationMethod(BCIntegrate::BCIntegrationMethod method)
Definition: BCIntegrate.cxx:1488
void SetNbins(unsigned int nbins)
Set the number of bins for the marginalized distribution of all parameters.
Definition: BCEngineMCMC.h:994
void SetMarginalizationMethod(BCIntegrate::BCMarginalizationMethod method)
Definition: BCModelManager.cxx:115
void SetNChains(unsigned n)
Sets the number of Markov chains which are run in parallel.
Definition: BCEngineMCMC.h:775
void SetPrecision(BCEngineMCMC::Precision precision)
Set the precision for the MCMC run.
Definition: BCModelManager.cxx:80
void Integrate()
Calculates the normalization of the likelihood for each model in the container.
Definition: BCModelManager.cxx:157
void SetNIterationsPrecisionCheck(int niterations)
Definition: BCModelManager.cxx:101
void WriteMarkovChainRun(bool flag)
Turn on/off writing of Markov chain to root file during run.
Definition: BCEngineMCMC.cxx:430
BCModelManager & operator=(BCModelManager modelmanager)
The defaut assignment operator.
Definition: BCModelManager.cxx:39
void SetRelativePrecision(double relprecision)
Definition: BCIntegrate.h:491
void SetNIterationsMax(int niterations)
Sets the maximum number of iterations for the Monte Carlo integration for all BCModels in this BCMode...
Definition: BCModelManager.cxx:87
void PrintModelComparisonSummary() const
Prints a summary of the model comparison to the log.
Definition: BCModelManager.cxx:285
void WriteMarkovChainPreRun(bool flag)
Turn on/off writing of Markov chain to root file during prerun.
Definition: BCEngineMCMC.cxx:438
void WriteMarkovChainPreRun(bool flag)
Turn on/off writing of Markov chain to root file during prerun for all models.
Definition: BCModelManager.cxx:247
void SetDataSet(BCDataSet *dataset)
Sets the data set common to all BCModels in this BCModelManager.
Definition: BCModelManager.cxx:55
void WriteMarkovChain(bool flag)
Turn on/off writing of Markov chains to root files for all models.
Definition: BCModelManager.cxx:233
void SetNIterationsMin(int niterations)
Sets the minimum number of iterations for the Monte Carlo integration for all BCModels in this BCMode...
Definition: BCModelManager.cxx:94
double BayesFactor(const unsigned int imodel1, const unsigned int imodel2) const
Calculate Bayes factor for two models.
Definition: BCModelManager.cxx:177
void SetOptimizationMethod(BCIntegrate::BCOptimizationMethod method)
Definition: BCIntegrate.h:456