37#ifndef STK_GAUSSIANMODEL_H
38#define STK_GAUSSIANMODEL_H
102template <
class Array>
105 , cov_(p_dataij_->cols())
112template <
class Array>
120template <
class Array>
122{
if (p_law_)
delete p_law_;}
127template <
class Array>
137 else p_law_->setParameters(mean_, cov_);
139 this->setLnLikelihood(p_law_->lnLikelihood(*p_dataij_ ));
148template <
class Array>
152 this->compWeightedMean(
weights);
154 compWeightedCovariance(
weights);
158 else p_law_->setParameters(mean_, cov_);
160 this->setLnLikelihood(p_law_->lnLikelihood(*p_dataij_ ));
166template <
class Array>
172template <
class Array>
In this file we define the Interface class IGaussianModel.
In this file we define the multivariate Normal law.
In this file we specialize the class Multivariate to Real type.
Compute the maximum likelihood estimates of a complete Gaussian statistical model.
ArraySquareX const & covariance() const
get the empirical covariance
hidden::Traits< Array >::Col ColVector
void compCovariance()
compute the empirical covariance matrix.
GaussianModel(Array const *p_data)
constructor.
hidden::Traits< Array >::Row RowVector
MultiLaw::Normal< RowVector > *const & p_law() const
Accessor to the normal law.
void compWeightedCovariance(ColVector const &weights)
compute the empirical weighted covariance matrix.
IGaussianModel< Array > Base
ArraySquareX cov_
ArrayXX of the empirical covaiance.
MultiLaw::Normal< RowVector > * p_law_
pointer on the normal law
bool run()
implementation of the Gaussian statistical model
~GaussianModel()
destructor.
Compute the the maximum likelihood estimates of a complete Gaussian statistical model.
RowVector mean_
Vector of the empirical means.
void setNbFreeParameter(int const &nbFreeParameter)
set the number of free parameters of the model
Data const * p_dataij_
A pointer on the original data set.
Class for the multivariate Normal distribution.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
Real covariance(ExprBase< XArray > const &X, ExprBase< YArray > const &Y, bool unbiased=false)
Compute the covariance of the variables X and Y.
The namespace STK is the main domain space of the Statistical ToolKit project.