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

Structure encapsulating the parameters of a STK::DiagGaussian_sjk 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< CPointXsigma_
 standard deviation of the variables
 
Array1D< Stat::Online< CPointX, Real > > stat_mean_
 Array of the mean statistics.
 
Array1D< Stat::Online< CPointX, Real > > stat_sigma_
 Array of the standard deviation statistics.
 

Detailed Description

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

Definition at line 56 of file STK_DiagGaussianParameters.h.

Constructor & Destructor Documentation

◆ ModelParameters() [1/2]

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

default constructor

Parameters
nbClusterthe number of class of the mixture

Definition at line 43 of file STK_DiagGaussianParameters.cpp.

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

◆ ModelParameters() [2/2]

copy constructor.

Parameters
paramthe parameters to copy.

Definition at line 50 of file STK_DiagGaussianParameters.cpp.

51 : mean_(param.mean_), sigma_(param.sigma_)
52 , stat_mean_(param.stat_mean_), stat_sigma_(param.stat_sigma_)
53{}

◆ ~ModelParameters()

destructor

Definition at line 55 of file STK_DiagGaussianParameters.cpp.

55{}

Member Function Documentation

◆ mean()

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

Definition at line 83 of file STK_DiagGaussianParameters.h.

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

◆ operator=()

copy operator.

Parameters
paramthe parameters to copy.

Definition at line 59 of file STK_DiagGaussianParameters.cpp.

60{
61 mean_ = param.mean_;
62 sigma_ = param.sigma_;
63 stat_mean_ = param.stat_mean_;
64 stat_sigma_ = param.stat_sigma_;
65 return *this;
66}

◆ releaseStatistics()

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

Release the computed statistics.

Definition at line 101 of file STK_DiagGaussianParameters.cpp.

102{
103 for(int k=stat_mean_.begin(); k<stat_mean_.end(); ++k)
104 {
105 stat_mean_[k].release();
106 stat_sigma_[k].release();
107 }
108}

◆ resize()

resize and initialize the set of parameter.

Parameters
rangerange of the variables in the data set

Definition at line 69 of file STK_DiagGaussianParameters.cpp.

70{
71 for (int k = mean_.begin(); k< mean_.end(); ++k)
72 {
73 mean_[k].resize(range) = 0.;
74 sigma_[k].resize(range) = 1.;
75 stat_mean_[k].resize(range);
76 stat_sigma_[k].resize(range);
77 }
78}

◆ setParameters()

template<class Array >
void STK::ModelParameters< Clust::Gaussian_sjk_ >::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 mean and sd parameters on two consecutive rows. The number of column of params is the number of variables.

Definition at line 105 of file STK_DiagGaussianParameters.h.

106 {
107 for(int k=mean_.begin(), kp= params.beginRows(); k<mean_.end(); ++k, kp+=2)
108 {
109 mean_[k] = params.row(kp);
110 sigma_[k] = params.row(kp+1);
111 }
112 }

◆ setStatistics()

Set the computed statistics.

Definition at line 90 of file STK_DiagGaussianParameters.cpp.

91{
92 for(int k=stat_mean_.begin(); k<stat_mean_.end(); ++k)
93 {
94 mean_[k] = stat_mean_[k].mean();
95 sigma_[k] = stat_sigma_[k].mean();
96 stat_mean_[k].release();
97 stat_sigma_[k].release();
98 }
99}

◆ sigma()

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

Definition at line 85 of file STK_DiagGaussianParameters.h.

85{ return sigma_[k][j];}

◆ updateStatistics()

update statistics of the parameters.

Definition at line 81 of file STK_DiagGaussianParameters.cpp.

82{
83 for(int k=stat_mean_.begin(); k<stat_mean_.end(); ++k)
84 {
85 stat_mean_[k].update(mean_[k]);
87 }
88}
virtual void update()
update the runner.

Member Data Documentation

◆ mean_

array of size nbCluster with the parameters mean of the variables

Definition at line 59 of file STK_DiagGaussianParameters.h.

◆ sigma_

standard deviation of the variables

Definition at line 61 of file STK_DiagGaussianParameters.h.

◆ stat_mean_

Array of the mean statistics.

Definition at line 63 of file STK_DiagGaussianParameters.h.

◆ stat_sigma_

Array of the standard deviation statistics.

Definition at line 65 of file STK_DiagGaussianParameters.h.


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