A helper class for the BCSummaryTool. More...
#include <BCSummaryPriorModel.h>


Public Member Functions | |
| BCSummaryPriorModel () | |
| BCSummaryPriorModel (const char *name) | |
| double | LogAPrioriProbability (std::vector< double > parameters) |
| double | LogLikelihood (std::vector< double > parameters) |
| int | PerformAnalysis () |
| void | SetTestModel (BCModel *model) |
| ~BCSummaryPriorModel () | |
Private Attributes | |
| BCModel * | fTestModel |
A helper class for the BCSummaryTool.
A helper class for the BCSummaryTool.
Definition at line 28 of file BCSummaryPriorModel.h.
| BCSummaryPriorModel::BCSummaryPriorModel | ( | ) |
The default constructor.
Definition at line 18 of file BCSummaryPriorModel.cxx.
: BCModel() , fTestModel(0) { }
| BCSummaryPriorModel::BCSummaryPriorModel | ( | const char * | name | ) |
A constructor.
| name | The name of the model. |
Definition at line 25 of file BCSummaryPriorModel.cxx.
: BCModel(name) , fTestModel(0) { }
| BCSummaryPriorModel::~BCSummaryPriorModel | ( | ) |
| double BCSummaryPriorModel::LogAPrioriProbability | ( | std::vector< double > | parameters | ) | [virtual] |
Calculates and returns the log of the prior probability at a given point in parameter space.
| parameters | A vector of coordinates in the parameter space. |
Reimplemented from BCModel.
Definition at line 42 of file BCSummaryPriorModel.cxx.
{
return 0;
}
| double BCSummaryPriorModel::LogLikelihood | ( | std::vector< double > | parameters | ) | [virtual] |
Calculates and returns the log of the Likelihood at a given point in parameter space.
| parameters | A vector of coordinates in the parameter space. |
Reimplemented from BCModel.
Definition at line 36 of file BCSummaryPriorModel.cxx.
{
return fTestModel->LogAPrioriProbability(parameters);
}
| int BCSummaryPriorModel::PerformAnalysis | ( | ) |
Run the MCMC and find the global mode for this model, i.e., only the prior knowledge of the test model is considered.
Definition at line 48 of file BCSummaryPriorModel.cxx.
{
// check if model is set
if (!fTestModel) {
BCLog::OutError("BCSummaryPriorModel::PerformAnalysis : Model not defined.");
return 0;
}
// copy parameters
int npar = fTestModel->GetNParameters();
for (int i = 0; i < npar; ++i) {
BCParameter* par = fTestModel->GetParameter(i);
AddParameter(par);
}
for (int i = 0; i < npar; ++i) {
int nbins = fTestModel->GetMarginalized(fTestModel->GetParameter(i))->GetHistogram()->GetNbinsX();
SetNbins((fTestModel->GetParameter(i)->GetName()).c_str(), nbins);
}
MCMCSetNLag(10);
MCMCSetNIterationsRun( fTestModel->MCMCGetNIterationsRun() );
MarginalizeAll();
FindModeMinuit( GetBestFitParameters() );
// no error
return 1;
}
| void BCSummaryPriorModel::SetTestModel | ( | BCModel * | model | ) | [inline] |
Set a pointer to the model under study.
| model | The model under study. |
Definition at line 50 of file BCSummaryPriorModel.h.
{ fTestModel = model; };
BCModel* BCSummaryPriorModel::fTestModel [private] |
A pointer to the model under study.
Definition at line 76 of file BCSummaryPriorModel.h.
1.7.1