STK++ 1.0
STK::BICCriterion Class Reference

Derived class of Criterion for computing the BIC Criterion The Bic criteria is a penalization of the likelihood given by the formula

\[ -2 \cdot \ln{p(x|k)} \approx \mathrm{BIC} = {-2 \cdot \ln{L} + D \ln(n) } \]

where $ L $ represents the likelihood of the observations, $ D $ the number of free parameter of the model and $ n $ the number of sample. More...

#include <STK_BICCriterion.h>

Inheritance diagram for STK::BICCriterion:
Collaboration diagram for STK::BICCriterion:

List of all members.

Public Member Functions

 BICCriterion (IModel const &model)
 Constructor.
virtual ~BICCriterion ()
 virtual destructor.
virtual bool run ()
 implementation of the virtual method run

Detailed Description

Derived class of Criterion for computing the BIC Criterion The Bic criteria is a penalization of the likelihood given by the formula

\[ -2 \cdot \ln{p(x|k)} \approx \mathrm{BIC} = {-2 \cdot \ln{L} + D \ln(n) } \]

where $ L $ represents the likelihood of the observations, $ D $ the number of free parameter of the model and $ n $ the number of sample.

Definition at line 53 of file STK_BICCriterion.h.


Constructor & Destructor Documentation

STK::BICCriterion::BICCriterion ( IModel const &  model)

Constructor.

Parameters:
modelthe model to evaluate the criterion

Definition at line 43 of file STK_BICCriterion.cpp.

STK::BICCriterion::~BICCriterion ( ) [virtual]

virtual destructor.

Definition at line 50 of file STK_BICCriterion.cpp.

{}

Member Function Documentation

bool STK::BICCriterion::run ( ) [virtual]

implementation of the virtual method run

Implements STK::IRunnerBase.

Definition at line 53 of file STK_BICCriterion.cpp.

References STK::Exception::error(), STK::IModel::logLikelihood(), STK::IModel::logNbSample(), STK::IRunnerBase::msg_error_, STK::IModel::nbFreeParameter(), STK::ICriterion::p_model_, and STK::ICriterion::value_.

{
  try
  {
    Real loglikelihood    = p_model_->logLikelihood();
    Integer freeParameter = p_model_->nbFreeParameter();
    Real logN             = p_model_->logNbSample();
    // BIC criteria
    value_  = (-2.*loglikelihood)+(freeParameter*logN);
  }
  catch(const Exception& e)
  {
    msg_error_ = e.error();
    return false;
  }
  return true;
}

Here is the call graph for this function:


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