STK++ 0.9.13
STK_IMixtureComposer.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: 16 oct. 2012
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_IMIXTURECOMPOSER_H
37#define STK_IMIXTURECOMPOSER_H
38
40
41namespace STK
42{
43
86{
87 protected:
96
97 public:
99 virtual ~IMixtureComposer();
100
102 inline Clust::modelState state() const { return state_;}
103
106
107 // pure virtual
109 virtual IMixtureComposer* create() const = 0;
111 virtual IMixtureComposer* clone() const = 0;
113 virtual void randomInit() = 0;
117 virtual void paramUpdateStep() = 0;
118
119 // virtual with default implementation
123 virtual int cStep();
127 virtual int sStep();
132 virtual Real eStep();
134 virtual void mapStep();
138 virtual void finalizeStep();
142 virtual void pStep();
148 virtual void initializeStep();
149
150 // not virtual
156 void randomClassInit();
161 void randomFuzzyInit();
162
163 protected:
167 void sStep(int i);
171 void cStep(int i);
176 Real eStep(int i);
178 void mapStep(int i);
179
180 // virtual To be re-implemented if some labels or probabilities are known
183 virtual void initializeMixtureParameters();
185 virtual int randomTik();
187 virtual int randomZi();
188
189 private:
193#ifndef _OPENMP
195#endif
196};
197
198} // namespace STK
199
200#endif /* STK_IMIXTURECOMPOSER_H */
201
In this file we define the abstract base class for mixture statistical models.
Base class for Mixture (composed) model.
virtual ~IMixtureComposer()
destructor
virtual int cStep()
Replace tik by zik.
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
void randomFuzzyInit()
Initialize randomly the posterior probabilities tik of the model, then compute the zi values with map...
virtual void pStep()
Compute proportions using the ML estimates, default implementation.
virtual IMixtureComposer * clone() const =0
clone pattern
virtual IMixtureComposer * create() const =0
create pattern
virtual Real eStep()
compute the zi, the lnLikelihood of the current estimates and the next value of the tik.
CPointX lnComp_
Auxiliary array used in the eStep.
virtual int randomZi()
generate random zi_
Clust::modelState state_
state of the model
virtual void initializeMixtureParameters()
Create the mixture model parameters pk_ and tik_.
virtual void mapStep()
Compute zi using the Map estimate.
Clust::modelState state() const
void randomClassInit()
Initialize randomly the labels zi of the model.
virtual int sStep()
Simulate zi accordingly to tik and replace tik by zik by calling cStep().
virtual int randomTik()
generate random tik_
virtual void randomInit()=0
initialize randomly the parameters of the components of the model
virtual void paramUpdateStep()=0
Compute the proportions and the model parameters given the current tik mixture parameters.
virtual void finalizeStep()
Finalize the estimation of the model.
Interface base class for Mixture (composed) model.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
modelState
Give the state of the model.
double Real
STK fundamental type of Real values.
The namespace STK is the main domain space of the Statistical ToolKit project.