35#ifndef STK_DIAGGAUSSIAN_SJ_H
36#define STK_DIAGGAUSSIAN_SJ_H
38#include "../DiagGaussianModels/STK_DiagGaussianBase.h"
44template<
class Array>
class DiagGaussian_sj;
108 this->randomMean(p_tik);
111 for (
int k= p_tik->beginCols(); k < p_tik->endCols(); ++k)
113 variance += p_tik->
col(k).transpose()
119 param_.sigma_ = (variance /= this->nbSample()).sqrt();
120#ifdef STK_MIXTURE_VERY_VERBOSE
121 stk_cout <<
_T(
"DiagGaussian_sj<Array>::randomInit( CArrayXX const* const& p_tik, CPointX const* const& p_tk) done\n");
130 if (!this->updateMean(p_tik))
return false;
133 for (
int k= p_tik->beginCols(); k < p_tik->endCols(); ++k)
135 variance += p_tik->
col(k).transpose()
143 param_.sigma_ = (variance /= this->nbSample()).sqrt();
#define stk_cout
Standard stk output stream.
#define _T(x)
Let x unmodified.
Define the constant point.
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_sj have a density function of the form.
~DiagGaussian_sj()
destructor
bool run(CArrayXX const *const &p_tik, CPointX const *const &p_tk)
Compute the weighted mean and the common standard deviation.
DiagGaussian_sj(int nbCluster)
default constructor
int computeNbFreeParameters() const
DiagGaussian_sj(DiagGaussian_sj const &model)
copy constructor
DiagGaussianBase< DiagGaussian_sj< Array > > Base
void randomInit(CArrayXX const *const &p_tik, CPointX const *const &p_tk)
Initialize randomly the parameters of the Gaussian mixture.
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...
The namespace STK is the main domain space of the Statistical ToolKit project.
ModelParameters< Clust::Gaussian_sj_ > Parameters
Type of the structure storing the parameters of a MixturGaussian_sj model.
Main class for the mixtures traits policy.