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

Structure encapsulating the parameters of a Gaussian_sjsk mixture model. More...

#include <STK_DiagGaussianParameters.h>

Public Member Functions

 ModelParameters (int nbCluster)
 default constructor
 
 ModelParameters (ModelParameters const &param)
 copy constructor.
 
 ~ModelParameters ()
 destructor
 
Real constmean (int k, int j) const
 
Real sigma (int k, int j) const
 
void resize (Range const &range)
 resize 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
 
CVectorX sigmak_
 standard deviation of the variables
 
CPointX sigmaj_
 standard deviation of the variables by variables
 
Array1D< Stat::Online< CPointX, Real > > stat_mean_
 Array of the mean statistics.
 
Stat::Online< Real, Realstat_sigmak_
 Array of the standard deviation k statistics.
 
Stat::Online< CPointX, Realstat_sigmaj_
 Array of the standard deviation j statistics.
 

Detailed Description

Structure encapsulating the parameters of a Gaussian_sjsk mixture model.

Definition at line 312 of file STK_DiagGaussianParameters.h.

Constructor & Destructor Documentation

◆ ModelParameters() [1/2]

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

default constructor

Parameters
nbClusterthe number of class of the mixture

◆ ModelParameters() [2/2]

copy constructor.

Parameters
paramthe parameters to copy.

◆ ~ModelParameters()

Member Function Documentation

◆ mean()

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

Definition at line 339 of file STK_DiagGaussianParameters.h.

339{ return mean_[k][j];}
Array1D< CPointX > mean_
array of size nbCluster with the parameters mean of the variables

◆ releaseStatistics()

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

Release the computed statistics.

◆ resize()

resize the set of parameter

◆ setParameters()

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

Set the parameters of the mixture model.

It is assumed that the array params is of size (2*nbCluster, nbVariable).

Definition at line 357 of file STK_DiagGaussianParameters.h.

358 {
359 CArrayXX sigma(mean_.range(), params.cols());
360 for(int k=mean_.begin(), kp= params.beginRows(); k<mean_.end(); ++k, kp+=2)
361 {
362 mean_[k] = params.row(kp);
363 sigma.row(k) = params.row(kp+1);
364 }
365 sigmak_ = Stat::meanByRow(sigma.asDerived());
366 sigmaj_ = Stat::meanByCol(sigma.asDerived());
367 Real cte = std::sqrt((sigma/(sigmak_ * sigmaj_)).mean());
368 sigmak_ *= cte;
369 sigmaj_ *= cte;
370 }
double Real
STK fundamental type of Real values.
hidden::FunctorTraits< Derived, MeanOp >::Row meanByCol(Derived const &A)
hidden::FunctorTraits< Derived, MeanOp >::Col meanByRow(Derived const &A)
CArray< Real, UnknownSize, UnknownSize, Arrays::by_col_ > CArrayXX
Definition STK_CArray.h:50
CPointX sigmaj_
standard deviation of the variables by variables
CVectorX sigmak_
standard deviation of the variables

References STK::mean(), STK::Stat::meanByCol(), STK::Stat::meanByRow(), and STK::ICArray< Derived >::row().

◆ setStatistics()

Set the computed statistics.

◆ sigma()

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

Definition at line 341 of file STK_DiagGaussianParameters.h.

341{ return sigmak_[k] * sigmaj_[j];}

◆ updateStatistics()

update statistics of the parameters.

Member Data Documentation

◆ mean_

array of size nbCluster with the parameters mean of the variables

Definition at line 315 of file STK_DiagGaussianParameters.h.

◆ sigmaj_

standard deviation of the variables by variables

Definition at line 319 of file STK_DiagGaussianParameters.h.

◆ sigmak_

standard deviation of the variables

Definition at line 317 of file STK_DiagGaussianParameters.h.

◆ stat_mean_

Array of the mean statistics.

Definition at line 321 of file STK_DiagGaussianParameters.h.

◆ stat_sigmaj_

Array of the standard deviation j statistics.

Definition at line 325 of file STK_DiagGaussianParameters.h.

◆ stat_sigmak_

Array of the standard deviation k statistics.

Definition at line 323 of file STK_DiagGaussianParameters.h.


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