mlpack  2.2.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
GaussianDistribution Class Reference

A single multivariate Gaussian distribution. More...

Public Member Functions

 GaussianDistribution ()
 Default constructor, which creates a Gaussian with zero dimension. More...
 
 GaussianDistribution (const size_t dimension)
 Create a Gaussian distribution with zero mean and identity covariance with the given dimensionality. More...
 
 GaussianDistribution (const arma::vec &mean, const arma::mat &covariance)
 Create a Gaussian distribution with the given mean and covariance. More...
 
const arma::mat & Covariance () const
 Return the covariance matrix. More...
 
void Covariance (const arma::mat &covariance)
 Set the covariance. More...
 
void Covariance (arma::mat &&covariance)
 
size_t Dimensionality () const
 Return the dimensionality of this distribution. More...
 
double LogProbability (const arma::vec &observation) const
 Return the log probability of the given observation. More...
 
void LogProbability (const arma::mat &x, arma::vec &logProbabilities) const
 Calculates the multivariate Gaussian log probability density function for each data point (column) in the given matrix. More...
 
const arma::vec & Mean () const
 Return the mean. More...
 
arma::vec & Mean ()
 Return a modifiable copy of the mean. More...
 
double Probability (const arma::vec &observation) const
 Return the probability of the given observation. More...
 
void Probability (const arma::mat &x, arma::vec &probabilities) const
 Calculates the multivariate Gaussian probability density function for each data point (column) in the given matrix. More...
 
arma::vec Random () const
 Return a randomly generated observation according to the probability distribution defined by this object. More...
 
template<typename Archive >
void Serialize (Archive &ar, const unsigned int)
 Serialize the distribution. More...
 
void Train (const arma::mat &observations)
 Estimate the Gaussian distribution directly from the given observations. More...
 
void Train (const arma::mat &observations, const arma::vec &probabilities)
 Estimate the Gaussian distribution from the given observations, taking into account the probability of each observation actually being from this distribution. More...
 

Detailed Description

A single multivariate Gaussian distribution.

Definition at line 24 of file gaussian_distribution.hpp.

Constructor & Destructor Documentation

Default constructor, which creates a Gaussian with zero dimension.

Definition at line 45 of file gaussian_distribution.hpp.

GaussianDistribution ( const size_t  dimension)
inline

Create a Gaussian distribution with zero mean and identity covariance with the given dimensionality.

Definition at line 51 of file gaussian_distribution.hpp.

GaussianDistribution ( const arma::vec &  mean,
const arma::mat &  covariance 
)

Create a Gaussian distribution with the given mean and covariance.

covariance is expected to be positive definite.

Member Function Documentation

const arma::mat& Covariance ( ) const
inline

Return the covariance matrix.

Definition at line 136 of file gaussian_distribution.hpp.

Referenced by RegressionDistribution::RegressionDistribution().

void Covariance ( const arma::mat &  covariance)

Set the covariance.

void Covariance ( arma::mat &&  covariance)
size_t Dimensionality ( ) const
inline

Return the dimensionality of this distribution.

Definition at line 69 of file gaussian_distribution.hpp.

double LogProbability ( const arma::vec &  observation) const

Return the log probability of the given observation.

Referenced by GaussianDistribution::Probability().

void LogProbability ( const arma::mat &  x,
arma::vec &  logProbabilities 
) const
inline

Calculates the multivariate Gaussian log probability density function for each data point (column) in the given matrix.

Parameters
xList of observations.
probabilitiesOutput log probabilities for each input observation.

Definition at line 177 of file gaussian_distribution.hpp.

const arma::vec& Mean ( ) const
inline

Return the mean.

Definition at line 126 of file gaussian_distribution.hpp.

arma::vec& Mean ( )
inline

Return a modifiable copy of the mean.

Definition at line 131 of file gaussian_distribution.hpp.

double Probability ( const arma::vec &  observation) const
inline

Return the probability of the given observation.

Definition at line 74 of file gaussian_distribution.hpp.

References GaussianDistribution::LogProbability().

void Probability ( const arma::mat &  x,
arma::vec &  probabilities 
) const
inline

Calculates the multivariate Gaussian probability density function for each data point (column) in the given matrix.

Parameters
xList of observations.
probabilitiesOutput probabilities for each input observation.

Definition at line 91 of file gaussian_distribution.hpp.

References GaussianDistribution::LogProbability().

arma::vec Random ( ) const

Return a randomly generated observation according to the probability distribution defined by this object.

Returns
Random observation from this Gaussian distribution.
void Serialize ( Archive &  ar,
const unsigned  int 
)
inline

Serialize the distribution.

Definition at line 149 of file gaussian_distribution.hpp.

References mlpack::data::CreateNVP().

void Train ( const arma::mat &  observations)

Estimate the Gaussian distribution directly from the given observations.

Parameters
observationsList of observations.
void Train ( const arma::mat &  observations,
const arma::vec &  probabilities 
)

Estimate the Gaussian distribution from the given observations, taking into account the probability of each observation actually being from this distribution.


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