47 , meanlnLikelihood_(0.)
55 , meanlnLikelihood_(
composer.meanlnLikelihood_)
77 {
sum += (*it)->lnComponentProbability(
i,k);}
83#ifdef STK_MIXTURE_VERY_VERBOSE
84 stk_cout <<
_T(
"Entering MixtureComposer::paramUpdateStep()\n");
87 { (*it)->paramUpdateStep();}
88#ifdef STK_MIXTURE_VERY_VERBOSE
89 stk_cout <<
_T(
"MixtureComposer::paramUpdateStep() done\n");
101 os <<
_T(
"proportions = ") <<
pk();
105 os <<
_T(
"\nParameters of the mixture: ") << (*it)->idData() <<
_T(
"\n");
106 (*it)->writeParameters(
os);
112#ifdef STK_MIXTURE_VERBOSE
113 stk_cout <<
_T(
"Entering MixtureComposer::RandomInit()\n");
123 { (*it)->randomInit();}
128#ifdef STK_MIXTURE_VERBOSE
129 stk_cout <<
_T(
"MixtureComposer::RandomInit() done\n");
137 { (*it)->imputationStep();}
145#ifdef STK_MIXTURE_VERY_VERBOSE
146 stk_cout <<
_T(
"Entering MixtureComposer::samplingStep()\n");
150 { (*it)->samplingStep();}
151#ifdef STK_MIXTURE_VERY_VERBOSE
152 stk_cout <<
_T(
"MixtureComposer::samplingStep() done\n");
160 { (*it)->storeIntermediateResults(
iteration);}
167 { (*it)->releaseIntermediateResults();}
175 { (*it)->setParametersStep();}
This file define methods for displaying Arrays and Expressions.
In this file we define the class MixtureComposer.
#define stk_cout
Standard stk output stream.
#define _T(x)
Let x unmodified.
Base class for Mixture (composed) model.
virtual void initializeStep()
Initialize the model before its first use.
void setState(Clust::modelState state)
set the state of the model : should be used by any strategy
virtual Real eStep()
compute the zi, the lnLikelihood of the current estimates and the next value of the tik.
virtual void mapStep()
Compute zi using the Map estimate.
Clust::modelState state() const
virtual int randomTik()
generate random tik_
int computeNbMissingValues() const
compute the missing values of the model.
CPointX const & pk() const
std::vector< IMixture * > const & v_mixtures() const
std::vector< IMixture * > v_mixtures_
vector of pointers to the mixtures components
virtual bool finalizeStep()
perform any computation needed after the call of the regression method.
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
specialization of the composer for the fixed proportion case.
MixtureComposerFixedProp(int nbSample, int nbCluster)
Constructor.
virtual MixtureComposerFixedProp * clone() const
Create a clone of the current model, with mixtures parameters preserved.
virtual void pStep()
overloading of the computePropotions() method.
virtual MixtureComposerFixedProp * create() const
Create a composer, but reinitialize the mixtures parameters.
Main class for handling composed mixture models.
Real meanlnLikelihood_
averaged lnLikelihood values.
virtual MixtureComposer * create() const
Create a composer, but reinitialize the mixtures parameters.
void createComposer(std::vector< IMixture * > const &v_mixtures_)
Create the composer using existing data handler and mixtures.
virtual MixtureComposer * clone() const
Create a clone of the current model, with mixtures parameters preserved.
virtual ~MixtureComposer()
The registered mixtures will be deleted there.
virtual void paramUpdateStep()
Compute the proportions and the model parameters given the current tik mixture parameters.
std::vector< IMixture * >::iterator MixtIterator
virtual void releaseIntermediateResults()
This step can be used to signal to the mixtures that they must release the stored results.
MixtureComposer(int nbSample, int nbCluster)
Constructor.
virtual void samplingStep()
Simulation of all the latent variables and/or missing data excluding class labels.
virtual void storeIntermediateResults(int iteration)
This step can be used to signal to the mixtures that they must store results.
virtual void finalizeStep()
This step can be used by developer to finalize any thing.
virtual void randomInit()
initialize randomly the parameters of the components of the model
virtual void writeParameters(ostream &os) const
write the parameters of the model in the stream os.
virtual Real lnComponentProbability(int i, int k) const
virtual void setParametersStep()
Utility method allowing to signal to a mixture to set its parameters.
std::vector< IMixture * >::const_iterator ConstMixtIterator
virtual void imputationStep()
Impute the missing values.
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
@ modelInitialized_
the model is initialized and its parameters are initialized to default values
@ modelParamInitialized_
The parameters of the model have been initialized.
double Real
STK fundamental type of Real values.
The namespace STK is the main domain space of the Statistical ToolKit project.