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

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

#include <STK_GammaParameters.h>

Inheritance diagram for STK::ModelParameters< Clust::Gamma_ak_bj_ >:
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
 
CPointX scale_
 scales of the variables
 
Array1D< Stat::Online< Real, Real > > stat_shape_
 Array of the mean statistics.
 
Stat::Online< CPointX, 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_ak_bj_ mixture model.

Definition at line 619 of file STK_GammaParameters.h.

Constructor & Destructor Documentation

◆ ModelParameters() [1/2]

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

default constructor

Parameters
nbClusterthe number of class of the mixture

Definition at line 593 of file STK_GammaParameters.cpp.

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

◆ ModelParameters() [2/2]

copy constructor.

Parameters
paramthe parameters to copy.

Definition at line 601 of file STK_GammaParameters.cpp.

602 : ParametersGammaBase(param)
603 , shape_(param.shape_), scale_(param.scale_)
604 , stat_shape_(param.stat_shape_), stat_scale_(param.stat_scale_)
605{}

◆ ~ModelParameters()

destructor

Definition at line 607 of file STK_GammaParameters.cpp.

607{}

Member Function Documentation

◆ releaseStatistics()

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

Release the computed statistics.

Definition at line 640 of file STK_GammaParameters.cpp.

641{
642 for(int k=stat_shape_.begin(); k<stat_shape_.end(); ++k)
643 { stat_shape_[k].release();}
644 stat_scale_.release();
645}

◆ resize()

resize and initialize the set of parameter.

Parameters
rangerange of the variables in the data set

Definition at line 609 of file STK_GammaParameters.cpp.

610{
612 for (int k = shape_.begin(); k< shape_.end(); ++k)
613 {
614 shape_[k] = 1.;
615 stat_shape_[k].release();
616 }
617 scale_.resize(range) = 1.;
618 stat_scale_.resize(range);
619}
void resize(Range const &range)

References STK::ParametersGammaBase::resize().

◆ scale()

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

Definition at line 644 of file STK_GammaParameters.h.

644{ return scale_[j];}

◆ setParameters()

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

665 {
666 scale_ = 0.;
667 for(int k=shape_.begin(), kp= params.beginRows(); k<shape_.end(); ++k, kp+=2)
668 {
669 shape_[k] = params.row(kp).mean();
670 scale_ += params.row(kp+1);
671 }
672 scale_ /= shape_.size();
673 }

◆ setStatistics()

Set the computed statistics.

Definition at line 629 of file STK_GammaParameters.cpp.

630{
631 for(int k=stat_shape_.begin(); k<stat_shape_.end(); ++k)
632 {
633 shape_[k] = stat_shape_[k].mean();
634 stat_shape_[k].release();
635 }
636 scale_ = stat_scale_.mean();
637 stat_scale_.release();
638}

◆ shape()

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

Definition at line 642 of file STK_GammaParameters.h.

642{ return shape_[k];}

◆ updateStatistics()

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

update statistics of the parameters.

Definition at line 622 of file STK_GammaParameters.cpp.

623{
624 for(int k=stat_shape_.begin(); k<stat_shape_.end(); ++k)
625 { stat_shape_[k].update(shape_[k]);}
627}
virtual void update()
update the runner.

Member Data Documentation

◆ scale_

scales of the variables

Definition at line 624 of file STK_GammaParameters.h.

◆ shape_

shapes of the variables

Definition at line 622 of file STK_GammaParameters.h.

◆ stat_scale_

Array of the standard deviation statistics.

Definition at line 628 of file STK_GammaParameters.h.

◆ stat_shape_

Array of the mean statistics.

Definition at line 626 of file STK_GammaParameters.h.


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