35#ifndef STK_DIAGGAUSSIAN_SJK_H
36#define STK_DIAGGAUSSIAN_SJK_H
38#include "../DiagGaussianModels/STK_DiagGaussianBase.h"
44template<
class Array>
class DiagGaussian_sjk;
106 this->randomMean(p_tik);
108 for (
int k= p_tik->beginCols(); k < p_tik->endCols(); ++k)
112#ifdef STK_MIXTURE_VERY_VERBOSE
113 stk_cout <<
_T(
"DiagGaussian_sjk<Array>::randomInit( CArrayXX const* const& p_tik, CPointX const* const& p_tk) done\n");
122 if (!this->updateMean(p_tik))
return false;
124 for (
int k= p_tik->beginCols(); k < p_tik->endCols(); ++k)
127#ifdef STK_MIXTURE_DEBUG
128 if( (param_.sigma_[k] <= 0).any() )
130 stk_cout <<
_T(
"DiagGaussian_sjk::run() failed\n");
131 stk_cout <<
_T(
"p_tik->col(") << k <<
_T(
") =\n") << p_tik->
col(k).transpose() <<
_T(
"\n");
132 stk_cout <<
_T(
"param_.mean_[") << k <<
_T(
"] =") << param_.mean_[k];
133 stk_cout <<
_T(
"param_.sigma_[") << k <<
_T(
"] =") << param_.sigma_[k];
#define stk_cout
Standard stk output stream.
#define _T(x)
Let x unmodified.
Base class for the diagonal Gaussian models.
Array const *const & p_data() const
Parameters param_
parameters of the derived mixture model.
The diagonal Gaussian mixture model DiagGaussian_sjk is the most general diagonal Gaussian model and ...
~DiagGaussian_sjk()
destructor
DiagGaussian_sjk(DiagGaussian_sjk const &model)
copy constructor
DiagGaussianBase< DiagGaussian_sjk< Array > > Base
void randomInit(CArrayXX const *const &p_tik, CPointX const *const &p_tk)
Initialize randomly the parameters of the Gaussian mixture.
int computeNbFreeParameters() const
DiagGaussian_sjk(int nbCluster)
default constructor
bool run(CArrayXX const *const &p_tik, CPointX const *const &p_tk)
Compute the weighted mean and the common standard deviation.
hidden::CSlice< Derived, sizeRows_, 1 >::Result col(int j) const
implement the col operator using a reference on the column of the allocator
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
hidden::FunctorTraits< Derived, VarianceWithFixedMeanOp >::Row varianceWithFixedMean(Derived const &A, MeanType const &mean, bool unbiased)
Compute the VarianceWithFixedMean(s) value(s) of A.
The namespace STK is the main domain space of the Statistical ToolKit project.
ModelParameters< Clust::Gaussian_sjk_ > Parameters
Type of the structure storing the parameters of a MixturGaussian_sjk model.
Main class for the mixtures traits policy.