|
STK++ 0.9.13
|
Gamma_ajk_b is a mixture model of the following form. More...
#include <STK_Gamma_ajk_b.h>

Public Types | |
| typedef GammaBase< Gamma_ajk_b< Array > > | Base |
Public Types inherited from STK::GammaBase< Gamma_ajk_b< Array > > | |
| typedef IMixtureDensity< Gamma_ajk_b< Array > > | Base |
Public Types inherited from STK::IMixtureDensity< Derived > | |
| typedef hidden::MixtureTraits< Derived >::Array | Array |
| typedef hidden::MixtureTraits< Derived >::Parameters | Parameters |
| typedef hidden::Traits< Array >::Type | Type |
Public Member Functions | |
| Gamma_ajk_b (int nbCluster) | |
| default constructor | |
| Gamma_ajk_b (Gamma_ajk_b const &model) | |
| copy constructor | |
| ~Gamma_ajk_b () | |
| 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 weighted mean and the common variance. | |
| int | computeNbFreeParameters () const |
Public Member Functions inherited from STK::GammaBase< Gamma_ajk_b< Array > > | |
| 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 |
Public Member Functions inherited from STK::IMixtureDensity< Derived > | |
| ~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. | |
Additional Inherited Members | |
Public Attributes inherited from STK::GammaBase< Gamma_ajk_b< Array > > | |
| Parameters | param_ |
| parameters of the derived mixture model. | |
Protected Member Functions inherited from STK::GammaBase< Gamma_ajk_b< Array > > | |
| 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. | |
Protected Member Functions inherited from STK::IMixtureDensity< Derived > | |
| 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 inherited from STK::IMixtureDensity< Derived > | |
| Parameters | param_ |
| parameters of the derived mixture model. | |
Gamma_ajk_b is a mixture model of the following form.
![\[
f(\mathbf{x}_i|\theta) = \sum_{k=1}^K p_k
\prod_{j=1}^p \left(\frac{x_i^j}{b}\right)^{a_{jk}-1}
\frac{e^{-x_i^j/b}}{b \, \Gamma(a_{jk})},
\quad x_i^j>0, \quad i=1,\ldots,n.
\]](form_158.png)
Definition at line 74 of file STK_Gamma_ajk_b.h.
| typedef GammaBase<Gamma_ajk_b<Array> > STK::Gamma_ajk_b< Array >::Base |
Definition at line 77 of file STK_Gamma_ajk_b.h.
|
inline |
default constructor
| nbCluster | number of cluster in the model |
Definition at line 87 of file STK_Gamma_ajk_b.h.
|
inline |
copy constructor
| model | The model to copy |
Definition at line 91 of file STK_Gamma_ajk_b.h.
|
inline |
|
inline |
Definition at line 99 of file STK_Gamma_ajk_b.h.
References STK::IMixtureDensity< Derived >::nbCluster(), and STK::GammaBase< Gamma_ajk_b< Array > >::p_data().
| void STK::Gamma_ajk_b< Array >::randomInit | ( | CArrayXX const *const & | p_tik, |
| CPointX const *const & | p_tk | ||
| ) |
Initialize randomly the parameters of the Gamma mixture.
Definition at line 108 of file STK_Gamma_ajk_b.h.
References _T, STK::mean(), STK::Law::Exponential::rand(), and stk_cout.
Compute the weighted mean and the common variance.
Definition at line 131 of file STK_Gamma_ajk_b.h.
References _T, STK::Algo::findZero(), MAXITER, stk_cout, and TOL.