KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Friends | List of all members
kjb::MV_gaussian_distribution Class Reference

Multivariate Gaussian (normal) distribution. More...

#include <prob_distribution.h>

Public Member Functions

 MV_gaussian_distribution (int d)
 Constructs a d-dimensinoal multivariate Gaussian with a mean of zero and a covariance matrix of identity. More...
 
 MV_gaussian_distribution (const Vector &mu, const Matrix &sigma)
 Constructs a multivariate Gaussian with a mean of mu and a covariance matrix of sigma. sigma must be positive-definite. More...
 
 MV_gaussian_distribution (const Vector &mu, const Vector &sigma_diag)
 Constructs a multivariate Gaussian with a mean of mu and a covariance matrix diag(sigma_diag). More...
 
const Vectorget_mean () const
 Gets the mean of this distribution. More...
 
const Matrixget_covariance_matrix () const
 Gets the covariance matrix of this distribution. More...
 
void set_mean (const Vector &m)
 Gets the mean of this distribution. More...
 
void set_covariance_matrix (const Matrix &S)
 Gets the covariance matrix of this distribution. More...
 
void set_covariance_matrix (const Matrix &S, const Vector &m)
 Gets the covariance matrix of this distribution. More...
 
int get_dimension () const
 Gets the dimension of this distribution. More...
 
MV_gaussian_conditional_distribution conditional (int i) const
 Conditional distribution of the ith variable given the rest. More...
 

Friends

double pdf (const MV_gaussian_distribution &, const Vector &)
 Computes the joint PDF of a multivariate Gaussian at x. More...
 
double log_pdf (const MV_gaussian_distribution &, const Vector &)
 Computes the log PDF a multivariate normal distribution at x. More...
 
Vector sample (const MV_gaussian_distribution &)
 Sample from a multivariate normal distribution. More...
 

Detailed Description

Multivariate Gaussian (normal) distribution.

This class implements a multivariate Gaussian distribution.

Constructor & Destructor Documentation

kjb::MV_gaussian_distribution::MV_gaussian_distribution ( int  d)
inline

Constructs a d-dimensinoal multivariate Gaussian with a mean of zero and a covariance matrix of identity.

Parameters
dThe dimension of the distribution.
kjb::MV_gaussian_distribution::MV_gaussian_distribution ( const Vector mu,
const Matrix sigma 
)
inline

Constructs a multivariate Gaussian with a mean of mu and a covariance matrix of sigma. sigma must be positive-definite.

Parameters
muThe mean of the distribution.
sigmaThe covariance matrix of the distribution.
kjb::MV_gaussian_distribution::MV_gaussian_distribution ( const Vector mu,
const Vector sigma_diag 
)
inline

Constructs a multivariate Gaussian with a mean of mu and a covariance matrix diag(sigma_diag).

Parameters
muThe mean of the distribution.
sigma_diagThe diagonal of the covariance matrix.

Member Function Documentation

MV_gaussian_conditional_distribution kjb::MV_gaussian_distribution::conditional ( int  i) const

Conditional distribution of the ith variable given the rest.

const Matrix& kjb::MV_gaussian_distribution::get_covariance_matrix ( ) const
inline

Gets the covariance matrix of this distribution.

int kjb::MV_gaussian_distribution::get_dimension ( ) const
inline

Gets the dimension of this distribution.

const Vector& kjb::MV_gaussian_distribution::get_mean ( ) const
inline

Gets the mean of this distribution.

void kjb::MV_gaussian_distribution::set_covariance_matrix ( const Matrix S)
inline

Gets the covariance matrix of this distribution.

void kjb::MV_gaussian_distribution::set_covariance_matrix ( const Matrix S,
const Vector m 
)
inline

Gets the covariance matrix of this distribution.

void kjb::MV_gaussian_distribution::set_mean ( const Vector m)
inline

Gets the mean of this distribution.

Friends And Related Function Documentation

double log_pdf ( const MV_gaussian_distribution ,
const Vector  
)
friend

Computes the log PDF a multivariate normal distribution at x.

This is a specialization of the generic joint_log_pdf function. It is specialized to avoid the computation of the log of the exponential.

double pdf ( const MV_gaussian_distribution ,
const Vector  
)
friend

Computes the joint PDF of a multivariate Gaussian at x.

Vector sample ( const MV_gaussian_distribution )
friend

Sample from a multivariate normal distribution.


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