|
STK++ 1.0
|
Derived class of Criterion for computing the BIC Criterion The Bic criteria is a penalization of the likelihood given by the formula
where
represents the likelihood of the observations,
the number of free parameter of the model and
the number of sample.
More...
#include <STK_BICCriterion.h>


Public Member Functions | |
| BICCriterion (IModel const &model) | |
| Constructor. | |
| virtual | ~BICCriterion () |
| virtual destructor. | |
| virtual bool | run () |
| implementation of the virtual method run | |
Derived class of Criterion for computing the BIC Criterion The Bic criteria is a penalization of the likelihood given by the formula
where
represents the likelihood of the observations,
the number of free parameter of the model and
the number of sample.
Definition at line 53 of file STK_BICCriterion.h.
| STK::BICCriterion::BICCriterion | ( | IModel const & | model | ) |
Constructor.
| model | the model to evaluate the criterion |
Definition at line 43 of file STK_BICCriterion.cpp.
: ICriterion(model) {}
| STK::BICCriterion::~BICCriterion | ( | ) | [virtual] |
| 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;
}
