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

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

#include <STK_GammaParameters.h>

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

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

Definition at line 499 of file STK_GammaParameters.h.

Constructor & Destructor Documentation

◆ ModelParameters() [1/2]

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

default constructor

Parameters
nbClusterthe number of class of the mixture

Definition at line 475 of file STK_GammaParameters.cpp.

476 : ParametersGammaBase(nbCluster)
477 , shape_(nbCluster), scale_(nbCluster)
478 , stat_shape_(nbCluster), stat_scale_(nbCluster)
479{}
Array1D< CPointX > shape_
shapes of the variables
Array1D< Stat::Online< Real, Real > > stat_scale_
Array of the standard deviation statistics.
Array1D< Stat::Online< CPointX, Real > > stat_shape_
Array of the mean statistics.
Array1D< Real > scale_
scales of the variables
ParametersGammaBase(int nbCluster)
default constructor

◆ ModelParameters() [2/2]

copy constructor.

Parameters
paramthe parameters to copy.

Definition at line 483 of file STK_GammaParameters.cpp.

484 : ParametersGammaBase(param)
485 , shape_(param.shape_), scale_(param.scale_)
486 , stat_shape_(param.stat_shape_), stat_scale_(param.stat_scale_)
487{}

◆ ~ModelParameters()

destructor

Definition at line 489 of file STK_GammaParameters.cpp.

489{}

Member Function Documentation

◆ releaseStatistics()

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

Release the computed statistics.

Definition at line 524 of file STK_GammaParameters.cpp.

525{
526 for(int k=stat_shape_.begin(); k<stat_shape_.end(); ++k)
527 {
528 stat_shape_[k].release();
529 stat_scale_[k].release();
530 }
531}

◆ resize()

resize and initialize the set of parameter.

Parameters
rangerange of the variables in the data set

Definition at line 491 of file STK_GammaParameters.cpp.

492{
494 for (int k = shape_.begin(); k< shape_.end(); ++k)
495 {
496 shape_[k].resize(range) = 1.;
497 stat_shape_[k].resize(range);
498 scale_[k] = 1.;
499 stat_scale_[k].release();
500 }
501}
void resize(Range const &range)

References STK::ParametersGammaBase::resize().

◆ scale()

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

Definition at line 524 of file STK_GammaParameters.h.

524{ return scale_[k];}

◆ setParameters()

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

545 {
546 for(int k=shape_.begin(), kp= params.beginRows(); k<shape_.end(); ++k, kp+=2)
547 {
548 shape_[k] = params.row(kp);
549 scale_[k] = params.row(kp+1).mean();
550 }
551 }

◆ setStatistics()

Set the computed statistics.

Definition at line 513 of file STK_GammaParameters.cpp.

514{
515 for(int k=stat_shape_.begin(); k<stat_shape_.end(); ++k)
516 {
517 shape_[k] = stat_shape_[k].mean();
518 stat_shape_[k].release();
519 scale_[k] = stat_scale_[k].mean();
520 stat_scale_[k].release();
521 }
522}

◆ shape()

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

Definition at line 522 of file STK_GammaParameters.h.

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

◆ updateStatistics()

update statistics of the parameters.

Definition at line 504 of file STK_GammaParameters.cpp.

505{
506 for(int k=stat_shape_.begin(); k<stat_shape_.end(); ++k)
507 {
510 }
511}
virtual void update()
update the runner.

Member Data Documentation

◆ scale_

scales of the variables

Definition at line 504 of file STK_GammaParameters.h.

◆ shape_

shapes of the variables

Definition at line 502 of file STK_GammaParameters.h.

◆ stat_scale_

Array of the standard deviation statistics.

Definition at line 508 of file STK_GammaParameters.h.

◆ stat_shape_

Array of the mean statistics.

Definition at line 506 of file STK_GammaParameters.h.


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