35#ifndef STK_GAMMA_AK_BK_H
36#define STK_GAMMA_AK_BK_H
111 for (
int k= p_tik->beginCols(); k < p_tik->endCols(); ++k)
117#ifdef STK_MIXTURE_VERY_VERBOSE
118 stk_cout <<
_T(
" Gamma_ak_bk<Array>::randomInit done\n");
126 if (!this->
moments(p_tik)) {
return false;}
128 for (
int k= p_tik->beginCols(); k < p_tik->endCols(); ++k)
133 if ((x0 <=0.) || (
isNA(x0)))
return false;
139#ifdef STK_MIXTURE_DEBUG
140 stk_cout <<
"ML estimation failed in Gamma_ak_bjk::run( CArrayXX const* const& p_tik, CPointX const* const& p_tk) \n";
In this file we implement the base class for the gamma models.
In this file we implement the exponential law.
#define stk_cout
Standard stk output stream.
#define _T(x)
Let x unmodified.
Array const *const & p_data() const
Real meanjk(int j, int k)
bool moments(CArrayXX const *p_tik)
Real variancejk(int j, int k)
Gamma_ak_bk is a mixture model of the following form.
Gamma_ak_bk(int nbCluster)
default constructor
GammaBase< Gamma_ak_bk< Array > > Base
int computeNbFreeParameters() const
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) .
Gamma_ak_bk(Gamma_ak_bk const &model)
copy constructor
virtual Real rand() const
Generate a pseudo Exponential random variate.
Functor computing the derivative of the lnLikelihood of a gamma_ajk_bjk model.
Real findZero(IFunction< Function > const &f, Real const &x0, Real const &x1, Real tol)
find the zero of a function.
bool isNA(Type const &x)
utility method allowing to know if a value is a NA (Not Available) value
double Real
STK fundamental type of Real values.
The hidden namespace enclose the classes and methods which are used internally by the STK++ classes.
The namespace STK is the main domain space of the Statistical ToolKit project.
CArrayPoint< Real, UnknownSize, Arrays::by_col_ > CPointX
CArray< Real, UnknownSize, UnknownSize, Arrays::by_col_ > CArrayXX
PointX const & mean() const
static bool isFinite(Type const &x)
struct storing the parameters of the mixture.
ModelParameters< Clust::Gamma_ak_bk_ > Parameters
Type of the structure storing the parameters of a Gamma_ak_bk model.
Main class for the mixtures traits policy.