STK++ 0.9.13
|
The diagonal Categorical mixture model Categorical_pk
is a diagonal Categorical model and has a density function of the form.
More...
#include <STK_Categorical_pk.h>
Public Types | |
typedef CategoricalBase< Categorical_pk< Array > > | Base |
![]() | |
typedef hidden::MixtureTraits< Derived >::Array | Array |
typedef hidden::MixtureTraits< Derived >::Parameters | Parameters |
typedef hidden::Traits< Array >::Type | Type |
Public Member Functions | |
Categorical_pk (int nbCluster) | |
default constructor | |
Categorical_pk (Categorical_pk const &model) | |
copy constructor | |
~Categorical_pk () | |
destructor | |
void | randomInit (CArrayXX const *const &p_tik, CPointX const *const &p_tk) |
Initialize randomly the parameters of the Categorical mixture. | |
bool | run (CArrayXX const *const &p_tik, CPointX const *const &p_tk) |
Compute the weighted proportions of each class. | |
int | computeNbFreeParameters () const |
![]() | |
PointXi const & | nbModalities () const |
Range const & | modalities () const |
Real | proba (int k, int j, int l) const |
CVectorX | proba (int k, int j) const |
void | initializeModelImpl () |
Initialize the model. | |
Real | lnComponentProbability (int i, int k) const |
int | impute (int i, int j, Weights const &tk) const |
int | rand (int i, int j, int k) const |
void | getParameters (Array ¶ms) const |
This function is used in order to get the current values of the parameters in an array. | |
void | writeParameters (CArrayXX const *p_tik, ostream &os) const |
This function can be used to write summary of parameters to the output stream. | |
![]() | |
~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 |
![]() | |
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. | |
Additional Inherited Members | |
![]() | |
typedef IMixtureDensity< Categorical_pk< Array > > | Base |
![]() | |
CategoricalBase (int nbCluster) | |
default constructor | |
CategoricalBase (CategoricalBase const &model) | |
copy constructor | |
~CategoricalBase () | |
destructor | |
Array const *const & | p_data () const |
![]() | |
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) | |
![]() | |
IRecursiveTemplate () | |
constructor. | |
~IRecursiveTemplate () | |
destructor. | |
![]() | |
PointXi | nbModalities_ |
Array with the number of modalities of each columns of the data set. | |
Range | modalities_ |
range of the modalities | |
Parameters | param_ |
parameters of the derived mixture model. | |
![]() | |
Parameters | param_ |
parameters of the derived mixture model. | |
The diagonal Categorical mixture model Categorical_pk
is a diagonal Categorical model and has a density function of the form.
Definition at line 69 of file STK_Categorical_pk.h.
typedef CategoricalBase<Categorical_pk<Array> > STK::Categorical_pk< Array >::Base |
Definition at line 72 of file STK_Categorical_pk.h.
|
inline |
default constructor
nbCluster | number of cluster in the model |
Definition at line 79 of file STK_Categorical_pk.h.
|
inline |
copy constructor
model | The model to copy |
Definition at line 83 of file STK_Categorical_pk.h.
|
inline |
|
inline |
Definition at line 93 of file STK_Categorical_pk.h.
References STK::CategoricalBase< Categorical_pk< Array > >::modalities_, STK::IMixtureDensity< Derived >::nbCluster(), and STK::TRange< UnknownSize >::size().
void STK::Categorical_pk< Array >::randomInit | ( | CArrayXX const *const & | p_tik, |
CPointX const *const & | p_tk | ||
) |
Initialize randomly the parameters of the Categorical mixture.
Probabilities will be choosen uniformly.
Definition at line 102 of file STK_Categorical_pk.h.
bool STK::Categorical_pk< Array >::run | ( | CArrayXX const *const & | p_tik, |
CPointX const *const & | p_tk | ||
) |
Compute the weighted proportions of each class.
Definition at line 113 of file STK_Categorical_pk.h.
References STK::sum().