STK++ 0.9.13
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. More...

#include <STK_PenCriterion.h>

Inheritance diagram for STK::BICCriterion:
Inheritance graph

Public Member Functions

 BICCriterion ()
 Default Constructor.
 
 BICCriterion (IStatModelBase *const p_model)
 Constructor.
 
 BICCriterion (IStatModelBase const &model)
 Constructor.
 
 BICCriterion (BICCriterion const &criterion)
 copy Constructor.
 
virtual ~BICCriterion ()
 virtual destructor.
 
BICCriterionclone () const
 clone pattern
 
virtual bool run ()
 implementation of the virtual method run
 
- Public Member Functions inherited from STK::ICriterion
virtual ~ICriterion ()
 Destructor.
 
Real constvalue () const
 
void setModel (IStatModelBase const *p_model)
 
void setModel (IStatModelBase const &model)
 
- Public Member Functions inherited from STK::IRunnerBase
String consterror () const
 get the last error message.
 

Additional Inherited Members

- Protected Member Functions inherited from STK::ICriterion
 ICriterion ()
 Default Constructor.
 
 ICriterion (IStatModelBase const *p_model)
 Constructor.
 
 ICriterion (IStatModelBase const &model)
 Constructor.
 
 ICriterion (ICriterion const &criterion)
 copy Constructor.
 
- Protected Member Functions inherited from STK::IRunnerBase
 IRunnerBase ()
 default constructor
 
 IRunnerBase (IRunnerBase const &runner)
 copy constructor
 
virtual ~IRunnerBase ()
 destructor
 
virtual void update ()
 update the runner.
 
- Protected Attributes inherited from STK::ICriterion
IStatModelBase constp_model_
 The current statistical model to use.
 
Real value_
 Computed value of the criterion.
 
- Protected Attributes inherited from STK::IRunnerBase
String msg_error_
 String with the last error message.
 
bool hasRun_
 true if run has been used, false otherwise
 

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 142 of file STK_PenCriterion.h.

Constructor & Destructor Documentation

◆ BICCriterion() [1/4]

STK::BICCriterion::BICCriterion ( )
inline

Default Constructor.

Definition at line 146 of file STK_PenCriterion.h.

146: ICriterion() {}
ICriterion()
Default Constructor.

Referenced by clone().

◆ BICCriterion() [2/4]

STK::BICCriterion::BICCriterion ( IStatModelBase *const  p_model)
inline

Constructor.

Parameters
p_modelapointer on the current model

Definition at line 150 of file STK_PenCriterion.h.

150: ICriterion(p_model) {}

◆ BICCriterion() [3/4]

STK::BICCriterion::BICCriterion ( IStatModelBase const model)
inline

Constructor.

Parameters
modelthe current model

Definition at line 154 of file STK_PenCriterion.h.

154: ICriterion(model) {}

◆ BICCriterion() [4/4]

STK::BICCriterion::BICCriterion ( BICCriterion const criterion)
inline

copy Constructor.

Parameters
criterionthe criterion to copy

Definition at line 158 of file STK_PenCriterion.h.

158: ICriterion(criterion) {}

◆ ~BICCriterion()

virtual STK::BICCriterion::~BICCriterion ( )
inlinevirtual

virtual destructor.

Definition at line 160 of file STK_PenCriterion.h.

160{}

Member Function Documentation

◆ clone()

BICCriterion * STK::BICCriterion::clone ( ) const
inline

clone pattern

Definition at line 162 of file STK_PenCriterion.h.

162{ return new BICCriterion(*this);}
BICCriterion()
Default Constructor.

References BICCriterion().

◆ run()

bool STK::BICCriterion::run ( )
inlinevirtual

implementation of the virtual method run

Implements STK::IRunnerBase.

Definition at line 168 of file STK_PenCriterion.h.

169{
170 if (!p_model_)
172 return false;
173 }
175 return true;
176}
#define STKERROR_NO_ARG(Where, Error)
Definition STK_Macros.h:49
virtual bool run()
implementation of the virtual method run
Real value_
Computed value of the criterion.
IStatModelBase const * p_model_
The current statistical model to use.
String msg_error_
String with the last error message.
Definition STK_IRunner.h:96

References STK::IStatModelBase::computeBIC(), STK::IRunnerBase::msg_error_, STK::ICriterion::p_model_, run(), STKERROR_NO_ARG, and STK::ICriterion::value_.

Referenced by run().


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