AUTh-ARL Core Stack  0.7
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
arl::math::Mvn Class Reference

Represents a Multivariate Normal Distribution. It provides functionalities like getting its PDF or generating random vectors from this distribution. More...

#include <mvn.h>

Public Member Functions

 Mvn (const Eigen::VectorXd &mu, const Eigen::MatrixXd &s)
 Default constructor. More...
 
 ~Mvn ()
 
double pdf (const Eigen::VectorXd &x) const
 The Probability Density Function of the Mualtivariate Normal Distribution. More...
 
Eigen::VectorXd sample (unsigned int nr_iterations=20) const
 Generates a random vector based ont Mutlivariate distribution. More...
 

Public Attributes

Eigen::VectorXd mean
 The vector for the mean for this class. Is public and you can change it, with your responsibility. More...
 
Eigen::MatrixXd sigma
 The convariance matrix for this class. Is public and you can change it, with your responsibility. More...
 

Detailed Description

Represents a Multivariate Normal Distribution. It provides functionalities like getting its PDF or generating random vectors from this distribution.

Constructor & Destructor Documentation

arl::math::Mvn::Mvn ( const Eigen::VectorXd &  mu,
const Eigen::MatrixXd &  s 
)

Default constructor.

Parameters
muThe vector for the mean value
sThe convariance matrix. This should be a symmetric semi-positive matrix.
arl::math::Mvn::~Mvn ( )

Member Function Documentation

double arl::math::Mvn::pdf ( const Eigen::VectorXd &  x) const

The Probability Density Function of the Mualtivariate Normal Distribution.

Which is

$ p_X(\mu, \Sigma) = \frac{1}{(2\pi)^{n/2}|\Sigma|^{1/2}}exp(-0.5(x - \mu)^T\Sigma^{-1}(x - \mu))$

Parameters
xThe value the random variable
Eigen::VectorXd arl::math::Mvn::sample ( unsigned int  nr_iterations = 20) const

Generates a random vector based ont Mutlivariate distribution.

Parameters
nr_iterationsThe number of iterations for producing random numbers from the univariate distribution. The larger the number the more accurate the approximation of the distribution, but this reduces computational performance, of course. Defaults to 20.

Member Data Documentation

Eigen::VectorXd arl::math::Mvn::mean

The vector for the mean for this class. Is public and you can change it, with your responsibility.

Eigen::MatrixXd arl::math::Mvn::sigma

The convariance matrix for this class. Is public and you can change it, with your responsibility.