35#ifndef STK_POISSON_LK_H
36#define STK_POISSON_LK_H
38#include "../PoissonModels/STK_PoissonBase.h"
44template<
class Array>
class Poisson_lk;
54 typedef typename Array::Type
Type;
102 for (
int k= p_tik->beginCols(); k < p_tik->endCols(); ++k)
111 for (
int k= p_tik->beginCols(); k < p_tik->endCols(); ++k)
113 param_.lambda_[k]= 0.;
114 for (
int j=p_data()->beginCols();
j< p_data()->endCols(); ++
j)
116 for (
int i=p_tik->beginRows();
i < p_tik->endRows(); ++
i)
117 { param_.lambda_[k] += p_data()->elt(
i,
j) * p_tik->elt(
i,k);}
119 param_.lambda_[k] /= p_data()->sizeCols()*p_tk->elt(k);
virtual Real rand() const
Generate a pseudo Exponential random variate.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
Base class for the Poisson models.
Array const *const & p_data() const
Parameters param_
parameters of the derived mixture model.
The Poisson mixture model Poisson_lk has a probability function of the form.
void randomInit(CArrayXX const *const &p_tik, CPointX const *const &p_tk)
Initialize randomly the parameters of the Poisson mixture.
Poisson_lk(Poisson_lk const &model)
copy constructor
PoissonBase< Poisson_lk< Array > > Base
bool run(CArrayXX const *const &p_tik, CPointX const *const &p_tk)
Compute the weighted probabilities.
Real lambda(int k, int j) const
Poisson_lk(int nbCluster)
default constructor
int computeNbFreeParameters() const
double Real
STK fundamental type of Real values.
The namespace STK is the main domain space of the Statistical ToolKit project.
ModelParameters< Clust::Poisson_lk_ > Parameters
Type of the structure storing the parameters of a MixturePoisson_lk model.
Main class for the mixtures traits policy.