STK++ 0.9.13
|
Gamma_aj_bjk is a mixture model of the following form. More...
#include <STK_Gamma_aj_bjk.h>
Public Types | |
typedef GammaBase< Gamma_aj_bjk< Array > > | Base |
![]() | |
typedef IMixtureDensity< Gamma_aj_bjk< Array > > | Base |
![]() | |
typedef hidden::MixtureTraits< Derived >::Array | Array |
typedef hidden::MixtureTraits< Derived >::Parameters | Parameters |
typedef hidden::Traits< Array >::Type | Type |
Public Member Functions | |
Gamma_aj_bjk (int nbCluster) | |
default constructor | |
Gamma_aj_bjk (Gamma_aj_bjk const &model) | |
copy constructor | |
~Gamma_aj_bjk () | |
destructor | |
void | randomInit (CArrayXX const *const &p_tik, CPointX const *const &p_tk) |
Initialize randomly the parameters of the Gamma mixture. | |
bool | run (CArrayXX const *const &p_tik, CPointX const *const &p_tk) |
Compute the run( CArrayXX const* const& p_tik, CPointX const* const& p_tk) . | |
int | computeNbFreeParameters () const |
![]() | |
Real | shape (int k, int j) const |
Real | scale (int k, int j) const |
void | initializeModelImpl () |
Initialize the parameters of the model. | |
Real | lnComponentProbability (int i, int k) const |
Real | impute (int i, int j, Weights const &pk) const |
Real | 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 of size (2*nbCluster, nbVariable). | |
void | writeParameters (CArrayXX const *p_tik, ostream &os) const |
This function can be used to write summary of parameters to the output stream. | |
Array const *const & | p_data () const |
![]() | |
~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 | |
![]() | |
Parameters | param_ |
parameters of the derived mixture model. | |
![]() | |
GammaBase (int nbCluster) | |
default constructor | |
GammaBase (GammaBase const &model) | |
copy constructor | |
~GammaBase () | |
destructor | |
Real | qValue (CArrayXX const *p_tik, CPointX const *p_tk) const |
compute the Q(theta) value. | |
bool | moments (CArrayXX const *p_tik) |
compute the weighted moments of a gamma mixture. | |
Real | meanjk (int j, int k) |
get the weighted mean of the jth variable of the kth cluster. | |
Real | variancejk (int j, int k) |
get the weighted variance of the jth variable of the kth cluster. | |
Real | meank (int k) |
get the mean of the weighted means of the kth cluster. | |
Real | variancek (int k) |
get the mean of the weighted variances of the kth cluster. | |
![]() | |
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. | |
![]() | |
Parameters | param_ |
parameters of the derived mixture model. | |
Gamma_aj_bjk is a mixture model of the following form.
Definition at line 70 of file STK_Gamma_aj_bjk.h.
typedef GammaBase< Gamma_aj_bjk<Array> > STK::Gamma_aj_bjk< Array >::Base |
Definition at line 73 of file STK_Gamma_aj_bjk.h.
|
inline |
default constructor
nbCluster | number of cluster in the model |
Definition at line 83 of file STK_Gamma_aj_bjk.h.
|
inline |
copy constructor
model | The model to copy |
Definition at line 87 of file STK_Gamma_aj_bjk.h.
|
inline |
|
inline |
Definition at line 99 of file STK_Gamma_aj_bjk.h.
References STK::IMixtureDensity< Derived >::nbCluster(), and STK::GammaBase< Gamma_aj_bjk< Array > >::p_data().
void STK::Gamma_aj_bjk< Array >::randomInit | ( | CArrayXX const *const & | p_tik, |
CPointX const *const & | p_tk | ||
) |
Initialize randomly the parameters of the Gamma mixture.
The shape will be selected randomly using an exponential of parameter mean^2/variance and the scale will be selected randomly using an exponential of parameter variance/mean.
Definition at line 108 of file STK_Gamma_aj_bjk.h.
References _T, STK::mean(), STK::Law::Exponential::rand(), and stk_cout.
Compute the run( CArrayXX const* const& p_tik, CPointX const* const& p_tk) .
Definition at line 131 of file STK_Gamma_aj_bjk.h.
References _T, STK::Algo::findZero(), STK::isNA(), STK::mean(), and stk_cout.