Public Member Functions | Private Attributes

BCSummaryPriorModel Class Reference

A helper class for the BCSummaryTool. More...

#include <BCSummaryPriorModel.h>

Inheritance diagram for BCSummaryPriorModel:
Inheritance graph
[legend]
Collaboration diagram for BCSummaryPriorModel:
Collaboration graph
[legend]

List of all members.

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

BCModelfTestModel

Detailed Description

A helper class for the BCSummaryTool.

A helper class for the BCSummaryTool.

Author:
Daniel Kollar
Kevin Kröninger
Version:
1.0.0
Date:
15.02.2010

Definition at line 28 of file BCSummaryPriorModel.h.


Constructor & Destructor Documentation

BCSummaryPriorModel::BCSummaryPriorModel (  ) 

The default constructor.

Definition at line 18 of file BCSummaryPriorModel.cxx.

   : BCModel()
   , fTestModel(0)
{
}

BCSummaryPriorModel::BCSummaryPriorModel ( const char *  name  ) 

A constructor.

Parameters:
name The name of the model.

Definition at line 25 of file BCSummaryPriorModel.cxx.

   : BCModel(name)
   , fTestModel(0)
{
}

BCSummaryPriorModel::~BCSummaryPriorModel (  ) 

The default destructor.

Definition at line 32 of file BCSummaryPriorModel.cxx.

{}


Member Function Documentation

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:
parameters A vector of coordinates in the parameter space.
Returns:
The prior probability.

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:
parameters A vector of coordinates in the parameter space.
Returns:
The log likelihood.

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.

Parameters:
model The model under study.

Definition at line 50 of file BCSummaryPriorModel.h.

      { fTestModel = model; };


Member Data Documentation

A pointer to the model under study.

Definition at line 76 of file BCSummaryPriorModel.h.


The documentation for this class was generated from the following files: