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

Structure encapsulating the parameters of a Kmm_s 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

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

Detailed Description

Structure encapsulating the parameters of a Kmm_s model.

Definition at line 53 of file STK_KernelParameters.h.

Constructor & Destructor Documentation

◆ ModelParameters() [1/2]

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

default constructor

Parameters
nbClusterthe number of class of the mixture

Definition at line 44 of file STK_KernelParameters.cpp.

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

◆ ModelParameters() [2/2]

copy constructor.

Parameters
paramthe parameters to copy.

Definition at line 51 of file STK_KernelParameters.cpp.

52 : sigma2_(param.sigma2_), dim_(param.dim_)
53 , stat_sigma2_(param.stat_sigma2_)
54 , stat_dim_(param.stat_dim_)
55{}

◆ ~ModelParameters()

destructor

Definition at line 57 of file STK_KernelParameters.cpp.

57{}

Member Function Documentation

◆ dim()

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

Definition at line 79 of file STK_KernelParameters.h.

79{ return dim_[k];}

◆ releaseStatistics()

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

Release the computed statistics.

Definition at line 78 of file STK_KernelParameters.cpp.

79{
80 stat_sigma2_.release();
81 for(int k=stat_dim_.begin(); k<stat_dim_.end(); ++k)
82 { stat_dim_[k].release();}
83}

◆ setParameters()

template<class Array >
void STK::ModelParameters< Clust::Kmm_s_ >::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 94 of file STK_KernelParameters.h.

95 {
96 sigma2_ = 0.;
97 for(int k=dim_.begin(); k<dim_.end(); ++k)
98 { sigma2_ += params(k, baseIdx) ;
99 dim_[k] = params(k, baseIdx+1);
100 }
101 sigma2_ /= dim_.size();
102 }
const int baseIdx
base index of the containers created in STK++.

References STK::baseIdx.

◆ setStatistics()

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

Set the computed statistics.

Definition at line 67 of file STK_KernelParameters.cpp.

68{
69 sigma2_ = stat_sigma2_.mean();
70 stat_sigma2_.release();
71 for(int k=stat_dim_.begin(); k<stat_dim_.end(); ++k)
72 {
73 dim_[k] = stat_dim_[k].mean();
74 stat_dim_[k].release();
75 }
76}

◆ sigma2()

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

Definition at line 77 of file STK_KernelParameters.h.

77{ return sigma2_;}

◆ updateStatistics()

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

update statistics of the parameters.

Definition at line 60 of file STK_KernelParameters.cpp.

61{
63 for(int k=stat_dim_.begin(); k<stat_dim_.end(); ++k)
64 { stat_dim_[k].update(dim_[k]);}
65}
virtual void update()
update the runner.

Member Data Documentation

◆ dim_

dimension of the gaussian kernel

Definition at line 58 of file STK_KernelParameters.h.

◆ sigma2_

variance of the variables

Definition at line 56 of file STK_KernelParameters.h.

◆ stat_dim_

Array of the dim statistics.

Definition at line 63 of file STK_KernelParameters.h.

◆ stat_sigma2_

sigma2 statistics

Definition at line 61 of file STK_KernelParameters.h.


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