mlpack
Public Member Functions | List of all members
mlpack::distribution::DiagonalGaussianDistribution Class Reference

A single multivariate Gaussian distribution with diagonal covariance. More...

#include <diagonal_gaussian_distribution.hpp>

Public Member Functions

 DiagonalGaussianDistribution ()
 Default constructor, which creates a Gaussian with zero dimension.
 
 DiagonalGaussianDistribution (const size_t dimension)
 Create a Gaussian Distribution with zero mean and diagonal covariance with the given dimensionality. More...
 
 DiagonalGaussianDistribution (const arma::vec &mean, const arma::vec &covariance)
 Create a Gaussian distribution with the given mean and diagonal covariance. More...
 
size_t Dimensionality () const
 Return the dimensionality of this distribution.
 
double Probability (const arma::vec &observation) const
 Return the probability of the given observation.
 
double LogProbability (const arma::vec &observation) const
 Return the log probability of the given observation.
 
void Probability (const arma::mat &x, arma::vec &probabilities) const
 Calculate the multivariate Gaussian probability density function for each data point (column) in the given matrix. More...
 
void LogProbability (const arma::mat &observations, arma::vec &logProbabilities) const
 Calculate the multivariate Gaussian log 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...
 
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...
 
const arma::vec & Mean () const
 Return the mean.
 
arma::vec & Mean ()
 Return a modifiable copy of the mean.
 
const arma::vec & Covariance () const
 Return the covariance matrix.
 
void Covariance (const arma::vec &covariance)
 Set the covariance matrix.
 
void Covariance (arma::vec &&covariance)
 Set the covariance matrix using move assignment.
 
template<typename Archive >
void serialize (Archive &ar, const uint32_t)
 Serialize the distribution.
 

Detailed Description

A single multivariate Gaussian distribution with diagonal covariance.

Constructor & Destructor Documentation

◆ DiagonalGaussianDistribution() [1/2]

mlpack::distribution::DiagonalGaussianDistribution::DiagonalGaussianDistribution ( const size_t  dimension)
inline

Create a Gaussian Distribution with zero mean and diagonal covariance with the given dimensionality.

Parameters
dimensionNumber of dimensions.

◆ DiagonalGaussianDistribution() [2/2]

DiagonalGaussianDistribution::DiagonalGaussianDistribution ( const arma::vec &  mean,
const arma::vec &  covariance 
)

Create a Gaussian distribution with the given mean and diagonal covariance.

Parameters
meanMean of distribution.
covarianceCovariance of distribution.

Member Function Documentation

◆ LogProbability()

void DiagonalGaussianDistribution::LogProbability ( const arma::mat &  observations,
arma::vec &  logProbabilities 
) const

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

Parameters
observationsMatrix of observations.
logProbabilitiesOutput log probabilities for each observation.

◆ Probability()

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

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

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

◆ Random()

arma::vec DiagonalGaussianDistribution::Random ( ) const

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

Returns
Random observation from this Diagonal Gaussian distribution.

◆ Train() [1/2]

void DiagonalGaussianDistribution::Train ( const arma::mat &  observations)

Estimate the Gaussian distribution directly from the given observations.

Parameters
observationsMatrix of observations.

◆ Train() [2/2]

void DiagonalGaussianDistribution::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.

Parameters
observationsMatrix of observations.
probabilitiesList of probability of the each observation being from this distribution.

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