47 , nbCluster_(nbCluster)
48 , pk_(nbCluster, 1./nbCluster)
49 , tik_(nbSample, nbCluster, 1./nbCluster)
50 , tk_(nbCluster,
Real(nbSample)/nbCluster)
58 , nbCluster_(
model.nbCluster_)
61 , v_mixtures_(
model.v_mixtures_.size())
87 for (
int k =
pk_.begin(); k<
pk_.end(); ++k)
98 for (
int i =
tik().beginRows();
i<
tik().endRows(); ++
i)
107 for (
int j =
tik().beginCols();
j<
tik().endCols(); ++
j)
120 {
if ((*it)->idData() == idData)
return (*
it);}
126#ifdef STK_MIXTURE_VERBOSE
127 stk_cout <<
_T(
"In IMixtureStatModel::registerMixture, registering mixture: ")
144 if ((*it)->idData() == idData)
166 {
sum+= (*it)->nbFreeParameter();}
178 {
sum+= (*it)->nbMissingValues();}
190#ifdef STK_MIXTURE_VERBOSE
191 stk_cout <<
_T(
"Entering IMixtureStatModel::initializeStep\n");
198 { (*it)->initializeStep();}
In this file we define the abstract base class for mixture statistical models.
#define STKRUNTIME_ERROR_NO_ARG(Where, Error)
#define stk_cout
Standard stk output stream.
#define _T(x)
Let x unmodified.
hidden::CSlice< Derived, sizeRows_, 1 >::Result col(int j) const
implement the col operator using a reference on the column of the allocator
Interface base class for Mixture (composed) model.
CArrayXX tik_
The tik probabilities.
int computeNbMissingValues() const
compute the missing values of the model.
virtual ~IMixtureStatModel()
destructor
void registerMixture(IMixture *p_mixture)
register a mixture to the composer.
Real computeLikelihood(int i) const
virtual Real lnComponentProbability(int i, int k) const =0
Real computeLnLikelihood() const
virtual void initializeStep()
Initialize the model before at its first use.
IMixture * getMixture(String const &idData) const
Utility lookup function allowing to find a Mixture from its idData.
void releaseMixture(String const &idData)
release a mixture from the composer.
CArrayXX const & tik() const
int computeNbFreeParameters() const
compute the number of free parameters of the model.
std::vector< IMixture * >::const_iterator ConstMixtIterator
std::vector< IMixture * > v_mixtures_
vector of pointers to the mixtures components
IMixtureStatModel(int nbSample, int nbCluster)
Constructor.
CPointX pk_
The proportions of each mixtures.
std::vector< IMixture * >::iterator MixtIterator
int nbCluster_
number of cluster.
Interface base class for all the mixture models that will be processed by the composer.
int nbFreeParameter() const
Interface base class for all Statistical Models.
int nbFreeParameter() const
void setNbFreeParameter(int const &nbFreeParameter)
set the number of free parameters of the model
void setLnLikelihood(Real const &lnLikelihood)
set the log-likelihood of the model
Real lnLikelihood() const
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
Arrays::SumOp< Lhs, Rhs >::result_type sum(Lhs const &lhs, Rhs const &rhs)
convenience function for summing two arrays
std::basic_string< Char > String
STK fundamental type of a String.
const int baseIdx
base index of the containers created in STK++.
double Real
STK fundamental type of Real values.
The namespace STK is the main domain space of the Statistical ToolKit project.
Arithmetic properties of STK fundamental types.