ssmkit  master-68aed98
Gaussian Class Reference

A D-dimensional multivariate Gaussian distribution. More...

Public Types

using TParameterVAR = std::tuple< arma::vec, arma::mat >
 Data type of the parameter variable \( \theta = \{\mu, \Sigma\} \). More...
 

Public Member Functions

 Gaussian ()=delete
 
 Gaussian (int dim)
 Default constructor. More...
 
 Gaussian (arma::vec mean, arma::mat covariance)
 Returns D dimensional Gaussian with given mean and covariance. More...
 
arma::vec random ()
 Returns a random variable from the distribution. More...
 
double likelihood (const arma::vec &rv) const
 Returns the likelihood of a given random variable. More...
 
Gaussianparameterize (const TParameterVAR &parameters)
 Changes the mean and covariance of the distribution with the given parameters. More...
 
Gaussianparameterize (const arma::vec &mean, const arma::mat &covariance)
 Changes the mean and covariance of the distribution with the given values. More...
 
const arma::vec & getMean () const
 Returns the mean vector. More...
 
const arma::mat & getCovariance () const
 Returns the covariance matrix. More...
 

Detailed Description

A D-dimensional multivariate Gaussian distribution.

\[ \mathcal{N}(\mathbf{x}| \mu, \Sigma) = \frac{1}{(2\pi)^{D/2}\sqrt{|\Sigma|}} \exp(-\frac{1}{2}\mathbf{x}^T\Sigma^{-1}\mathbf{x})\]

Definition at line 24 of file gaussian.hpp.

Member Typedef Documentation

using TParameterVAR = std::tuple<arma::vec, arma::mat>

Data type of the parameter variable \( \theta = \{\mu, \Sigma\} \).

Definition at line 28 of file gaussian.hpp.

Constructor & Destructor Documentation

Gaussian ( )
delete
Gaussian ( int  dim)
inline

Default constructor.

Returns D dimensional Gaussian distribution with zero mean and identity covariance matrix.

Definition at line 70 of file gaussian.hpp.

Gaussian ( arma::vec  mean,
arma::mat  covariance 
)
inline

Returns D dimensional Gaussian with given mean and covariance.

The covariance should be positive definite.

Parameters
meanThe mean vector.
covarianceThe covariance matrix.

Definition at line 79 of file gaussian.hpp.

Member Function Documentation

arma::vec random ( )
inline

Returns a random variable from the distribution.

\[ \mathbf{x} \sim \mathcal{N}(\mu, \Sigma) \]

Returns
The random vector \(\mathbf{x}\)

Definition at line 88 of file gaussian.hpp.

References Generator::get().

double likelihood ( const arma::vec &  rv) const
inline

Returns the likelihood of a given random variable.

\[p(\mathbf{x}) = \frac{1}{(2\pi)^{D/2}\sqrt{|\Sigma|}} \exp(-\frac{1}{2}\mathbf{x}^T\Sigma^{-1}\mathbf{x})\]

Parameters
rvThe random variable \(\mathbf{x}\) for which likelihood is calculated.
Returns
\(p(\mathbf{x})\).

Definition at line 101 of file gaussian.hpp.

Gaussian& parameterize ( const TParameterVAR parameters)
inline

Changes the mean and covariance of the distribution with the given parameters.

Parameters
parametersA tuple containing mean and covariance.
Returns
Reference to the current instance.

Definition at line 113 of file gaussian.hpp.

Gaussian& parameterize ( const arma::vec &  mean,
const arma::mat &  covariance 
)
inline

Changes the mean and covariance of the distribution with the given values.

Parameters
meanThe mean vector.
covarianceThe covariance matrix.
Returns
Reference to the current instance.

Definition at line 122 of file gaussian.hpp.

const arma::vec& getMean ( ) const
inline

Returns the mean vector.

Definition at line 130 of file gaussian.hpp.

const arma::mat& getCovariance ( ) const
inline

Returns the covariance matrix.

Definition at line 132 of file gaussian.hpp.


The documentation for this class was generated from the following file: