|
STK++ 0.9.13
|
Base class for all Mixture densities. More...
#include <STK_IMixtureDensity.h>

Public Types | |
| typedef hidden::MixtureTraits< Derived >::Array | Array |
| typedef hidden::MixtureTraits< Derived >::Parameters | Parameters |
| typedef hidden::Traits< Array >::Type | Type |
Public Member Functions | |
| ~IMixtureDensity () | |
| destructor | |
| int | nbCluster () const |
| int | nbSample () const |
| Real | lnNbSample () const |
| Array const *const & | p_data () const |
| Parameters const & | param () const |
| void | setData (Array const &data) |
| Set the data set. | |
| void | setData (Array const &data, int nbRow, int nbCol, bool byRow=true) |
| Set the data set and give dimensions. | |
| bool | initializeStep () |
| This function will be called at the beginning of the estimation process once the model is created and data is set. | |
| void | setParametersStep () |
| set the parameters obtained with the intermediate results and release the intermediate results. | |
| void | finalizeStep () |
| This function will be called once the model is estimated. | |
| template<class Weights > | |
| Type | sample (int i, int j, Weights const &tk) const |
Public Member Functions inherited from STK::IRecursiveTemplate< Derived > | |
| Derived & | asDerived () |
| static cast : return a reference of this with a cast to the derived class. | |
| Derived const & | asDerived () const |
| static cast : return a const reference of this with a cast to the derived class. | |
| Derived * | asPtrDerived () |
static cast : return a ptr on a Derived of this with a cast to the derived class. | |
| Derived const * | asPtrDerived () const |
static cast : return a ptr on a constant Derived of this with a cast to the derived class. | |
| Derived * | clone () const |
| create a leaf using the copy constructor of the Derived class. | |
| Derived * | clone (bool isRef) const |
| create a leaf using the copy constructor of the Derived class and a flag determining if the clone is a reference or not. | |
Protected Member Functions | |
| IMixtureDensity (int nbCluster) | |
| Default constructor. | |
| IMixtureDensity (IMixtureDensity const &model) | |
| copy constructor. | |
| void | initializeModel () |
| Initialize the model before its first use. | |
| bool | initializeStepImpl () |
| default implementation of initializeStepImpl (do nothing and return true) | |
| void | finalizeStepImpl () |
| default implementation of finalizeStepImpl (do nothing) | |
| void | setNbSample (int nbSample) |
| Set the number of sample of the model (needed by kernel models) | |
Protected Member Functions inherited from STK::IRecursiveTemplate< Derived > | |
| IRecursiveTemplate () | |
| constructor. | |
| ~IRecursiveTemplate () | |
| destructor. | |
Protected Attributes | |
| Parameters | param_ |
| parameters of the derived mixture model. | |
Private Attributes | |
| int | nbCluster_ |
| number of cluster. | |
| int | nbSample_ |
| total available samples | |
| Array const * | p_dataij_ |
| pointer on the data set | |
Base class for all Mixture densities.
Let X be an arbitrary measurable space and let 

![\[
f({\mathbf x}_i|\theta) = \sum_{k=1}^K p_k h({\mathbf x}_{i}| \lambda_{k},\alpha)
\]](form_183.png)
where the 



This interface class is the base class for all distributions part of a mixture model.
At this level the Parameters struct is created.
A call to setData trigger a call to initializeModel which itself trigger a call to initializeModelImpl. This last method can be re-implemented by derived class.
The pseudo virtual methods (needed by IMixtureBridge) to implement in concrete derived classes are
The pseudo virtual methods to re-implement if needed in derived classes are
Definition at line 99 of file STK_IMixtureDensity.h.
| typedef hidden::MixtureTraits<Derived>::Array STK::IMixtureDensity< Derived >::Array |
Definition at line 102 of file STK_IMixtureDensity.h.
| typedef hidden::MixtureTraits<Derived>::Parameters STK::IMixtureDensity< Derived >::Parameters |
Definition at line 103 of file STK_IMixtureDensity.h.
| typedef hidden::Traits<Array>::Type STK::IMixtureDensity< Derived >::Type |
Definition at line 104 of file STK_IMixtureDensity.h.
|
protected |
Default constructor.
| nbCluster | the number of cluster |
Definition at line 219 of file STK_IMixtureDensity.h.
|
protected |
copy constructor.
| model | the model to copy |
Definition at line 232 of file STK_IMixtureDensity.h.
|
inline |
|
inline |
This function will be called once the model is estimated.
perform specific model finalization stuff
Definition at line 165 of file STK_IMixtureDensity.h.
References STK::IRecursiveTemplate< Derived >::asDerived().
|
inlineprotected |
default implementation of finalizeStepImpl (do nothing)
Definition at line 197 of file STK_IMixtureDensity.h.
|
protected |
Initialize the model before its first use.
This function is triggered when data set is set. In this interface, the initializeModel() method
Definition at line 272 of file STK_IMixtureDensity.h.
|
inline |
This function will be called at the beginning of the estimation process once the model is created and data is set.
return true. Definition at line 155 of file STK_IMixtureDensity.h.
References STK::IRecursiveTemplate< Derived >::asDerived().
|
inlineprotected |
default implementation of initializeStepImpl (do nothing and return true)
Definition at line 195 of file STK_IMixtureDensity.h.
|
inline |
Definition at line 128 of file STK_IMixtureDensity.h.
References STK::IMixtureDensity< Derived >::nbSample_.
|
inline |
Definition at line 124 of file STK_IMixtureDensity.h.
References STK::IMixtureDensity< Derived >::nbCluster_.
Referenced by STK::Categorical_pjk< Array >::computeNbFreeParameters(), STK::Categorical_pk< Array >::computeNbFreeParameters(), STK::Gamma_a_bjk< Array >::computeNbFreeParameters(), STK::Gamma_a_bk< Array >::computeNbFreeParameters(), STK::Gamma_aj_bjk< Array >::computeNbFreeParameters(), STK::Gamma_aj_bk< Array >::computeNbFreeParameters(), STK::Gamma_ajk_b< Array >::computeNbFreeParameters(), STK::Gamma_ajk_bj< Array >::computeNbFreeParameters(), STK::Gamma_ajk_bjk< Array >::computeNbFreeParameters(), STK::Gamma_ajk_bk< Array >::computeNbFreeParameters(), STK::Gamma_ak_b< Array >::computeNbFreeParameters(), STK::Gamma_ak_bj< Array >::computeNbFreeParameters(), STK::Gamma_ak_bjk< Array >::computeNbFreeParameters(), and STK::Gamma_ak_bk< Array >::computeNbFreeParameters().
|
inline |
Definition at line 126 of file STK_IMixtureDensity.h.
References STK::IMixtureDensity< Derived >::nbSample_.
Referenced by STK::IMixtureDensity< Derived >::setNbSample().
|
inline |
Definition at line 131 of file STK_IMixtureDensity.h.
References STK::IMixtureDensity< Derived >::p_dataij_.
|
inline |
Definition at line 133 of file STK_IMixtureDensity.h.
References STK::IMixtureDensity< Derived >::param_.
|
inline |
| i,j | indexes of the data to impute |
| tk | the probabilities of each class for the ith individual |
Definition at line 172 of file STK_IMixtureDensity.h.
References STK::IRecursiveTemplate< Derived >::asDerived(), and STK::Law::Categorical::rand().
| void STK::IMixtureDensity< Derived >::setData | ( | Array const & | data | ) |
Set the data set.
Setting a (new) data set will trigger the initializeModel() method.
| data | the data set to set |
Definition at line 244 of file STK_IMixtureDensity.h.
| void STK::IMixtureDensity< Derived >::setData | ( | Array const & | data, |
| int | nbRow, | ||
| int | nbCol, | ||
| bool | byRow = true |
||
| ) |
Set the data set and give dimensions.
Setting a (new) data set will trigger the initializeModel() method.
| data | the data set to set |
| nbRow | number of rows of the data set |
| nbCol | number of columns of the data set |
| byRow | is data vectorized by row or by column ? |
Definition at line 254 of file STK_IMixtureDensity.h.
|
inlineprotected |
Set the number of sample of the model (needed by kernel models)
| nbSample | number of sample of the model |
Definition at line 203 of file STK_IMixtureDensity.h.
References STK::IMixtureDensity< Derived >::nbSample(), and STK::IMixtureDensity< Derived >::nbSample_.
|
inline |
set the parameters obtained with the intermediate results and release the intermediate results.
Definition at line 158 of file STK_IMixtureDensity.h.
References STK::IRecursiveTemplate< Derived >::asDerived(), and STK::IMixtureDensity< Derived >::param_.
|
private |
number of cluster.
Definition at line 207 of file STK_IMixtureDensity.h.
Referenced by STK::IMixtureDensity< Derived >::nbCluster().
|
private |
total available samples
Definition at line 209 of file STK_IMixtureDensity.h.
Referenced by STK::IMixtureDensity< Derived >::lnNbSample(), STK::IMixtureDensity< Derived >::nbSample(), and STK::IMixtureDensity< Derived >::setNbSample().
|
private |
pointer on the data set
Definition at line 211 of file STK_IMixtureDensity.h.
Referenced by STK::IMixtureDensity< Derived >::p_data(), and STK::KmmBase< Derived >::setData().
|
protected |
parameters of the derived mixture model.
Should be an instance of the STK::ModelParameters struct.
Definition at line 180 of file STK_IMixtureDensity.h.
Referenced by STK::IMixtureDensity< Derived >::param(), and STK::IMixtureDensity< Derived >::setParametersStep().