35#ifndef STK_HDMATRIXGAUSSIANMODEL_H
36#define STK_HDMATRIXGAUSSIANMODEL_H
38#include "../STK_IMixtureDensity.h"
45template<
int IdRow_,
int IdCol_,
class Array>
46class HDMatrixGaussianModel;
52template<
int IdRow_,
int IdCol_,
class Array_>
66template<
int IdRow_,
int IdCol_,
class Array_>
145template<
int IdRow_,
int IdCol_,
class Array_>
148 int sum = nbRow_*nbCol_;
149 int maxRowDk = param_.rowDk_.maxElt();
150 int maxColDk = param_.colDk_.maxElt();
152 sum += (isRowBk_)? nbCluster :1;
153 sum += (isColBk_)? nbCluster :1;
155 sum += (isRowAk_) ? ((isRowAj_) ? param_.rowDk_.sum() : nbCluster_) :
maxRowDk;
156 sum += (isColAk_) ? ((isColAj_) ? param_.colDk_.sum() : nbCluster_) :
maxColDk;
160 int dk = param_.rowDk_[k];
167 int dk = param_.colDk_[k];
176template<
int IdRow_,
int IdCol_,
class Array_>
183template<
int IdRow_,
int IdCol_,
class Array_>
190 for (
int k= p_tk->begin(); k < p_tk->end(); ++k)
195 param_.meank_[k] = p_data()->row(
indexes[
i]);
207 for (
int k= p_tk->begin(); k < p_tk->end(); ++k)
212 param_.rowAjk_[k] =
rowA;
213 param_.rowBk_[k] =
rowB;
214 param_.colAjk_[k] =
colA;
215 param_.colBk_[k] =
colB;
220template<
int IdRow_,
int IdCol_,
class Array_>
225 for (
int k=p_tk->begin(); k< p_tk->end(); ++k)
229 Stat::Covariance(*p_data(), p_tik()->col(k),
false);
In this file we define the Parameters classes for High Dimensional Matrix Gaussian mixture models.
Define the constant identity matrix.
Main class for HD matrix valued matrix models.
void randomInit(CArrayXX const *const &p_tik, CPointX const *const &p_tk)
Initialize randomly the parameters of the Gaussian mixture.
IMixtureDensity< HDMatrixGaussianModel< IdRow_, IdCol_, Array_ > > Base
Base class.
bool runCommonOrientationByCol(CArrayXX const *const &p_tik, CPointX const *const &p_tk)
Update parameters for models with common orientation by columns.
bool runFreeOrientationByCol(CArrayXX const *const &p_tik, CPointX const *const &p_tk)
Update parameters for models with free orientation by columns.
HDMatrixGaussianModel(int nbCluster)
constructor
bool runCommonOrientationByRow(CArrayXX const *const &p_tik, CPointX const *const &p_tk)
Update parameters for models with common orientation by rows.
bool run(CArrayXX const *const &p_tik, CPointX const *const &p_tk)
Compute the weighted mean and the common standard deviation.
bool isColAj_
Structure of the covariance matrices between clusters for the columns.
int nbRow_
number of rows and columns of the data
HDMatrixModelParameters< Array_ > Parameters
Type of the structure storing the parameters of a MixturGaussian_sjk model.
bool isRowAj_
Structure of the covariance matrices between clusters for the rows.
HDMatrixGaussianModel(HDMatrixGaussianModel const &model)
constructor
bool runFreeOrientationByRow(CArrayXX const *const &p_tik, CPointX const *const &p_tk)
Update parameters for models with free orientation by rows.
~HDMatrixGaussianModel()
destructor
int computeNbFreeParameters() const
Base class for all Mixture densities.
Array const *const & p_data() const
Parameters param_
parameters of the derived mixture model.
virtual Real rand() const
Generate a pseudo Exponential random variate.
Real rand() const
Generate a pseudo Normal random variate.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
Index sub-vector region: Specialization when the size is unknown.
Arrays::SumOp< Lhs, Rhs >::result_type sum(Lhs const &lhs, Rhs const &rhs)
convenience function for summing two arrays
double Real
STK fundamental type of Real values.
The namespace STK is the main domain space of the Statistical ToolKit project.
HDMatrixModelParameters< Array_ > Parameters
Type of the structure storing the parameters of a MixturGaussian_sjk model.
Main class for the mixtures traits policy.