mixmod  3.2.0
Mixture models for clustering and classification
 All Classes Namespaces Files Functions Variables Enumerations Friends
GaussianEDDAParameter.h
1 /***************************************************************************
2  SRC/mixmod/Kernel/Parameter/GaussianEDDAParameter.h description
3  copyright : (C) MIXMOD Team - 2001-2016
4  email : contact@mixmod.org
5  ***************************************************************************/
6 
7 /***************************************************************************
8  This file is part of MIXMOD
9 
10  MIXMOD is free software: you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  MIXMOD is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with MIXMOD. If not, see <http://www.gnu.org/licenses/>.
22 
23  All informations available on : http://www.mixmod.org
24 ***************************************************************************/
25 #ifndef XEMGaussianEDDAParameter_H
26 #define XEMGaussianEDDAParameter_H
27 
28 #include "mixmod/Kernel/Parameter/GaussianParameter.h"
29 
30 namespace XEM {
31 
32 // pre-declaration
33 class Matrix;
34 
40 
41 public:
42 
45 
47  // called by XEMModel
48  GaussianEDDAParameter(Model * iModel, ModelType * iModelType);
49 
51  // called if USER initialisation
52  GaussianEDDAParameter(int64_t iNbCluster, int64_t iPbDimension, ModelType * iModelType);
53 
55  GaussianEDDAParameter(const GaussianEDDAParameter * iParameter);
56 
58  virtual ~GaussianEDDAParameter();
59 
61  virtual bool operator ==(const GaussianEDDAParameter & param) const;
62 
64  virtual void reset();
65 
69  double * getTabInvSqrtDetSigma() const;
70 
74  Matrix ** getTabInvSigma() const;
75 
79  Matrix ** getTabSigma() const;
80 
83  double getPdf(int64_t iSample, int64_t kCluster) const;
84 
87  void getAllPdf(double ** tabFik, double * tabProportion) const;
88 
91  double getPdf(Sample * x, int64_t kCluster) const;
92 
93  void updateTabInvSigmaAndDet();
94 
95  void computeTikUnderflow(int64_t i, double ** tabTik);
96 
97  void edit();
98 
99  void edit(std::ofstream & oFile, bool text = false);
100 
101  void recopy(Parameter * otherParameter);
102 
103  virtual int64_t getFreeParameter() const = 0;
104  virtual void computeTabSigma() = 0;
105 
106  void updateForCV(Model * originalModel, CVBlock & CVBlock);
107 
108  virtual Parameter* clone() const = 0;
109  void MStep();
110  void MAPStep();
111  virtual void input(std::ifstream & fi);
112  virtual void input(
113  double * proportions,
114  double ** means,
115  double *** variances);
116 
117 
118  //init
119  //----
120 
122  virtual void initUSER(Parameter * iParam);
123 
125  void initForInitRANDOM();
126 
131  void initForInitUSER_PARTITION(int64_t & nbInitializedCluster, bool * tabNotInitializedCluster, Partition * initPartition);
132 
133 protected:
134 
136  Matrix ** _tabInvSigma;
137 
139  Matrix ** _tabSigma;
140 
142  double * _tabInvSqrtDetSigma;
143 
144 
145 };
146 
148  return _tabInvSqrtDetSigma;
149 }
150 
152  return _tabInvSigma;
153 }
154 
156  return _tabSigma;
157 }
158 
159 }
160 
161 #endif
Base class for ModelType(s)
Definition: ModelType.h:37
virtual void initUSER(Parameter *iParam)
User initialisation of the parameters of the model.
Definition: GaussianEDDAParameter.cpp:288
void MStep()
Maximization step method.
Definition: GaussianEDDAParameter.cpp:375
XEMCVBlock.
Definition: Util.h:393
double * getTabInvSqrtDetSigma() const
Selector.
Definition: GaussianEDDAParameter.h:147
virtual bool operator==(const GaussianEDDAParameter &param) const
Comparison operator.
Definition: GaussianEDDAParameter.cpp:117
double getPdf(int64_t iSample, int64_t kCluster) const
Definition: GaussianEDDAParameter.cpp:215
virtual void input(std::ifstream &fi)
input
Definition: GaussianEDDAParameter.cpp:316
Base class for Partition(s)
Definition: Partition.h:39
Definition: Model.h:50
Derived class of XEMGaussianParameter for EDDA Gaussian Model(s)
Definition: GaussianEDDAParameter.h:39
Base class for XEMGaussianParameter(s)
Definition: GaussianParameter.h:42
virtual Parameter * clone() const =0
Selector.
void getAllPdf(double **tabFik, double *tabProportion) const
Definition: GaussianEDDAParameter.cpp:137
GaussianEDDAParameter()
Default constructor.
Definition: GaussianEDDAParameter.cpp:45
void initForInitUSER_PARTITION(int64_t &nbInitializedCluster, bool *tabNotInitializedCluster, Partition *initPartition)
Definition: GaussianEDDAParameter.cpp:270
Base class for Sample.
Definition: Sample.h:41
virtual ~GaussianEDDAParameter()
Destructor.
Definition: GaussianEDDAParameter.cpp:97
void computeTikUnderflow(int64_t i, double **tabTik)
compute Tik for xi (i=0 -> _nbSample-1) when underflow
Definition: GaussianEDDAParameter.cpp:402
virtual int64_t getFreeParameter() const =0
Selector.
void recopy(Parameter *otherParameter)
recopie sans faire construction / destruction
Definition: GaussianEDDAParameter.cpp:526
virtual void reset()
reset to default values
Definition: GaussianEDDAParameter.cpp:128
void initForInitRANDOM()
initialize attributes before an initRANDOM
Definition: GaussianEDDAParameter.cpp:383
Base class for Matrix.
Definition: Matrix.h:41
Base class for XEMParameter(s)
Definition: Parameter.h:45
Matrix ** getTabSigma() const
Selector.
Definition: GaussianEDDAParameter.h:155
Matrix ** getTabInvSigma() const
Selector.
Definition: GaussianEDDAParameter.h:151