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

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

#include <STK_GammaParameters.h>

Inheritance diagram for STK::ModelParameters< Clust::Gamma_ajk_b_ >:
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

Array1D< CPointXshape_
 shapes of the variables
 
Real scale_
 scales of the variables
 
Array1D< Stat::Online< CPointX, Real > > stat_shape_
 Array of the mean statistics.
 
Stat::Online< Real, Realstat_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_ajk_b_ mixture model.

Definition at line 318 of file STK_GammaParameters.h.

Constructor & Destructor Documentation

◆ ModelParameters() [1/2]

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

default constructor

Parameters
nbClusterthe number of class of the mixture

Definition at line 301 of file STK_GammaParameters.cpp.

302 : ParametersGammaBase(nbCluster)
303 , shape_(nbCluster), scale_()
304 , stat_shape_(nbCluster), stat_scale_()
305{}
Array1D< Stat::Online< CPointX, Real > > stat_shape_
Array of the mean statistics.
Stat::Online< Real, Real > stat_scale_
Array of the standard deviation statistics.
Array1D< CPointX > shape_
shapes of the variables
ParametersGammaBase(int nbCluster)
default constructor

◆ ModelParameters() [2/2]

copy constructor.

Parameters
paramthe parameters to copy.

Definition at line 309 of file STK_GammaParameters.cpp.

310 : ParametersGammaBase(param)
311 , shape_(param.shape_), scale_(param.scale_)
312 , stat_shape_(param.stat_shape_), stat_scale_(param.stat_scale_)
313{}

◆ ~ModelParameters()

destructor

Definition at line 315 of file STK_GammaParameters.cpp.

315{}

Member Function Documentation

◆ releaseStatistics()

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

Release the computed statistics.

Definition at line 347 of file STK_GammaParameters.cpp.

348{
349 for(int k=stat_shape_.begin(); k<stat_shape_.end(); ++k)
350 { stat_shape_[k].release();}
351 stat_scale_.release();
352}

◆ resize()

resize and initialize the set of parameter.

Parameters
rangerange of the variables in the data set

Definition at line 317 of file STK_GammaParameters.cpp.

318{
320 for (int k = shape_.begin(); k< shape_.end(); ++k)
321 {
322 shape_[k].resize(range) = 1.;
323 stat_shape_[k].resize(range);
324 }
325 scale_ = 1.;
326 stat_scale_.release();
327}
void resize(Range const &range)

References STK::ParametersGammaBase::resize().

◆ scale()

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

Definition at line 343 of file STK_GammaParameters.h.

343{ return scale_;}

◆ setParameters()

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

364 {
365 scale_ = 0.;
366 for(int k=shape_.begin(), kp= params.beginRows(); k<shape_.end(); ++k, kp+=2)
367 {
368 shape_[k] = params.row(kp);
369 scale_ = params.row(kp+1).mean();
370 }
371 scale_ /= shape_.size();
372 }

◆ setStatistics()

Set the computed statistics.

Definition at line 336 of file STK_GammaParameters.cpp.

337{
338 for(int k=stat_shape_.begin(); k<stat_shape_.end(); ++k)
339 {
340 shape_[k] = stat_shape_[k].mean();
341 stat_shape_[k].release();
342 }
343 scale_ = stat_scale_.mean();
344 stat_scale_.release();
345}

◆ shape()

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

Definition at line 341 of file STK_GammaParameters.h.

341{ return shape_[k][j];}

◆ updateStatistics()

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

update statistics of the parameters.

Definition at line 329 of file STK_GammaParameters.cpp.

330{
331 for(int k=stat_shape_.begin(); k<stat_shape_.end(); ++k)
332 { stat_shape_[k].update(shape_[k]);}
334}
virtual void update()
update the runner.

Member Data Documentation

◆ scale_

scales of the variables

Definition at line 323 of file STK_GammaParameters.h.

◆ shape_

shapes of the variables

Definition at line 321 of file STK_GammaParameters.h.

◆ stat_scale_

Array of the standard deviation statistics.

Definition at line 327 of file STK_GammaParameters.h.

◆ stat_shape_

Array of the mean statistics.

Definition at line 325 of file STK_GammaParameters.h.


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