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


Public Member Functions | |
| AICCriterion (IModel const &model) | |
| Constructor. | |
| virtual | ~AICCriterion () |
| virtual destructor. | |
| virtual bool | run () |
| implementation of the virtual method run | |
Derived class of Criterion for computing the AIC Criterion The AIC criteria is a penalization of the likelihood given by the formula
where
represents the likelihood of the observations and
the number of free parameter of the model.
Definition at line 53 of file STK_AICCriterion.h.
| STK::AICCriterion::AICCriterion | ( | IModel const & | model | ) |
Constructor.
| model | the model to evaluate the criterion |
Definition at line 43 of file STK_AICCriterion.cpp.
: ICriterion(model) {}
| STK::AICCriterion::~AICCriterion | ( | ) | [virtual] |
| bool STK::AICCriterion::run | ( | ) | [virtual] |
implementation of the virtual method run
Implements STK::IRunnerBase.
Definition at line 53 of file STK_AICCriterion.cpp.
References STK::Exception::error(), STK::IModel::logLikelihood(), 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();
// AIC criteria
value_ = 2.*(-loglikelihood+freeParameter);
}
catch(const Exception& e)
{
msg_error_ = e.error();
return false;
}
return true;
}
