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

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

#include <STK_GammaParameters.h>

Inheritance diagram for STK::ModelParameters< Clust::Gamma_ak_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< Realshape_
 shapes of the variables
 
Array1D< Realscale_
 scales of the variables
 
Array1D< Stat::Online< Real, 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_ak_bk_ mixture model.

Definition at line 739 of file STK_GammaParameters.h.

Constructor & Destructor Documentation

◆ ModelParameters() [1/2]

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

default constructor

Parameters
nbClusterthe number of class of the mixture

Definition at line 710 of file STK_GammaParameters.cpp.

711 : ParametersGammaBase(nbCluster)
712 , shape_(nbCluster), scale_(nbCluster)
713 , stat_shape_(nbCluster), stat_scale_(nbCluster)
714{}
Array1D< Real > scale_
scales of the variables
Array1D< Stat::Online< Real, Real > > stat_shape_
Array of the mean statistics.
Array1D< Stat::Online< Real, Real > > stat_scale_
Array of the standard deviation statistics.
Array1D< Real > shape_
shapes of the variables
ParametersGammaBase(int nbCluster)
default constructor

◆ ModelParameters() [2/2]

copy constructor.

Parameters
paramthe parameters to copy.

Definition at line 718 of file STK_GammaParameters.cpp.

719 : ParametersGammaBase(param)
720 , shape_(param.shape_), scale_(param.scale_)
721 , stat_shape_(param.stat_shape_), stat_scale_(param.stat_scale_)
722{}

◆ ~ModelParameters()

destructor

Definition at line 724 of file STK_GammaParameters.cpp.

724{}

Member Function Documentation

◆ releaseStatistics()

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

Release the computed statistics.

Definition at line 757 of file STK_GammaParameters.cpp.

758{
759 for(int k=stat_shape_.begin(); k<stat_shape_.end(); ++k)
760 {
761 stat_shape_[k].release();
762 stat_scale_[k].release();
763 }
764}

◆ resize()

resize and initialize the set of parameter.

Parameters
rangerange of the variables in the data set

Definition at line 726 of file STK_GammaParameters.cpp.

727{
729 for (int k = shape_.begin(); k< shape_.end(); ++k)
730 {
731 shape_[k] = 1.;
732 stat_shape_[k].release();
733 scale_[k] = 1.;
734 stat_scale_[k].release();
735 }
736}
void resize(Range const &range)

References STK::ParametersGammaBase::resize().

◆ scale()

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

Definition at line 764 of file STK_GammaParameters.h.

764{ return scale_[k];}

◆ setParameters()

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

785 {
786 for(int k=shape_.begin(), kp= params.beginRows(); k<shape_.end(); ++k, kp+=2)
787 {
788 shape_[k] = params.row(kp).mean();
789 scale_[k] = params.row(kp+1).mean();
790 }
791 }

◆ setStatistics()

Set the computed statistics.

Definition at line 746 of file STK_GammaParameters.cpp.

747{
748 for(int k=stat_shape_.begin(); k<stat_shape_.end(); ++k)
749 {
750 shape_[k] = stat_shape_[k].mean();
751 stat_shape_[k].release();
752 scale_[k] = stat_scale_[k].mean();
753 stat_scale_[k].release();
754 }
755}

◆ shape()

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

Definition at line 762 of file STK_GammaParameters.h.

762{ return shape_[k];}

◆ updateStatistics()

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

update statistics of the parameters.

Definition at line 738 of file STK_GammaParameters.cpp.

739{
740 for(int k=stat_shape_.begin(); k<stat_shape_.end(); ++k)
741 { stat_shape_[k].update(shape_[k]);
743 }
744}
virtual void update()
update the runner.

Member Data Documentation

◆ scale_

scales of the variables

Definition at line 744 of file STK_GammaParameters.h.

◆ shape_

shapes of the variables

Definition at line 742 of file STK_GammaParameters.h.

◆ stat_scale_

Array of the standard deviation statistics.

Definition at line 748 of file STK_GammaParameters.h.

◆ stat_shape_

Array of the mean statistics.

Definition at line 746 of file STK_GammaParameters.h.


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