|
STK++ 0.9.13
|
Base class for the gamma models. More...
#include <STK_GammaBase.h>

Public Types | |
| typedef IMixtureDensity< Derived > | 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 | |
| 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 |
| template<class Weights > | |
| Real | impute (int i, int j, Weights const &pk) const |
| Real | rand (int i, int j, int k) const |
| template<class Array > | |
| 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. | |
Public Attributes | |
| Parameters | param_ |
| parameters of the derived mixture model. | |
Protected Member Functions | |
| 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. | |
Additional Inherited Members | |
Protected Attributes inherited from STK::IMixtureDensity< Derived > | |
| Parameters | param_ |
| parameters of the derived mixture model. | |
Base class for the gamma models.
Definition at line 95 of file STK_GammaBase.h.
| typedef IMixtureDensity<Derived > STK::GammaBase< Derived >::Base |
Definition at line 98 of file STK_GammaBase.h.
|
inlineprotected |
default constructor
| nbCluster | number of cluster in the model |
Definition at line 106 of file STK_GammaBase.h.
|
inlineprotected |
copy constructor
| model | The model to copy |
Definition at line 110 of file STK_GammaBase.h.
|
inlineprotected |
| void STK::GammaBase< Derived >::getParameters | ( | Array & | params | ) | const |
This function is used in order to get the current values of the parameters in an array of size (2*nbCluster, nbVariable).
| [out] | params | the array with the parameters of the mixture. |
Definition at line 259 of file STK_GammaBase.h.
References STK::baseIdx.
| Real STK::GammaBase< Derived >::impute | ( | int | i, |
| int | j, | ||
| Weights const & | pk | ||
| ) | const |
| i,j | indexes of the data to impute |
| pk | the probabilities of each class for the ith individual |
Definition at line 186 of file STK_GammaBase.h.
References STK::sum().
|
inline |
Initialize the parameters of the model.
Definition at line 121 of file STK_GammaBase.h.
References STK::GammaBase< Derived >::p_data(), and STK::GammaBase< Derived >::param_.
| Real STK::GammaBase< Derived >::lnComponentProbability | ( | int | i, |
| int | k | ||
| ) | const |
| i,k | indexes of the sample and of the component |
Definition at line 170 of file STK_GammaBase.h.
References STK::Law::Gamma::lpdf(), and STK::sum().
|
inlineprotected |
get the weighted mean of the jth variable of the kth cluster.
Definition at line 157 of file STK_GammaBase.h.
References STK::GammaBase< Derived >::param_.
|
inlineprotected |
get the mean of the weighted means of the kth cluster.
Definition at line 161 of file STK_GammaBase.h.
References STK::GammaBase< Derived >::param_.
|
protected |
compute the weighted moments of a gamma mixture.
Definition at line 196 of file STK_GammaBase.h.
References STK::ICArray< Derived >::col(), STK::isNA(), and STK::mean().
|
inline |
Definition at line 131 of file STK_IMixtureDensity.h.
Referenced by STK::GammaBase< Derived >::initializeModelImpl().
|
protected |
compute the Q(theta) value.
Definition at line 222 of file STK_GammaBase.h.
References STK::Funct::lgamma().
| i,j,k | indexes of the data to simulate |
Definition at line 137 of file STK_GammaBase.h.
References STK::Law::Gamma::rand(), STK::GammaBase< Derived >::scale(), and STK::GammaBase< Derived >::shape().
|
inline |
Definition at line 118 of file STK_GammaBase.h.
References STK::GammaBase< Derived >::param_.
Referenced by STK::GammaBase< Derived >::rand().
|
inline |
Definition at line 116 of file STK_GammaBase.h.
References STK::GammaBase< Derived >::param_.
Referenced by STK::GammaBase< Derived >::rand().
|
inlineprotected |
get the weighted variance of the jth variable of the kth cluster.
Definition at line 159 of file STK_GammaBase.h.
References STK::GammaBase< Derived >::param_.
|
inlineprotected |
get the mean of the weighted variances of the kth cluster.
Definition at line 163 of file STK_GammaBase.h.
References STK::GammaBase< Derived >::param_.
| void STK::GammaBase< Derived >::writeParameters | ( | CArrayXX const * | p_tik, |
| ostream & | os | ||
| ) | const |
This function can be used to write summary of parameters to the output stream.
| p_tik | a constant pointer on the posterior probabilities |
| os | Stream where you want to write the summary of parameters. |
Definition at line 240 of file STK_GammaBase.h.
References _T.
| Parameters STK::IMixtureDensity< Derived >::param_ |
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::GammaBase< Derived >::initializeModelImpl(), STK::GammaBase< Derived >::meanjk(), STK::GammaBase< Derived >::meank(), STK::GammaBase< Derived >::scale(), STK::GammaBase< Derived >::shape(), STK::GammaBase< Derived >::variancejk(), and STK::GammaBase< Derived >::variancek().