35#ifndef STK_DIAGGAUSSIAN_SJSK_H
36#define STK_DIAGGAUSSIAN_SJSK_H
38#include "../DiagGaussianModels/STK_DiagGaussianBase.h"
44template<
class Array>
class DiagGaussian_sjsk;
115 this->randomMean(p_tik);
118 for (
int k= p_tik->beginCols(); k < p_tik->endCols(); ++k)
123#ifdef STK_MIXTURE_VERY_VERBOSE
124 stk_cout <<
_T(
"DiagGaussian_sjsk<Array>::randomInit( CArrayXX const* const& p_tik, CPointX const* const& p_tk) done\n");
133 if (!this->updateMean(p_tik))
return false;
135 for (
int k= p_tik->beginCols(); k < p_tik->endCols(); ++k)
138#ifdef STK_MIXTURE_DEBUG
139 if( (param_.sigma_[k] <= 0).any() )
141 stk_cout <<
_T(
"DiagGaussian_sjsk::run() failed\n");
142 stk_cout <<
_T(
"p_tik->col(") << k <<
_T(
") =\n") << p_tik->
col(k).transpose() <<
_T(
"\n");
143 stk_cout <<
_T(
"param_.mean_[") << k <<
_T(
"] =") << param_.mean_[k];
144 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_sjsk is an intermediate diagonal Gaussian model with...
void randomInit(CArrayXX const *const &p_tik, CPointX const *const &p_tk)
Initialize randomly the parameters of the Gaussian mixture.
bool run(CArrayXX const *const &p_tik, CPointX const *const &p_tk)
Compute the weighted mean and the common standard deviation.
~DiagGaussian_sjsk()
destructor
DiagGaussianBase< DiagGaussian_sjsk< Array > > Base
int computeNbFreeParameters() const
DiagGaussian_sjsk(int nbCluster)
default constructor
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_sjsk_ > Parameters
Type of the structure storing the parameters of a MixturGaussian_sjk model.
Main class for the mixtures traits policy.