STK++ 0.9.13
STK_MixtureComposer.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------*/
2/* Copyright (C) 2004-2016 Serge Iovleff
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to the
16 Free Software Foundation, Inc.,
17 59 Temple Place,
18 Suite 330,
19 Boston, MA 02111-1307
20 USA
21
22 Contact : S..._Dot_I..._At_stkpp_Dot_org (see copyright for ...)
23*/
24
25/*
26 * Project: stkpp::Clustering
27 * created on: 14 nov. 2013
28 * Author: iovleff, S..._Dot_I..._At_stkpp_Dot_org (see copyright for ...)
29 * Originally created by Parmeet Bhatia <b..._DOT_p..._AT_gmail_Dot_com>
30 **/
31
36#ifndef STK_MIXTURECOMPOSER_H
37#define STK_MIXTURECOMPOSER_H
38
39#include <list>
40
42
43namespace STK
44{
45class IMixture;
70{
71 public:
72 typedef std::vector<IMixture*>::const_iterator ConstMixtIterator;
73 typedef std::vector<IMixture*>::iterator MixtIterator;
83 virtual ~MixtureComposer();
84
86 virtual MixtureComposer* create() const;
88 virtual MixtureComposer* clone() const;
92 virtual Real lnComponentProbability(int i, int k) const;
94 virtual void writeParameters(ostream& os) const;
95
97 virtual void randomInit();
101 virtual void paramUpdateStep();
104 virtual void imputationStep();
108 virtual void samplingStep();
113 virtual void storeIntermediateResults(int iteration);
118 virtual void releaseIntermediateResults();
121 virtual void setParametersStep();
125 virtual void finalizeStep();
126
127 protected:
133 void createComposer( std::vector<IMixture*> const& v_mixtures_);
134
139};
140
144{
145 public:
155 inline virtual ~MixtureComposerFixedProp() {}
157 virtual MixtureComposerFixedProp* create() const;
159 virtual MixtureComposerFixedProp* clone() const;
162 virtual void pStep();
163};
164
165
166} /* namespace STK */
167
168#endif /* STK_MIXTURECOMPOSER_H */
In this file we define the abstract base class for mixture models.
Base class for Mixture (composed) model.
std::vector< IMixture * > v_mixtures_
vector of pointers to the mixtures components
specialization of the composer for the fixed proportion case.
virtual ~MixtureComposerFixedProp()
destructor
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.
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...
double Real
STK fundamental type of Real values.
std::basic_ostream< Char > ostream
ostream for Char
Definition STK_Stream.h:57
The namespace STK is the main domain space of the Statistical ToolKit project.