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

Structure encapsulating the parameters of a Poisson_ljlk model. More...

#include <STK_PoissonParameters.h>

Public Member Functions

 ModelParameters (int nbCluster)
 default constructor
 
 ModelParameters (ModelParameters const &param)
 copy constructor.
 
 ~ModelParameters ()
 destructor
 
Real lambda (int k, int j) const
 
void resize (Range const &range)
 resize 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 Attributes

CVectorX lambdak_
 intensity of the variables by class
 
CPointX lambdaj_
 intensity of the variables by variables
 
Array1D< Stat::Online< Real, Real > > stat_lambdak_
 Array of the lambdak_ statistics.
 
Stat::Online< CVectorX, Realstat_lambdaj_
 Array of the lambdaj_ statistics.
 

Detailed Description

Structure encapsulating the parameters of a Poisson_ljlk model.

Definition at line 54 of file STK_PoissonParameters.h.

Constructor & Destructor Documentation

◆ ModelParameters() [1/2]

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

default constructor

Parameters
nbClusterthe number of class of the mixture

Definition at line 91 of file STK_PoissonParameters.cpp.

92 : lambdak_(nbCluster), lambdaj_()
93 , stat_lambdak_(nbCluster), stat_lambdaj_()
94{}
CVectorX lambdak_
intensity of the variables by class
Array1D< Stat::Online< Real, Real > > stat_lambdak_
Array of the lambdak_ statistics.
CPointX lambdaj_
intensity of the variables by variables
Stat::Online< CVectorX, Real > stat_lambdaj_
Array of the lambdaj_ statistics.

◆ ModelParameters() [2/2]

copy constructor.

Parameters
paramthe parameters to copy.

Definition at line 98 of file STK_PoissonParameters.cpp.

99 : lambdak_(param.lambdak_)
100 , lambdaj_(param.lambdaj_)
101 , stat_lambdak_(param.stat_lambdak_)
102 , stat_lambdaj_(param.stat_lambdaj_)
103{}

◆ ~ModelParameters()

destructor

Definition at line 105 of file STK_PoissonParameters.cpp.

105{}

Member Function Documentation

◆ lambda()

Real STK::ModelParameters< Clust::Poisson_ljlk_ >::lambda ( int  k,
int  j 
) const
inline
Returns
the intensity of the kth cluster and jth variable

Definition at line 77 of file STK_PoissonParameters.h.

77{ return lambdak_[k] * lambdaj_[j];}

◆ releaseStatistics()

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

Release the computed statistics.

Definition at line 138 of file STK_PoissonParameters.cpp.

139{
140 for(int k=stat_lambdak_.begin(); k<stat_lambdak_.end(); ++k)
141 { stat_lambdak_[k].release();}
142 stat_lambdaj_.release();
143}

◆ resize()

resize the set of parameter

Definition at line 107 of file STK_PoissonParameters.cpp.

108{
109 for (int k = lambdak_.begin(); k< lambdak_.end(); ++k)
110 {
111 lambdak_[k] = 1.;
112 stat_lambdak_[k].release();
113 }
114 lambdaj_.resize(range) = 1;
115 stat_lambdaj_.resize(range);
116}

◆ setParameters()

template<class Array >
void STK::ModelParameters< Clust::Poisson_ljlk_ >::setParameters ( ExprBase< Array > const params)
inline

Set the parameters of the mixture model.

It is assumed that the array params is of size (nbCluster, nbVariable).

Definition at line 93 of file STK_PoissonParameters.h.

94 {
95 lambdak_ = Stat::meanByRow(params.asDerived());
96 lambdaj_ = Stat::meanByCol(params.asDerived());
97 Real cte = std::sqrt((params/(lambdak_ * lambdaj_)).mean());
98 lambdak_ *= cte;
99 lambdaj_ *= cte;
100 }
double Real
STK fundamental type of Real values.
hidden::SliceVisitorSelector< Derived, hidden::MeanVisitor, Arrays::by_col_ >::type_result mean(Derived const &A)
If A is a row-vector or a column-vector then the function will return the usual mean value of the vec...
hidden::FunctorTraits< Derived, MeanOp >::Row meanByCol(Derived const &A)
hidden::FunctorTraits< Derived, MeanOp >::Col meanByRow(Derived const &A)

References STK::mean(), STK::Stat::meanByCol(), and STK::Stat::meanByRow().

◆ setStatistics()

Set the computed statistics.

Definition at line 126 of file STK_PoissonParameters.cpp.

127{
128 for(int k=stat_lambdak_.begin(); k<stat_lambdak_.end(); ++k)
129 {
130 lambdak_[k] = stat_lambdak_[k].mean();
131 stat_lambdak_[k].release();
132 }
133 lambdaj_ = stat_lambdaj_.mean();
134 stat_lambdaj_.release();
135
136}

◆ updateStatistics()

update statistics of the parameters.

Definition at line 119 of file STK_PoissonParameters.cpp.

120{
121 for(int k=stat_lambdak_.begin(); k<stat_lambdak_.end(); ++k)
122 { stat_lambdak_[k].update(lambdak_[k]);}
124}
virtual void update()
update the runner.

Member Data Documentation

◆ lambdaj_

intensity of the variables by variables

Definition at line 59 of file STK_PoissonParameters.h.

◆ lambdak_

intensity of the variables by class

Definition at line 57 of file STK_PoissonParameters.h.

◆ stat_lambdaj_

Array of the lambdaj_ statistics.

Definition at line 63 of file STK_PoissonParameters.h.

◆ stat_lambdak_

Array of the lambdak_ statistics.

Definition at line 61 of file STK_PoissonParameters.h.


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