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... | |
const arma::mat & | InvCov () const |
Return the invCov. More... | |
double | LogDetCov () const |
Return the logDetCov. 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 |
Returns the Log probability of 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 uint32_t) |
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... | |
A single multivariate Gaussian distribution.
Definition at line 24 of file gaussian_distribution.hpp.
|
inline |
Default constructor, which creates a Gaussian with zero dimension.
Definition at line 45 of file gaussian_distribution.hpp.
Referenced by GaussianDistribution::GaussianDistribution().
|
inline |
Create a Gaussian distribution with zero mean and identity covariance with the given dimensionality.
Definition at line 51 of file gaussian_distribution.hpp.
References GaussianDistribution::GaussianDistribution().
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.
|
inline |
Return the covariance matrix.
Definition at line 156 of file gaussian_distribution.hpp.
Referenced by RegressionDistribution::RegressionDistribution().
void Covariance | ( | const arma::mat & | covariance | ) |
Set the covariance.
void Covariance | ( | arma::mat && | covariance | ) |
|
inline |
Return the dimensionality of this distribution.
Definition at line 69 of file gaussian_distribution.hpp.
|
inline |
Return the invCov.
Definition at line 166 of file gaussian_distribution.hpp.
|
inline |
Return the logDetCov.
Definition at line 169 of file gaussian_distribution.hpp.
double LogProbability | ( | const arma::vec & | observation | ) | const |
Return the log probability of the given observation.
Referenced by GaussianDistribution::Probability().
|
inline |
Returns the Log probability of the given matrix.
These values are stored in logProbabilities.
x | List of observations. |
logProbabilities | Output log probabilities for each input observation. |
Definition at line 108 of file gaussian_distribution.hpp.
References GaussianDistribution::Random(), and GaussianDistribution::Train().
|
inline |
Return the mean.
Definition at line 146 of file gaussian_distribution.hpp.
|
inline |
Return a modifiable copy of the mean.
Definition at line 151 of file gaussian_distribution.hpp.
|
inline |
Return the probability of the given observation.
Definition at line 74 of file gaussian_distribution.hpp.
References GaussianDistribution::LogProbability().
|
inline |
Calculates the multivariate Gaussian probability density function for each data point (column) in the given matrix.
x | List of observations. |
probabilities | Output 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.
Referenced by LogisticRegressionTestData(), and GaussianDistribution::LogProbability().
|
inline |
Serialize the distribution.
Definition at line 175 of file gaussian_distribution.hpp.
void Train | ( | const arma::mat & | observations | ) |
Estimate the Gaussian distribution directly from the given observations.
observations | List of observations. |
Referenced by GaussianDistribution::LogProbability().
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.