Public Member Functions | Private Attributes

BCSummaryPriorModel Class Reference

A helper class for the BCSummaryTool. More...

#include <BCSummaryPriorModel.h>

Inherits BCModel.

Collaboration diagram for BCSummaryPriorModel:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BCSummaryPriorModel ()
 BCSummaryPriorModel (const char *name)
 ~BCSummaryPriorModel ()
void SetModel (BCModel *model)
double LogAPrioriProbability (const std::vector< double > &parameters)
double LogLikelihood (const std::vector< double > &parameters)

Private Attributes

BCModelfTestModel

Detailed Description

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.

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

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.

Parameters:
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() );

}


Member Data Documentation

A pointer to the model under study.

Definition at line 70 of file BCSummaryPriorModel.h.


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