$search
This class represents a multi-variate Gaussian (Normal) distribution. More...
#include <Gaussian.h>
Classes | |
struct | GaussianStruct |
Public Member Functions | |
Gaussian * | clone () const |
Creates a clone of the object. The clone method is cheap since it only copies a pointer. A deep clone will only be created if the original object is modified. | |
Gaussian (const Gaussian &orig) | |
Copy constructor. | |
Gaussian (const arma::vec &mean, const arma::mat &cov) | |
Constructs a (multi-variate) Gaussian with specified mean and covariance. | |
Gaussian (int dim) | |
Constructs a (multi-variate) Gaussian with specific dimensionality but leaves mean and covariance unspecified. | |
const arma::mat & | getCovariance () const |
Returns the covariance matrix of the Gaussian. | |
double | getDensity (const Gaussian &npdf, double max_mah_dist=0) const |
double | getDensity (const arma::vec &v, double max_mah_dist=0) const |
Calculates the density of the Gaussian at point v. | |
bool | getExpectedValue (arma::vec &v) const |
Returns the expected value E[x] of the Gaussian, which corresponds to its mean. | |
double | getLikelihood (const PDF &pdf) const |
double | getMaxDensity () const |
Calculates the maximum density of the Gaussian, i.e., the density at the mean. | |
const arma::vec & | getMean () const |
Returns the mean of the Gaussian. | |
Gaussian & | operator= (const Gaussian &other) |
Assignment operator. The operation is cheap since it only copies a pointer. A deep clone will only be created if the original object is modified. | |
void | setCovariance (const arma::mat &cov) |
Sets the covariance of the Gaussian. | |
void | setMean (const arma::vec &mu) |
Sets the mean of the Gaussian. | |
std::string | toString (const std::string &indent="") const |
Represents the Gaussian as a string for easier console output. | |
virtual | ~Gaussian () |
Destructor. | |
Protected Member Functions | |
void | cloneStruct () |
double | getDensity (const arma::vec &v1, const arma::vec &v2, const arma::mat &S, double max_mah_dist=0) const |
Protected Attributes | |
GaussianStruct * | ptr_ |
This class represents a multi-variate Gaussian (Normal) distribution.
Definition at line 50 of file Gaussian.h.
Gaussian::Gaussian | ( | int | dim | ) |
Constructs a (multi-variate) Gaussian with specific dimensionality but leaves mean and covariance unspecified.
dim | The dimensionality of the Gaussian |
Definition at line 42 of file Gaussian.cpp.
Constructs a (multi-variate) Gaussian with specified mean and covariance.
Definition at line 45 of file Gaussian.cpp.
Gaussian::Gaussian | ( | const Gaussian & | orig | ) |
Copy constructor.
Definition at line 48 of file Gaussian.cpp.
Gaussian::~Gaussian | ( | ) | [virtual] |
Destructor.
Definition at line 54 of file Gaussian.cpp.
Gaussian * Gaussian::clone | ( | ) | const [virtual] |
Creates a clone of the object. The clone method is cheap since it only copies a pointer. A deep clone will only be created if the original object is modified.
Implements pbl::PDF.
Definition at line 80 of file Gaussian.cpp.
void Gaussian::cloneStruct | ( | ) | [protected] |
Definition at line 84 of file Gaussian.cpp.
const arma::mat & Gaussian::getCovariance | ( | ) | const |
Returns the covariance matrix of the Gaussian.
Definition at line 186 of file Gaussian.cpp.
double Gaussian::getDensity | ( | const arma::vec & | v1, | |
const arma::vec & | v2, | |||
const arma::mat & | S, | |||
double | max_mah_dist = 0 | |||
) | const [protected] |
Definition at line 128 of file Gaussian.cpp.
double Gaussian::getDensity | ( | const Gaussian & | npdf, | |
double | max_mah_dist = 0 | |||
) | const |
Definition at line 111 of file Gaussian.cpp.
double Gaussian::getDensity | ( | const arma::vec & | v, | |
double | max_mah_dist = 0 | |||
) | const |
Calculates the density of the Gaussian at point v.
v | The point to calculate the density for | |
max_mah_dist |
Definition at line 106 of file Gaussian.cpp.
bool Gaussian::getExpectedValue | ( | arma::vec & | v | ) | const [virtual] |
Returns the expected value E[x] of the Gaussian, which corresponds to its mean.
v | The returned expected value |
Reimplemented from pbl::PDF.
Definition at line 122 of file Gaussian.cpp.
double Gaussian::getLikelihood | ( | const PDF & | ) | const [virtual] |
Implements pbl::PDF.
Definition at line 91 of file Gaussian.cpp.
double Gaussian::getMaxDensity | ( | ) | const [virtual] |
Calculates the maximum density of the Gaussian, i.e., the density at the mean.
Implements pbl::PDF.
Definition at line 117 of file Gaussian.cpp.
const arma::vec & Gaussian::getMean | ( | ) | const |
Returns the mean of the Gaussian.
Definition at line 181 of file Gaussian.cpp.
Assignment operator. The operation is cheap since it only copies a pointer. A deep clone will only be created if the original object is modified.
Definition at line 64 of file Gaussian.cpp.
void Gaussian::setCovariance | ( | const arma::mat & | cov | ) |
Sets the covariance of the Gaussian.
cov | The covariance matrix of the Gaussian |
Definition at line 171 of file Gaussian.cpp.
void Gaussian::setMean | ( | const arma::vec & | mu | ) |
Sets the mean of the Gaussian.
mu | The mean of the Gaussian |
Definition at line 161 of file Gaussian.cpp.
std::string Gaussian::toString | ( | const std::string & | indent = "" |
) | const [virtual] |
Represents the Gaussian as a string for easier console output.
Implements pbl::PDF.
Definition at line 191 of file Gaussian.cpp.
GaussianStruct* pbl::Gaussian::ptr_ [protected] |
Definition at line 157 of file Gaussian.h.