STK++ 0.9.13
|
Base class for all Statistical Models. More...
#include <STK_IUnivStatModel.h>
Public Types | |
typedef ColVector::Type | Type |
Type of the data contained in the container. | |
typedef IRunnerUnsupervised< ColVector, WColVector > | Runner |
Type of the Runner. | |
Public Member Functions | |
virtual | ~IUnivStatModel () |
destructor | |
Real | computeLnLikelihood () const |
compute the log Likelihood of the statistical model. | |
UnivariateLaw const & | law () const |
virtual int | computeNbFreeParameters () const =0 |
compute the number of free parameters | |
virtual bool | run () |
Estimate the parameters of the model and update the. | |
virtual bool | run (WColVector const &weights) |
compute the weighted empirical probability of success based on the observed variables. | |
![]() | |
int | nbSample () const |
Real | lnNbSample () const |
int | nbVariable () const |
Real | lnLikelihood () const |
Real | likelihood () const |
int | nbFreeParameter () const |
Real | computeBIC () const |
Real | computeAIC () const |
Real | computeML () const |
![]() | |
ColVector const * | p_data () const |
get the data set | |
virtual void | setData (ColVector const *p_data) |
Set the data set. | |
virtual void | setData (ColVector const &data) |
Set the data set. | |
![]() | |
String const & | error () const |
get the last error message. | |
Protected Member Functions | |
IUnivStatModel () | |
default constructor. | |
IUnivStatModel (ColVector const &data) | |
Constructor with data set. | |
IUnivStatModel (ColVector const *p_data) | |
Constructor with a ptr on the data set. | |
IUnivStatModel (IUnivStatModel const &model) | |
Copy constructor. | |
virtual void | update () |
This virtual method will be called if the user set a new data set. | |
virtual void | computeParameters ()=0 |
compute the parameters | |
virtual void | computeParameters (WColVector const &weights)=0 |
compute the weighted parameters | |
![]() | |
IStatModelBase () | |
Default constructor. | |
IStatModelBase (int nbSample) | |
Constructor with specified dimension. | |
IStatModelBase (int nbSample, int nbVariable) | |
Constructor with specified dimension. | |
IStatModelBase (IStatModelBase const &model) | |
Copy constructor. | |
~IStatModelBase () | |
destructor | |
void | setNbFreeParameter (int const &nbFreeParameter) |
set the number of free parameters of the model | |
void | setNbSample (int const &nbSample) |
set the number of samples of the model | |
void | setNbVariable (int const &nbVariable) |
set the number of variables of the model | |
void | setLnLikelihood (Real const &lnLikelihood) |
set the log-likelihood of the model | |
void | initialize (int nbSample, int nbVariable) |
set the dimensions of the parameters of the model | |
![]() | |
IRunnerUnsupervised () | |
default constructor. | |
IRunnerUnsupervised (ColVector const *const p_data) | |
constructor with a pointer on the constant data set | |
IRunnerUnsupervised (ColVector const &data) | |
constructor with a constant reference on the data set | |
IRunnerUnsupervised (IRunnerUnsupervised const &runner) | |
copy constructor | |
~IRunnerUnsupervised () | |
destructor | |
![]() | |
IRunnerBase () | |
default constructor | |
IRunnerBase (IRunnerBase const &runner) | |
copy constructor | |
virtual | ~IRunnerBase () |
destructor | |
Protected Attributes | |
UnivariateLaw | law_ |
The probability law of the model. | |
![]() | |
ColVector const * | p_data_ |
A pointer on the original data set. | |
![]() | |
String | msg_error_ |
String with the last error message. | |
bool | hasRun_ |
true if run has been used, false otherwise | |
Base class for all Statistical Models.
A Statistical model,
From a computational point of view a statistical model is defined with the help of two elements
ColVector
.The parameters of the distribution (if any) are directly managed by the probability law.
Further implementation of this interface have to implement the run()
and the run(weights)
methods in order to estimate the parameters of the univariate law.
ColVector | can be any kind of vector for the data set. it should at least derive from the specialization of ITContainer for Arrays::vector_, |
UnivariateLaw | any probabilistic law deriving from the interface class IUnivLaw, |
Definition at line 86 of file STK_IUnivStatModel.h.
typedef IRunnerUnsupervised<ColVector, WColVector> STK::IUnivStatModel< ColVector, WColVector, UnivariateLaw >::Runner |
Type of the Runner.
Definition at line 93 of file STK_IUnivStatModel.h.
typedef ColVector::Type STK::IUnivStatModel< ColVector, WColVector, UnivariateLaw >::Type |
Type of the data contained in the container.
Definition at line 91 of file STK_IUnivStatModel.h.
|
inlineprotected |
default constructor.
Definition at line 97 of file STK_IUnivStatModel.h.
|
inlineprotected |
Constructor with data set.
Definition at line 99 of file STK_IUnivStatModel.h.
References STK::IStatModelBase::initialize().
|
inlineprotected |
Constructor with a ptr on the data set.
Definition at line 102 of file STK_IUnivStatModel.h.
References STK::IStatModelBase::initialize(), and STK::IRunnerUnsupervised< ColVector, WColVector >::p_data().
|
inlineprotected |
Copy constructor.
Definition at line 105 of file STK_IUnivStatModel.h.
|
inlinevirtual |
|
inline |
compute the log Likelihood of the statistical model.
Definition at line 112 of file STK_IUnivStatModel.h.
References STK::IUnivStatModel< ColVector, WColVector, UnivariateLaw >::law_, STK::IRunnerUnsupervised< ColVector, WColVector >::p_data(), and STK::sum().
Referenced by STK::IUnivStatModel< ColVector, WColVector, UnivariateLaw >::run(), and STK::IUnivStatModel< ColVector, WColVector, UnivariateLaw >::run().
|
pure virtual |
compute the number of free parameters
Implemented in STK::BernoulliModel< Array, WColVector >.
Referenced by STK::IUnivStatModel< ColVector, WColVector, UnivariateLaw >::run(), and STK::IUnivStatModel< ColVector, WColVector, UnivariateLaw >::run().
|
protectedpure virtual |
compute the parameters
Implemented in STK::BernoulliModel< Array, WColVector >.
Referenced by STK::IUnivStatModel< ColVector, WColVector, UnivariateLaw >::run(), and STK::IUnivStatModel< ColVector, WColVector, UnivariateLaw >::run().
|
protectedpure virtual |
compute the weighted parameters
Implemented in STK::BernoulliModel< Array, WColVector >.
|
inline |
Definition at line 120 of file STK_IUnivStatModel.h.
References STK::IUnivStatModel< ColVector, WColVector, UnivariateLaw >::law_.
|
inlinevirtual |
Estimate the parameters of the model and update the.
Implements STK::IRunnerUnsupervised< ColVector, WColVector >.
Definition at line 125 of file STK_IUnivStatModel.h.
References STK::IUnivStatModel< ColVector, WColVector, UnivariateLaw >::computeLnLikelihood(), STK::IUnivStatModel< ColVector, WColVector, UnivariateLaw >::computeNbFreeParameters(), STK::IUnivStatModel< ColVector, WColVector, UnivariateLaw >::computeParameters(), STK::Exception::error(), STK::IRunnerBase::msg_error_, STK::IRunnerUnsupervised< ColVector, WColVector >::p_data(), STK::IUnivStatModel< ColVector, WColVector, UnivariateLaw >::run(), STK::IStatModelBase::setLnLikelihood(), STK::IStatModelBase::setNbFreeParameter(), and STKERROR_NO_ARG.
Referenced by STK::IUnivStatModel< ColVector, WColVector, UnivariateLaw >::run(), and STK::IUnivStatModel< ColVector, WColVector, UnivariateLaw >::run().
|
inlinevirtual |
compute the weighted empirical probability of success based on the observed variables.
The NA values are discarded.
weights | the weights of the observations |
Implements STK::IRunnerUnsupervised< ColVector, WColVector >.
Definition at line 148 of file STK_IUnivStatModel.h.
References STK::IUnivStatModel< ColVector, WColVector, UnivariateLaw >::computeLnLikelihood(), STK::IUnivStatModel< ColVector, WColVector, UnivariateLaw >::computeNbFreeParameters(), STK::IUnivStatModel< ColVector, WColVector, UnivariateLaw >::computeParameters(), STK::Exception::error(), STK::IRunnerBase::msg_error_, STK::IRunnerUnsupervised< ColVector, WColVector >::p_data(), STK::IUnivStatModel< ColVector, WColVector, UnivariateLaw >::run(), STK::IStatModelBase::setLnLikelihood(), STK::IStatModelBase::setNbFreeParameter(), and STKERROR_NO_ARG.
|
inlineprotectedvirtual |
This virtual method will be called if the user set a new data set.
Reimplemented from STK::IRunnerBase.
Definition at line 171 of file STK_IUnivStatModel.h.
References STK::IStatModelBase::initialize(), and STK::IRunnerUnsupervised< ColVector, WColVector >::p_data().
|
protected |
The probability law of the model.
Definition at line 174 of file STK_IUnivStatModel.h.
Referenced by STK::IUnivStatModel< ColVector, WColVector, UnivariateLaw >::computeLnLikelihood(), and STK::IUnivStatModel< ColVector, WColVector, UnivariateLaw >::law().