mixmod  3.2.0
Mixture models for clustering and classification
 All Classes Namespaces Files Functions Variables Enumerations Friends
BinaryEkjParameter.h
1 /***************************************************************************
2  SRC/mixmod/Kernel/Parameter/BinaryEkjParameter.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 XEMBinaryEkjParameter_H
26 #define XEMBinaryEkjParameter_H
27 
28 #include "mixmod/Kernel/Parameter/BinaryParameter.h"
29 
30 namespace XEM {
31 
36 
37 public:
40 
42  // called by XEMModel
43  BinaryEkjParameter(Model * iModel, ModelType * iModelType, int64_t * tabNbModality);
44 
46  BinaryEkjParameter(const BinaryEkjParameter * iParameter);
47 
50 
52  virtual bool operator ==(const BinaryEkjParameter & param) const;
53 
55  virtual void reset();
56 
58  Parameter * clone() const;
59 
61  double ** getScatter() const;
62 
64  int64_t getFreeParameter() const;
65 
66  double getPdf(int64_t iSample, int64_t kCluster) const;
67 
68  long double getLogPdf(int64_t iSample, int64_t kCluster) const;
69 
73  double getPdf(Sample * x, int64_t kCluster) const;
74 
76  double getLogLikelihoodOne() const;
77 
79  void computeScatter();
80 
82  void computeRandomScatter();
83 
85  void recopyScatter(Parameter * iParam);
86 
88  void createScatter(double *** scatter);
89 
91  void editScatter(int64_t k);
92 
94  void editScatter(std::ofstream & oFile, int64_t k, bool text = false);
95 
96  // Read Scatter in input file
97  void inputScatter(std::ifstream & fi);
98  void inputScatter(double *** scatters);
99 
100  double *** scatterToArray() const;
101 
102 private:
103 
105  double ** _scatter;
106 };
107 
108 inline double ** BinaryEkjParameter::getScatter() const {
109  return _scatter;
110 }
111 
112 }
113 
114 #endif
Base class for ModelType(s)
Definition: ModelType.h:37
long double getLogPdf(int64_t iSample, int64_t kCluster) const
Compute log probability density.
Definition: BinaryEkjParameter.cpp:159
int64_t getFreeParameter() const
getFreeParameter
Definition: BinaryEkjParameter.cpp:124
double ** getScatter() const
selector : return scatter value
Definition: BinaryEkjParameter.h:108
BinaryEkjParameter()
Default constructor.
Definition: BinaryEkjParameter.cpp:36
Base class for XEMBinaryParameter(s)
Definition: BinaryParameter.h:41
void computeScatter()
Compute scatter(s)
Definition: BinaryEkjParameter.cpp:245
void recopyScatter(Parameter *iParam)
recopy scatter from param (used for init : USER)
Definition: BinaryEkjParameter.cpp:300
~BinaryEkjParameter()
Destructor.
Definition: BinaryEkjParameter.cpp:85
double getLogLikelihoodOne() const
getlogLikelihoodOne (one cluster)
Definition: BinaryEkjParameter.cpp:206
Parameter * clone() const
clone
Definition: BinaryEkjParameter.cpp:77
Definition: Model.h:50
void computeRandomScatter()
Compute random scatter(s)
Definition: BinaryEkjParameter.cpp:287
void editScatter(int64_t k)
editScatter (for debug)
Definition: BinaryEkjParameter.cpp:328
virtual bool operator==(const BinaryEkjParameter &param) const
Comparison operator.
Definition: BinaryEkjParameter.cpp:98
Base class for Sample.
Definition: Sample.h:41
virtual void reset()
reset to default values
Definition: BinaryEkjParameter.cpp:111
double getPdf(int64_t iSample, int64_t kCluster) const
Compute probability density.
Definition: BinaryEkjParameter.cpp:135
Definition: BinaryEkjParameter.h:35
Base class for XEMParameter(s)
Definition: Parameter.h:45
void createScatter(double ***scatter)
create Scatter from "Binary Parameter Ekjh"
Definition: BinaryEkjParameter.cpp:315