mixmod  3.2.0
Mixture models for clustering and classification
 All Classes Namespaces Files Functions Variables Enumerations Friends
BinaryEParameter.h
1 /***************************************************************************
2  SRC/mixmod/Kernel/Parameter/BinaryEParameter.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 XEMBINARYEPARAMETER_H
26 #define XEMBINARYEPARAMETER_H
27 
28 #include "mixmod/Kernel/Parameter/BinaryParameter.h"
29 
30 namespace XEM {
31 
36 
37 public:
38 
41 
43  // called by XEMModel
44  BinaryEParameter(Model * iModel, ModelType * iModelType, int64_t * tabNbModality);
45 
47  BinaryEParameter(const BinaryEParameter * iParameter);
48 
51 
53  virtual bool operator ==(const BinaryEParameter & param) const;
54 
56  virtual void reset();
57 
59  Parameter * clone() const;
60 
62  double getScatter() const;
63 
65  int64_t getFreeParameter() const;
66 
67  double getPdf(int64_t iSample, int64_t kCluster) const;
68 
69  long double getLogPdf(int64_t iSample, int64_t kCluster) const;
70 
74  double getPdf(Sample * x, int64_t kCluster) const;
75 
77  double getLogLikelihoodOne() const;
78 
80  void computeScatter();
81 
83  void computeRandomScatter();
84 
86  void recopyScatter(Parameter * iParam);
87 
89  void createScatter(double *** scatter);
90 
92  void editScatter(int64_t k);
93 
95  void editScatter(std::ofstream & oFile, int64_t k, bool text = false);
96 
97  // Read Scatter in input file
98  void inputScatter(std::ifstream & fi);
99  void inputScatter(double *** scatters);
100 
101  double *** scatterToArray() const;
102 
103 private:
104 
106  double _scatter;
107 };
108 
109 inline double BinaryEParameter::getScatter() const {
110  return _scatter;
111 }
112 
113 }
114 
115 #endif
void computeScatter()
Compute scatter(s)
Definition: BinaryEParameter.cpp:209
void editScatter(int64_t k)
editScatter (for debug)
Definition: BinaryEParameter.cpp:297
Base class for ModelType(s)
Definition: ModelType.h:37
int64_t getFreeParameter() const
getFreeParameter
Definition: BinaryEParameter.cpp:93
virtual void reset()
reset to default values
Definition: BinaryEParameter.cpp:85
Parameter * clone() const
clone
Definition: BinaryEParameter.cpp:62
Base class for XEMBinaryParameter(s)
Definition: BinaryParameter.h:41
virtual bool operator==(const BinaryEParameter &param) const
Comparison operator.
Definition: BinaryEParameter.cpp:76
~BinaryEParameter()
Destructor.
Definition: BinaryEParameter.cpp:70
double getScatter() const
selector : return scatter value
Definition: BinaryEParameter.h:109
BinaryEParameter()
Default constructor.
Definition: BinaryEParameter.cpp:36
Definition: Model.h:50
void recopyScatter(Parameter *iParam)
recopy scatter from param (used for init : USER)
Definition: BinaryEParameter.cpp:270
double getPdf(int64_t iSample, int64_t kCluster) const
Compute probability density.
Definition: BinaryEParameter.cpp:104
Base class for Sample.
Definition: Sample.h:41
long double getLogPdf(int64_t iSample, int64_t kCluster) const
Compute log probability density.
Definition: BinaryEParameter.cpp:126
void computeRandomScatter()
Compute random scatter(s)
Definition: BinaryEParameter.cpp:254
void createScatter(double ***scatter)
create Scatter from "Binary Parameter Ekjh"
Definition: BinaryEParameter.cpp:282
Definition: BinaryEParameter.h:35
Base class for XEMParameter(s)
Definition: Parameter.h:45
double getLogLikelihoodOne() const
getlogLikelihoodOne (one cluster)
Definition: BinaryEParameter.cpp:171