STK++ 0.9.13
STK_HDMatrixGaussianParameters.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.org (see copyright for ...)
23*/
24
25/*
26 * Project: stkpp::Clustering
27 * created on: Oct 24, 2013
28 * Author: Serge Iovleff
29 **/
30
36#ifndef STK_HDMATRIXGAUSSIANPARAMETERS_H
37#define STK_HDMATRIXGAUSSIANPARAMETERS_H
38
44
46
47namespace STK
48{
49
53template<class Array_>
55{
58
65
68
75
78
81
88
95
100 : meank_(nbCluster)
101 , rowQk_(nbCluster), rowAjk_(nbCluster)
102 , rowBk_(nbCluster), rowDk_(nbCluster)
103 , colQk_(nbCluster), colAjk_(nbCluster)
104 , colBk_(nbCluster), colDk_(nbCluster)
105 , statMeank_(nbCluster)
106 , statRowQk_(nbCluster), statRowAjk_(nbCluster)
107 , statRowBk_(nbCluster)
108 , statColQk_(nbCluster), statColAjk_(nbCluster)
109 , statColBk_(nbCluster)
110 {}
115 : meank_(param.meank_)
116 , rowQk_(param.rowQk_), rowAjk_(param.rowAjk_)
117 , rowBk_(param.rowBk_), rowDk_(param.rowDk_)
118 , colQk_(param.colQk_), colAjk_(param.colAjk_)
119 , colBk_(param.colBk_), colDk_(param.colDk_)
120 , statMeank_(param.statMeank_)
122 , statRowBk_(param.statRowBk_)
124 , statColBk_(param.statColBk_)
125 {}
132 {
133 meank_ = param.meank_;
134 rowQk_ = param.rowQk_; rowAjk_ = param.rowAjk_;
135 rowBk_ = param.rowBk_; rowDk_ = param.rowDk_;
136 colQk_ = param.colQk_; colAjk_ = param.colAjk_;
137 colBk_ = param.colBk_; colDk_ = param.colDk_;
138 statMeank_ = param.statMeank_;
140 statRowBk_ = param.statRowBk_;
142 statColBk_ = param.statColBk_;
143 }
144
148 void resize(Range const& rangeRows, Range const& rangeCols);
149
152 {
153 for(int k=statMeank_.begin(); k<statMeank_.end(); ++k)
154 {
155 statMeank_[k].update(meank_[k]);
156 statRowQk_[k].update(rowQk_[k]);
158 statRowBk_[k].update(rowBk_[k]);
159 statColQk_[k].update(colQk_[k]);
161 statColBk_[k].update(colBk_[k]);
162 }
163 }
166 {
167 for(int k=statMeank_.begin(); k<statMeank_.end(); ++k)
168 {
169 meank_[k] = statMeank_[k].mean();
170 rowQk_[k] = statRowQk_[k].mean();
171 rowAjk_[k] = statRowAjk_[k].mean();
172 rowBk_[k] = statRowBk_[k].mean();
173 colQk_[k] = statColQk_[k].mean();
174 colAjk_[k] = statColAjk_[k].mean();
175 colBk_[k] = statColBk_[k].mean();
176 }
178 }
181 {
182 for(int k=statMeank_.begin(); k<statMeank_.end(); ++k)
183 {
184 statMeank_[k].release();
185 statRowQk_[k].release();
186 statRowAjk_[k].release();
187 statRowBk_[k].release();
188 statColQk_[k].release();
189 statColAjk_[k].release();
190 statColBk_[k].release();
191 }
192 }
198 template<class Array>
201// {
202// for(int k=mean_.begin(), kp= params.beginRows(); k<mean_.end(); ++k, kp+=2)
203// {
204// mean_[k] = params.row(kp);
205// sigma_[k] = params.row(kp+1);
206// }
207// }
208};
209
210} // namespace STK
211
212#endif /* STK_HDGAUSSIANPARAMETERS_H */
In this file we define and implement the final class Array1D.
In this file we implement the final class CArrayPoint.
In this file we implement the final class CArraySquare.
In this file we implement the final class CArrayVector.
In this file we implement the final class CArray.
This file contain the definition and implementation of the Online classes.
virtual void update()
update the runner.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
Index sub-vector region: Specialization when the size is unknown.
Definition STK_Range.h:265
The namespace STK is the main domain space of the Statistical ToolKit project.
structure storing the parameters of the HD matrix valued mixture
CVectorXi colDk_
array of size nbCluster with dimension of low dimensional space for columns
void resize(Range const &rangeRows, Range const &rangeCols)
resize and initialize the set of parameter.
void releaseStatistics()
Release the computed statistics.
HDMatrixModelParameters(int nbCluster)
default constructor
Array1D< Stat::Online< CSquareX, Real > > statColQk_
Array of the rotation matrix statistics for rows.
Array1D< Stat::Online< Real, Real > > statColBk_
Array of the standard deviation statistics.
Array1D< CVectorX > rowAjk_
array of size nbCluster with inertia in low dimensional space for rows
Array1D< Array_ > meank_
array of size nbCluster with for each cluster the mean matrix
HDMatrixModelParameters & operator=(HDMatrixModelParameters const &param)
copy operator.
Array1D< Real > rowBk_
array of size nbCluster with remaining variance noise for rows
void setParameters(ExprBase< Array > const &params)
Set the parameters of the mixture model.
Array1D< Stat::Online< CVectorX, Real > > statRowAjk_
Array of size nbCluster of the rotation matrix statistics for rows.
HDMatrixModelParameters(HDMatrixModelParameters const &param)
copy constructor.
Array1D< Real > colBk_
array of size nbCluster with variance noise for columns
Array1D< Stat::Online< CVectorX, Real > > statColAjk_
Array of the standard deviation statistics.
void setStatistics()
Set the computed statistics.
Array1D< CVectorX > colAjk_
array of size nbCluster with inertia in low dimensional space for columns
CVectorXi rowDk_
array of size nbCluster with dimension of low dimensional space for rows
void updateStatistics()
update statistics of the parameters.
Array1D< Stat::Online< Array_, Real > > statMeank_
Array of size nbCluster of the mean statistics.
Array1D< CSquareX > rowQk_
array of size nbCluster with the rotation matrix for rows
Array1D< Stat::Online< CSquareX, Real > > statRowQk_
Array of size nbCluster of the rotation matrix statistics for rows.
Array1D< Stat::Online< Real, Real > > statRowBk_
Array of size nbCluster with the variance noise statistics for rows.
Array1D< CSquareX > colQk_
array of size nbCluster with the rotation matrix for columns