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

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

#include <STK_GammaParameters.h>

Inheritance diagram for STK::ModelParameters< Clust::Gamma_a_bjk_ >:
Inheritance graph

Public Member Functions

 ModelParameters (int nbCluster)
 default constructor
 
 ModelParameters (ModelParameters const &param)
 copy constructor.
 
 ~ModelParameters ()
 destructor
 
Real constshape (int k, int j) const
 
Real constscale (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 Member Functions inherited from STK::ParametersGammaBase
 ParametersGammaBase (int nbCluster)
 default constructor
 
 ParametersGammaBase (ParametersGammaBase const &model)
 copy constructor
 
 ~ParametersGammaBase ()
 destructor
 
ParametersGammaBaseoperator= (ParametersGammaBase const &other)
 copy operator
 
void resize (Range const &range)
 

Public Attributes

Real shape_
 shape of the variables
 
Array1D< CPointXscale_
 scales of the variables
 
Stat::Online< Real, Realstat_shape_
 shape statistics
 
Array1D< Stat::Online< CPointX, Real > > stat_scale_
 Array of the scale statistics.
 
- Public Attributes inherited from STK::ParametersGammaBase
Array1D< CPointXmean_
 mean for each class
 
Array1D< CPointXmeanLog_
 log-means for each class
 
Array1D< CPointXvariance_
 variance for each class
 

Detailed Description

Structure encapsulating the parameters of a Gamma_a_bjk_ mixture model.

Definition at line 74 of file STK_GammaParameters.h.

Constructor & Destructor Documentation

◆ ModelParameters() [1/2]

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

default constructor

Parameters
nbClusterthe number of class of the mixture

Definition at line 75 of file STK_GammaParameters.cpp.

76 : ParametersGammaBase(nbCluster)
77 , shape_(0.), scale_(nbCluster)
78 , stat_shape_(), stat_scale_(nbCluster)
79{}
Array1D< CPointX > scale_
scales of the variables
Array1D< Stat::Online< CPointX, Real > > stat_scale_
Array of the scale statistics.
Stat::Online< Real, Real > stat_shape_
shape statistics
ParametersGammaBase(int nbCluster)
default constructor

◆ ModelParameters() [2/2]

copy constructor.

Parameters
paramthe parameters to copy.

Definition at line 83 of file STK_GammaParameters.cpp.

84 : ParametersGammaBase(param)
85 , shape_(param.shape_), scale_(param.scale_)
86 , stat_shape_(param.stat_shape_), stat_scale_(param.stat_scale_)
87{}

◆ ~ModelParameters()

destructor

Definition at line 89 of file STK_GammaParameters.cpp.

89{}

Member Function Documentation

◆ releaseStatistics()

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

Release the computed statistics.

Definition at line 123 of file STK_GammaParameters.cpp.

124{
125 for(int k=stat_scale_.begin(); k<stat_scale_.end(); ++k)
126 { stat_scale_[k].release();}
127 stat_shape_.release();
128}

◆ resize()

resize and initialize the set of parameter.

Parameters
rangerange of the variables in the data set

Definition at line 92 of file STK_GammaParameters.cpp.

93{
95 shape_ = 1.;
96 stat_shape_.release();
97 for (int k = scale_.begin(); k< scale_.end(); ++k)
98 {
99 scale_[k].resize(range) = 1.;
100 stat_scale_[k].resize(range);
101 }
102}
void resize(Range const &range)

References STK::ParametersGammaBase::resize().

◆ scale()

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

Definition at line 99 of file STK_GammaParameters.h.

99{ return scale_[k][j];}

◆ setParameters()

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

Definition at line 119 of file STK_GammaParameters.h.

120 {
121 shape_ = 0.;
122 for(int k=scale_.begin(), kp= params.beginRows(); k<scale_.end(); ++k, kp+=2)
123 {
124 shape_ += params.row(kp).mean();
125 scale_[k] = params.row(kp+1);
126 }
127 shape_ /= scale_.size();
128 }

◆ setStatistics()

Set the computed statistics.

Definition at line 112 of file STK_GammaParameters.cpp.

113{
114 for(int k=stat_scale_.begin(); k<stat_scale_.end(); ++k)
115 {
116 scale_[k] = stat_scale_[k].mean();
117 stat_scale_[k].release();
118 }
119 shape_ = stat_shape_.mean();
120 stat_shape_.release();
121}

◆ shape()

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

Definition at line 97 of file STK_GammaParameters.h.

97{ return shape_;}

◆ updateStatistics()

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

update statistics of the parameters.

Definition at line 105 of file STK_GammaParameters.cpp.

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

Member Data Documentation

◆ scale_

scales of the variables

Definition at line 79 of file STK_GammaParameters.h.

◆ shape_

shape of the variables

Definition at line 77 of file STK_GammaParameters.h.

◆ stat_scale_

Array of the scale statistics.

Definition at line 83 of file STK_GammaParameters.h.

◆ stat_shape_

shape statistics

Definition at line 81 of file STK_GammaParameters.h.


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