ssmkit
master-68aed98
|
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... | |
Gaussian & | parameterize (const TParameterVAR ¶meters) |
Changes the mean and covariance of the distribution with the given parameters. More... | |
Gaussian & | parameterize (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... | |
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.
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.
|
delete |
|
inline |
Default constructor.
Returns D dimensional Gaussian distribution with zero mean and identity covariance matrix.
Definition at line 70 of file gaussian.hpp.
|
inline |
Returns D dimensional Gaussian with given mean and covariance.
The covariance should be positive definite.
mean | The mean vector. |
covariance | The covariance matrix. |
Definition at line 79 of file gaussian.hpp.
|
inline |
Returns a random variable from the distribution.
\[ \mathbf{x} \sim \mathcal{N}(\mu, \Sigma) \]
Definition at line 88 of file gaussian.hpp.
References Generator::get().
|
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})\]
rv | The random variable \(\mathbf{x}\) for which likelihood is calculated. |
Definition at line 101 of file gaussian.hpp.
|
inline |
Changes the mean and covariance of the distribution with the given parameters.
parameters | A tuple containing mean and covariance. |
Definition at line 113 of file gaussian.hpp.
|
inline |
Changes the mean and covariance of the distribution with the given values.
mean | The mean vector. |
covariance | The covariance matrix. |
Definition at line 122 of file gaussian.hpp.
|
inline |
Returns the mean vector.
Definition at line 130 of file gaussian.hpp.
|
inline |
Returns the covariance matrix.
Definition at line 132 of file gaussian.hpp.