STK++ 0.9.13
STK::ModelParameters< Clust::Gaussian_sk_ > Struct Reference

Structure encapsulating the parameters of a STK::DiagGaussian_sk model. More...

#include <STK_DiagGaussianParameters.h>

Public Member Functions

 ModelParameters (int nbCluster)
 default constructor
 
 ModelParameters (ModelParameters const &param)
 copy constructor.
 
 ~ModelParameters ()
 destructor
 
ModelParametersoperator= (ModelParameters const &param)
 copy operator.
 
Real constmean (int k, int j) const
 
Real constsigma (int k, int j) const
 
void resize (Range const &range)
 resize and initialize the set of parameter.
 
void updateStatistics ()
 update statistics of the parameters.
 
void setStatistics ()
 Set the computed statistics.
 
void releaseStatistics ()
 Release the computed statistics.
 
template<class Array >
void setParameters (ExprBase< Array > const &params)
 Set the parameters of the mixture model.
 

Public Attributes

Array1D< CPointXmean_
 array of size nbCluster with the parameters mean of the variables
 
Array1D< Realsigma_
 standard deviation of the variables
 
Array1D< Stat::Online< CPointX, Real > > stat_mean_
 Array of the mean statistics.
 
Array1D< Stat::Online< Real, Real > > stat_sigma_
 Array of the standard deviation statistics.
 

Detailed Description

Structure encapsulating the parameters of a STK::DiagGaussian_sk model.

Definition at line 119 of file STK_DiagGaussianParameters.h.

Constructor & Destructor Documentation

◆ ModelParameters() [1/2]

STK::ModelParameters< Clust::Gaussian_sk_ >::ModelParameters ( int  nbCluster)

default constructor

Parameters
nbClusterthe number of class of the mixture

Definition at line 180 of file STK_DiagGaussianParameters.cpp.

181 : mean_(nbCluster), sigma_(nbCluster)
182 , stat_mean_(nbCluster), stat_sigma_(nbCluster)
183{}
Array1D< Real > sigma_
standard deviation of the variables
Array1D< CPointX > mean_
array of size nbCluster with the parameters mean of the variables
Array1D< Stat::Online< Real, Real > > stat_sigma_
Array of the standard deviation statistics.
Array1D< Stat::Online< CPointX, Real > > stat_mean_
Array of the mean statistics.

◆ ModelParameters() [2/2]

copy constructor.

Parameters
paramthe parameters to copy.

Definition at line 187 of file STK_DiagGaussianParameters.cpp.

188 : mean_(param.mean_), sigma_(param.sigma_)
189 , stat_mean_(param.stat_mean_), stat_sigma_(param.stat_sigma_)
190{}

◆ ~ModelParameters()

destructor

Definition at line 192 of file STK_DiagGaussianParameters.cpp.

192{}

Member Function Documentation

◆ mean()

Real const & STK::ModelParameters< Clust::Gaussian_sk_ >::mean ( int  k,
int  j 
) const
inline
Returns
the mean of the kth cluster and jth variable

Definition at line 146 of file STK_DiagGaussianParameters.h.

146{ return mean_[k][j];}

◆ operator=()

copy operator.

Parameters
paramthe parameters to copy.

Definition at line 196 of file STK_DiagGaussianParameters.cpp.

197{
198 mean_ = param.mean_;
199 sigma_ = param.sigma_;
200 stat_mean_ = param.stat_mean_;
201 stat_sigma_ = param.stat_sigma_;
202 return *this;
203}

◆ releaseStatistics()

void STK::ModelParameters< Clust::Gaussian_sk_ >::releaseStatistics ( )

Release the computed statistics.

Definition at line 236 of file STK_DiagGaussianParameters.cpp.

237{
238 for(int k=stat_mean_.begin(); k<stat_mean_.end(); ++k)
239 {
240 stat_mean_[k].release();
241 stat_sigma_[k].release();
242 }
243}

◆ resize()

resize and initialize the set of parameter.

Parameters
rangerange of the variables in the data set

Definition at line 205 of file STK_DiagGaussianParameters.cpp.

206{
207 for (int k = mean_.begin(); k< mean_.end(); ++k)
208 {
209 mean_[k].resize(range) =0;
210 sigma_[k] = 1.;
211 stat_mean_[k].resize(range);
212 stat_sigma_[k].release();
213 }
214}

◆ setParameters()

template<class Array >
void STK::ModelParameters< Clust::Gaussian_sk_ >::setParameters ( ExprBase< Array > const params)
inline

Set the parameters of the mixture model.

It is assumed that the array params store for each class the means and sd parameters on two consecutive rows. The number of column of params is the number of variables.

Definition at line 168 of file STK_DiagGaussianParameters.h.

169 {
170 for(int k=mean_.begin(), kp= params.beginRows(); k<mean_.end(); ++k, kp+=2)
171 {
172 mean_[k] = params.row(kp);
173 sigma_[k] = params.row(kp+1).mean();
174 }
175 }

◆ setStatistics()

Set the computed statistics.

Definition at line 225 of file STK_DiagGaussianParameters.cpp.

226{
227 for(int k=stat_mean_.begin(); k<stat_mean_.end(); ++k)
228 {
229 mean_[k] = stat_mean_[k].mean();
230 sigma_[k] = stat_sigma_[k].mean();
231 stat_mean_[k].release();
232 stat_sigma_[k].release();
233 }
234}

◆ sigma()

Real const & STK::ModelParameters< Clust::Gaussian_sk_ >::sigma ( int  k,
int  j 
) const
inline
Returns
the standard deviation of the kth cluster and jth variable

Definition at line 148 of file STK_DiagGaussianParameters.h.

148{ return sigma_[k];}

◆ updateStatistics()

void STK::ModelParameters< Clust::Gaussian_sk_ >::updateStatistics ( )

update statistics of the parameters.

Definition at line 216 of file STK_DiagGaussianParameters.cpp.

217{
218 for(int k=stat_mean_.begin(); k<stat_mean_.end(); ++k)
219 {
220 stat_mean_[k].update(mean_[k]);
222 }
223}
virtual void update()
update the runner.

Member Data Documentation

◆ mean_

array of size nbCluster with the parameters mean of the variables

Definition at line 122 of file STK_DiagGaussianParameters.h.

◆ sigma_

standard deviation of the variables

Definition at line 124 of file STK_DiagGaussianParameters.h.

◆ stat_mean_

Array of the mean statistics.

Definition at line 126 of file STK_DiagGaussianParameters.h.

◆ stat_sigma_

Array of the standard deviation statistics.

Definition at line 128 of file STK_DiagGaussianParameters.h.


The documentation for this struct was generated from the following files: