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

Structure encapsulating the parameters of a Kmm_sk model. More...

#include <STK_KernelParameters.h>

Public Member Functions

 ModelParameters (int nbCluster)
 default constructor
 
 ModelParameters (ModelParameters const &param)
 copy constructor.
 
 ~ModelParameters ()
 destructor
 
Real constsigma2 (int k) const
 
Real constdim (int k) const
 
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

CPointX sigma2_
 variance of the variables
 
CPointX dim_
 dimension of the gaussian kernel
 
Array1D< Stat::Online< Real, Real > > stat_sigma2_
 Array of the sigma2 statistics.
 
Array1D< Stat::Online< Real, Real > > stat_dim_
 Array of the dim statistics.
 

Detailed Description

Structure encapsulating the parameters of a Kmm_sk model.

Definition at line 109 of file STK_KernelParameters.h.

Constructor & Destructor Documentation

◆ ModelParameters() [1/2]

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

default constructor

Parameters
nbClusterthe number of class of the mixture

Definition at line 89 of file STK_KernelParameters.cpp.

90 : sigma2_(nbCluster, 1.), dim_(nbCluster, 10)
91 , stat_sigma2_(nbCluster), stat_dim_(nbCluster)
92{}
Array1D< Stat::Online< Real, Real > > stat_sigma2_
Array of the sigma2 statistics.
CPointX dim_
dimension of the gaussian kernel
Array1D< Stat::Online< Real, Real > > stat_dim_
Array of the dim statistics.
CPointX sigma2_
variance of the variables

◆ ModelParameters() [2/2]

copy constructor.

Parameters
paramthe parameters to copy.

Definition at line 96 of file STK_KernelParameters.cpp.

97 : sigma2_(param.sigma2_), dim_(param.dim_)
98 , stat_sigma2_(param.stat_sigma2_)
99 , stat_dim_(param.stat_dim_)
100{}

◆ ~ModelParameters()

destructor

Definition at line 102 of file STK_KernelParameters.cpp.

102{}

Member Function Documentation

◆ dim()

Real const & STK::ModelParameters< Clust::Kmm_sk_ >::dim ( int  k) const
inline
Returns
the dimension of the kth cluster

Definition at line 134 of file STK_KernelParameters.h.

134{ return dim_[k];}

◆ releaseStatistics()

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

Release the computed statistics.

Definition at line 124 of file STK_KernelParameters.cpp.

125{
126 for(int k=stat_dim_.begin(); k<stat_dim_.end(); ++k)
127 {
128 stat_sigma2_[k].release();
129 stat_dim_[k].release();
130 }
131}

◆ setParameters()

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

Definition at line 149 of file STK_KernelParameters.h.

150 {
151 for(int k=dim_.begin(); k<dim_.end(); ++k)
152 { sigma2_[k] = params(k, baseIdx) ;
153 dim_[k] = params(k, baseIdx+1);
154 }
155 }
const int baseIdx
base index of the containers created in STK++.

References STK::baseIdx.

◆ setStatistics()

void STK::ModelParameters< Clust::Kmm_sk_ >::setStatistics ( )

Set the computed statistics.

Definition at line 113 of file STK_KernelParameters.cpp.

114{
115 for(int k=stat_dim_.begin(); k<stat_dim_.end(); ++k)
116 {
117 sigma2_[k] = stat_sigma2_[k].mean();
118 stat_sigma2_[k].release();
119 dim_[k] = stat_dim_[k].mean();
120 stat_dim_[k].release();
121 }
122}

◆ sigma2()

Real const & STK::ModelParameters< Clust::Kmm_sk_ >::sigma2 ( int  k) const
inline
Returns
the standard deviation of the kth cluster

Definition at line 132 of file STK_KernelParameters.h.

132{ return sigma2_[k];}

◆ updateStatistics()

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

update statistics of the parameters.

Definition at line 105 of file STK_KernelParameters.cpp.

106{
107 for(int k=stat_dim_.begin(); k<stat_dim_.end(); ++k)
108 {
110 stat_dim_[k].update(dim_[k]);}
111}
virtual void update()
update the runner.

Member Data Documentation

◆ dim_

dimension of the gaussian kernel

Definition at line 114 of file STK_KernelParameters.h.

◆ sigma2_

variance of the variables

Definition at line 112 of file STK_KernelParameters.h.

◆ stat_dim_

Array of the dim statistics.

Definition at line 118 of file STK_KernelParameters.h.

◆ stat_sigma2_

Array of the sigma2 statistics.

Definition at line 116 of file STK_KernelParameters.h.


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