A helper class for the BCSummaryTool. More...
#include <BCSummaryPriorModel.h>
Inherits BCModel.
Public Member Functions | |
BCSummaryPriorModel () | |
BCSummaryPriorModel (const char *name) | |
~BCSummaryPriorModel () | |
void | SetModel (BCModel *model) |
double | LogAPrioriProbability (const std::vector< double > ¶meters) |
double | LogLikelihood (const std::vector< double > ¶meters) |
Private Attributes | |
BCModel * | fTestModel |
A helper class for the BCSummaryTool.
Copyright (C) 2008-2012, Daniel Kollar and Kevin Kroeninger. All rights reserved.
For the licensing terms see doc/COPYING.
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 | ( | const 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 80 of file BCSummaryPriorModel.cxx.
{
return 0;
}
double BCSummaryPriorModel::LogLikelihood | ( | const 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. |
Implements BCModel.
Definition at line 74 of file BCSummaryPriorModel.cxx.
{ return fTestModel->LogAPrioriProbability(parameters); }
void BCSummaryPriorModel::SetModel | ( | BCModel * | model | ) |
Set a pointer to the model under study.
model | The model under study. |
Definition at line 36 of file BCSummaryPriorModel.cxx.
{ fTestModel = model; // copy parameters int npar = fTestModel->GetNParameters(); for (int i = 0; i < npar; ++i) { BCParameter * par = fTestModel->GetParameter(i); AddParameter(par); } // set default histogram binning to the one of the original model for (int i = 0; i < npar; ++i) { // this construct has to go here, because otherwise there is a // warning from BCEngineMCMC:: MCMCGetH1Marginalized if (fTestModel->GetBestFitParameters().size() > 0){ BCH1D* hist = fTestModel->GetMarginalized( fTestModel->GetParameter(i) ); if (hist) { int nbins = hist->GetHistogram()->GetNbinsX(); SetNbins( (fTestModel->GetParameter(i)->GetName()).c_str(), nbins); } } } // set default MCMC setup to the one of the original model MCMCSetNChains( fTestModel->MCMCGetNChains() ); MCMCSetNLag( fTestModel->MCMCGetNLag() ); MCMCSetNIterationsMax( fTestModel->MCMCGetNIterationsMax() ); MCMCSetNIterationsRun( fTestModel->MCMCGetNIterationsRun() ); MCMCSetNIterationsPreRunMin( fTestModel->MCMCGetNIterationsPreRunMin() ); MCMCSetNIterationsUpdate( fTestModel->MCMCGetNIterationsUpdate() ); MCMCSetNIterationsUpdateMax( fTestModel->MCMCGetNIterationsUpdateMax() ); MCMCSetRValueCriterion( fTestModel->MCMCGetRValueCriterion() ); MCMCSetRValueParametersCriterion( fTestModel->MCMCGetRValueParametersCriterion() ); }
BCModel* BCSummaryPriorModel::fTestModel [private] |
A pointer to the model under study.
Definition at line 70 of file BCSummaryPriorModel.h.