STK++ 0.9.13
STK::IStatModel< Derived > Class Template Reference

Base class for all Statistical Models [Deprecated], have been replaced by IStatModel. More...

#include <STK_IStatModel.h>

Inheritance diagram for STK::IStatModel< Derived >:
Inheritance graph

Public Types

typedef hidden::ModelTraits< Derived >::Data Data
 
typedef hidden::ModelTraits< Derived >::ParamHandler ParamHandler
 
typedef Data::Type Type
 Type of the data contained in the container.
 
typedef hidden::Traits< Data >::Row Row
 Type of the row of the data container (a sample)
 

Public Member Functions

 ~IStatModel ()
 destructor
 
Data const *const p_dataij () const
 
void setData (Data const &data)
 Set the data set of the model.
 
void setData (Data const *p_data)
 Set the data set of the model.
 
- Public Member Functions inherited from STK::IStatModelBase
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
 

Protected Member Functions

 IStatModel (Data const &data)
 Constructor with data set.
 
 IStatModel (Data const *p_data)
 Constructor with a ptr on the data set.
 
- Protected Member Functions inherited from STK::IStatModelBase
 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
 

Protected Attributes

Data constp_dataij_
 A pointer on the original data set.
 

Detailed Description

template<class Derived>
class STK::IStatModel< Derived >

Base class for all Statistical Models [Deprecated], have been replaced by IStatModel.

A Statistical model, $ \mathcal{P}$, is a collection of probability distribution functions or probability density functions (collectively referred to as ''distributions'' for brevity). A parametric model is a collection of distributions, each of which is indexed by a unique finite-dimensional parameter: $\mathcal{P}=\{\mathbb{P}_{\theta} : \theta \in \Theta\}$, where $\theta$ is a parameter and $\Theta \subseteq \mathbb{R}^d$ is the feasible region of parameters, which is a subset of d-dimensional Euclidean space. A statistical model may be used to describe the set of distributions from which one assumes that a particular data set is sampled. For example, if one assumes that data arise from a univariate Gaussian distribution, then one has assumed a Gaussian model: $\mathcal{P}=\{\mathbb{P}(x; \mu, \sigma) = \frac{1}{\sqrt{2 \pi} \sigma}
\exp\left\{ -\frac{1}{2\sigma^2}(x-\mu)^2\right\} : \mu \in \mathbb{R}, \sigma > 0\}
$.

From a computational point of view a statistical model is defined with the help of two elements

  • A data set where the number of samples is the number of rows and the number of variables is the number of column. This data set is stored in a Container of type Data.
  • A probability (density/law) which for each row of the data set can compute a density/probability.
Template Parameters
Datacan be any kind of container for the data set. it should at least derive from ITContainer,
See also
ITContainer, and provide an access to a single row like the CArray class or the Array2D class.

Definition at line 83 of file STK_IStatModel.h.

Member Typedef Documentation

◆ Data

template<class Derived >
typedef hidden::ModelTraits<Derived>::Data STK::IStatModel< Derived >::Data

Definition at line 86 of file STK_IStatModel.h.

◆ ParamHandler

template<class Derived >
typedef hidden::ModelTraits<Derived>::ParamHandler STK::IStatModel< Derived >::ParamHandler

Definition at line 87 of file STK_IStatModel.h.

◆ Row

template<class Derived >
typedef hidden::Traits<Data>::Row STK::IStatModel< Derived >::Row

Type of the row of the data container (a sample)

Definition at line 92 of file STK_IStatModel.h.

◆ Type

template<class Derived >
typedef Data::Type STK::IStatModel< Derived >::Type

Type of the data contained in the container.

Definition at line 90 of file STK_IStatModel.h.

Constructor & Destructor Documentation

◆ IStatModel() [1/2]

template<class Derived >
STK::IStatModel< Derived >::IStatModel ( Data const data)
inlineprotected

Constructor with data set.

Definition at line 96 of file STK_IStatModel.h.

96 : IStatModelBase(data.sizeRows(), data.sizeCols())
97 , p_dataij_(&data)
98 {}
IStatModelBase()
Default constructor.
Data const * p_dataij_
A pointer on the original data set.

◆ IStatModel() [2/2]

template<class Derived >
STK::IStatModel< Derived >::IStatModel ( Data const p_data)
inlineprotected

Constructor with a ptr on the data set.

Definition at line 100 of file STK_IStatModel.h.

100 : IStatModelBase(), p_dataij_(p_data)
101 { if (p_data) this->initialize(p_data->sizeRows(), p_data->sizeCols()) ;}
void initialize(int nbSample, int nbVariable)
set the dimensions of the parameters of the model

References STK::IStatModelBase::initialize().

◆ ~IStatModel()

template<class Derived >
STK::IStatModel< Derived >::~IStatModel ( )
inline

destructor

Definition at line 105 of file STK_IStatModel.h.

105{}

Member Function Documentation

◆ p_dataij()

template<class Derived >
Data const *const STK::IStatModel< Derived >::p_dataij ( ) const
inline
Returns
the pointer on the main data set

Definition at line 107 of file STK_IStatModel.h.

107{ return p_dataij_;}

References STK::IStatModel< Derived >::p_dataij_.

◆ setData() [1/2]

template<class Derived >
void STK::IStatModel< Derived >::setData ( Data const data)
inline

Set the data set of the model.

Parameters
datathe data set of the model

Definition at line 111 of file STK_IStatModel.h.

112 { p_dataij_ = &data;
113 this->setNbSample(p_dataij_->sizeRows());
114 this->setNbVariable(p_dataij_->sizeCols()) ;
115 }
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

References STK::IStatModel< Derived >::p_dataij_, STK::IStatModelBase::setNbSample(), and STK::IStatModelBase::setNbVariable().

◆ setData() [2/2]

template<class Derived >
void STK::IStatModel< Derived >::setData ( Data const p_data)
inline

Set the data set of the model.

Parameters
p_datathe data set of the model

Definition at line 119 of file STK_IStatModel.h.

120 { p_dataij_ = p_data;
121 if (p_dataij_)
122 {
123 this->setNbSample(p_dataij_->sizeRows());
124 this->setNbVariable(p_dataij_->sizeCols()) ;
125 }
126 }

References STK::IStatModel< Derived >::p_dataij_, STK::IStatModelBase::setNbSample(), and STK::IStatModelBase::setNbVariable().

Member Data Documentation

◆ p_dataij_

template<class Derived >
Data const* STK::IStatModel< Derived >::p_dataij_
protected

A pointer on the original data set.

Definition at line 130 of file STK_IStatModel.h.

Referenced by STK::IStatModel< Derived >::p_dataij(), STK::IStatModel< Derived >::setData(), and STK::IStatModel< Derived >::setData().


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