mixmod  3.2.0
Mixture models for clustering and classification
 All Classes Namespaces Files Functions Variables Enumerations Friends
BinaryEkjhParameter.h
1 /***************************************************************************
2  SRC/mixmod/Kernel/Parameter/BinaryEkjhParameter.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 XEMBinaryEkjhParameter_H
26 #define XEMBinaryEkjhParameter_H
27 
28 #include "mixmod/Kernel/Parameter/BinaryParameter.h"
29 
30 namespace XEM {
31 
36 
37 public:
38 
41 
43  // called by XEMModel
44  BinaryEkjhParameter(Model * iModel, ModelType * iModelType, int64_t * tabNbModality);
45 
47  // called by XEMStrategyType if USER partition
48  BinaryEkjhParameter(int64_t iNbCluster, int64_t iPbDimension, ModelType * iModelType, int64_t * tabNbModality, std::string & iFileName);
49 
52  int64_t iNbCluster,
53  int64_t iPbDimension,
54  ModelType * iModelType,
55  int64_t * tabNbModality,
56  double * proportions,
57  double ** centers,
58  double *** scatters);
59 
61  BinaryEkjhParameter(const BinaryEkjhParameter * iParameter);
62 
65 
67  virtual bool operator ==(const BinaryEkjhParameter & param) const;
68 
70  virtual void reset();
71 
73  Parameter * clone() const;
74 
76  double *** getScatter() const;
77 
79  int64_t getFreeParameter() const;
80 
81  double getPdf(int64_t iSample, int64_t kCluster) const;
82 
83  long double getLogPdf(int64_t iSample, int64_t kCluster) const;
84 
88  double getPdf(Sample * x, int64_t kCluster) const;
89 
91  double getLogLikelihoodOne() const;
92 
94  void computeScatter();
95 
97  void computeRandomScatter();
98 
100  void recopyScatter(Parameter * iParam);
101 
103  void createScatter(double *** scatter);
104 
106  void editScatter(int64_t k);
107 
109  void editScatter(std::ofstream & oFile, int64_t k, bool text = false);
110 
111  // Read Scatter in input file
112  void inputScatter(std::ifstream & fi);
113 
114  // Read Scatter in input container
115  void inputScatter(double *** scatters);
116 
117  double *** scatterToArray() const;
118 
119 private:
120 
122  double *** _scatter;
123 };
124 
125 inline double *** BinaryEkjhParameter::getScatter() const {
126  return _scatter;
127 }
128 
129 }
130 
131 #endif
double getPdf(int64_t iSample, int64_t kCluster) const
Compute probability density.
Definition: BinaryEkjhParameter.cpp:206
BinaryEkjhParameter()
Default constructor.
Definition: BinaryEkjhParameter.cpp:36
Parameter * clone() const
clone
Definition: BinaryEkjhParameter.cpp:137
Base class for ModelType(s)
Definition: ModelType.h:37
void createScatter(double ***scatter)
create Scatter from "Binary Parameter Ekjh"
Definition: BinaryEkjhParameter.cpp:422
double getLogLikelihoodOne() const
getlogLikelihoodOne (one cluster)
Definition: BinaryEkjhParameter.cpp:277
void computeScatter()
Compute scatter(s)
Definition: BinaryEkjhParameter.cpp:343
double *** getScatter() const
selector : return scatter value
Definition: BinaryEkjhParameter.h:125
Base class for XEMBinaryParameter(s)
Definition: BinaryParameter.h:41
void recopyScatter(Parameter *iParam)
recopy scatter from param (used for init : USER)
Definition: BinaryEkjhParameter.cpp:404
void computeRandomScatter()
Compute random scatter(s)
Definition: BinaryEkjhParameter.cpp:384
Definition: BinaryEkjhParameter.h:35
Definition: Model.h:50
~BinaryEkjhParameter()
Destructor.
Definition: BinaryEkjhParameter.cpp:145
void editScatter(int64_t k)
editScatter (for debug)
Definition: BinaryEkjhParameter.cpp:436
int64_t getFreeParameter() const
getFreeParameter
Definition: BinaryEkjhParameter.cpp:191
Base class for Sample.
Definition: Sample.h:41
virtual bool operator==(const BinaryEkjhParameter &param) const
Comparison operator.
Definition: BinaryEkjhParameter.cpp:161
long double getLogPdf(int64_t iSample, int64_t kCluster) const
Compute log probability density.
Definition: BinaryEkjhParameter.cpp:229
Base class for XEMParameter(s)
Definition: Parameter.h:45
virtual void reset()
reset to default values
Definition: BinaryEkjhParameter.cpp:176