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

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

#include <STK_GammaParameters.h>

Inheritance diagram for STK::ModelParameters< Clust::Gamma_a_bk_ >:
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< Realscale_
 scales of the variables
 
Stat::Online< Real, Realstat_shape_
 shape statistics
 
Array1D< Stat::Online< Real, Real > > stat_scale_
 Array of the standard deviation 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_bk_ mixture model.

Definition at line 135 of file STK_GammaParameters.h.

Constructor & Destructor Documentation

◆ ModelParameters() [1/2]

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

default constructor

Parameters
nbClusterthe number of class of the mixture

Definition at line 133 of file STK_GammaParameters.cpp.

134 : ParametersGammaBase(nbCluster)
135 , shape_(0.), scale_(nbCluster)
136 , stat_shape_(), stat_scale_(nbCluster)
137{}
Array1D< Real > scale_
scales of the variables
Stat::Online< Real, Real > stat_shape_
shape statistics
Array1D< Stat::Online< Real, Real > > stat_scale_
Array of the standard deviation statistics.
ParametersGammaBase(int nbCluster)
default constructor

◆ ModelParameters() [2/2]

copy constructor.

Parameters
paramthe parameters to copy.

Definition at line 141 of file STK_GammaParameters.cpp.

142 : ParametersGammaBase(param)
143 , shape_(param.shape_), scale_(param.scale_)
144 , stat_shape_(param.stat_shape_), stat_scale_(param.stat_scale_)
145{}

◆ ~ModelParameters()

destructor

Definition at line 147 of file STK_GammaParameters.cpp.

147{}

Member Function Documentation

◆ releaseStatistics()

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

Release the computed statistics.

Definition at line 177 of file STK_GammaParameters.cpp.

178{
179 for(int k=stat_scale_.begin(); k<stat_scale_.end(); ++k)
180 { stat_scale_[k].release();}
181 stat_shape_.release();
182}

◆ resize()

resize and initialize the set of parameter.

Parameters
rangerange of the variables in the data set

Definition at line 149 of file STK_GammaParameters.cpp.

150{
152 shape_ = 1.;
153 stat_shape_.release();
154 for (int k = scale_.begin(); k< scale_.end(); ++k)
155 { scale_[k] = 1.;}
156}
void resize(Range const &range)

References STK::ParametersGammaBase::resize().

◆ scale()

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

Definition at line 160 of file STK_GammaParameters.h.

160{ return scale_[k];}

◆ setParameters()

template<class Array >
void STK::ModelParameters< Clust::Gamma_a_bk_ >::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 180 of file STK_GammaParameters.h.

181 {
182 shape_ = 0.;
183 for(int k=scale_.begin(), kp= params.beginRows(); k<scale_.end(); ++k, kp+=2)
184 {
185 shape_ += params.row(kp).mean();
186 scale_[k] = params.row(kp+1).mean();
187 }
188 shape_ /= scale_.size();
189 }

◆ setStatistics()

Set the computed statistics.

Definition at line 166 of file STK_GammaParameters.cpp.

167{
168 for(int k=stat_scale_.begin(); k<stat_scale_.end(); ++k)
169 {
170 scale_[k] = stat_scale_[k].mean();
171 stat_scale_[k].release();
172 }
173 shape_ = stat_shape_.mean();
174 stat_shape_.release();
175}

◆ shape()

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

Definition at line 158 of file STK_GammaParameters.h.

158{ return shape_;}

◆ updateStatistics()

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

update statistics of the parameters.

Definition at line 159 of file STK_GammaParameters.cpp.

160{
161 for(int k=stat_scale_.begin(); k<stat_scale_.end(); ++k)
162 { stat_scale_[k].update(scale_[k]);}
164}
virtual void update()
update the runner.

Member Data Documentation

◆ scale_

scales of the variables

Definition at line 140 of file STK_GammaParameters.h.

◆ shape_

shape of the variables

Definition at line 138 of file STK_GammaParameters.h.

◆ stat_scale_

Array of the standard deviation statistics.

Definition at line 144 of file STK_GammaParameters.h.

◆ stat_shape_

shape statistics

Definition at line 142 of file STK_GammaParameters.h.


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