Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
pbl::Gaussian Class Reference

This class represents a multi-variate Gaussian (Normal) distribution. More...

#include <Gaussian.h>

Inheritance diagram for pbl::Gaussian:
Inheritance graph
[legend]

Classes

struct  GaussianStruct
 

Public Member Functions

Gaussianclone () 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. More...
 
 Gaussian (int dim)
 Constructs a (multi-variate) Gaussian with specific dimensionality but leaves mean and covariance unspecified. More...
 
 Gaussian (const arma::vec &mean, const arma::mat &cov)
 Constructs a (multi-variate) Gaussian with specified mean and covariance. More...
 
 Gaussian (const Gaussian &orig)
 Copy constructor. More...
 
const arma::matgetCovariance () const
 Returns the covariance matrix of the Gaussian. More...
 
double getDensity (const arma::vec &v, double max_mah_dist=0) const
 Calculates the density of the Gaussian at point v. More...
 
double getDensity (const Gaussian &npdf, double max_mah_dist=0) const
 
bool getExpectedValue (arma::vec &v) const
 Returns the expected value E[x] of the Gaussian, which corresponds to its mean. More...
 
double getLikelihood (const PDF &pdf) const
 
double getMaxDensity () const
 Calculates the maximum density of the Gaussian, i.e., the density at the mean. More...
 
const arma::vecgetMean () const
 Returns the mean of the Gaussian. More...
 
Gaussianoperator= (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. More...
 
void setCovariance (const arma::mat &cov)
 Sets the covariance of the Gaussian. More...
 
void setMean (const arma::vec &mu)
 Sets the mean of the Gaussian. More...
 
std::string toString (const std::string &indent="") const
 Represents the Gaussian as a string for easier console output. More...
 
virtual ~Gaussian ()
 Destructor. More...
 
- Public Member Functions inherited from pbl::PDF
int dimensions () const
 
virtual bool getExpectedValue (std::string &v) const
 
 PDF (int dimensions, PDFType type)
 
 PDF (const PDF &orig)
 
PDFType type () const
 
virtual ~PDF ()
 

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

GaussianStructptr_
 
- Protected Attributes inherited from pbl::PDF
int dimensions_
 
PDFType type_
 

Additional Inherited Members

- Public Types inherited from pbl::PDF
enum  PDFType {
  GAUSSIAN, MIXTURE, UNIFORM, DISCRETE,
  EXACT, HYBRID, UNKNOWN
}
 

Detailed Description

This class represents a multi-variate Gaussian (Normal) distribution.

Author
Sjoerd van den Dries
Date
December, 2012
Version
1.0

Definition at line 51 of file Gaussian.h.

Constructor & Destructor Documentation

Gaussian::Gaussian ( int  dim)

Constructs a (multi-variate) Gaussian with specific dimensionality but leaves mean and covariance unspecified.

Parameters
dimThe dimensionality of the Gaussian

Definition at line 42 of file Gaussian.cpp.

Gaussian::Gaussian ( const arma::vec mean,
const arma::mat cov 
)

Constructs a (multi-variate) Gaussian with specified mean and covariance.

Parameters
meanThe mean vector of the Gaussian
covThe covariance matrix of the Gaussian

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.

Member Function Documentation

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.

Returns
The covariance matrix of the Gaussian

Definition at line 186 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.

Parameters
vThe point to calculate the density for
max_mah_dist
Returns
The density of the Gaussian at point v.

Definition at line 106 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 v1,
const arma::vec v2,
const arma::mat S,
double  max_mah_dist = 0 
) const
protected

Definition at line 128 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.

Parameters
vThe returned expected value
Returns
Always true

Reimplemented from pbl::PDF.

Definition at line 122 of file Gaussian.cpp.

double Gaussian::getLikelihood ( const PDF 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.

Returns
The maximum density of the Gaussian.

Implements pbl::PDF.

Definition at line 117 of file Gaussian.cpp.

const arma::vec & Gaussian::getMean ( ) const

Returns the mean of the Gaussian.

Returns
The mean of the Gaussian

Definition at line 181 of file Gaussian.cpp.

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.

Definition at line 64 of file Gaussian.cpp.

void Gaussian::setCovariance ( const arma::mat cov)

Sets the covariance of the Gaussian.

Parameters
covThe 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.

Parameters
muThe 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.

Note
Should be changed into stream operator <<
Returns
The Gaussian as string

Implements pbl::PDF.

Definition at line 191 of file Gaussian.cpp.

Member Data Documentation

GaussianStruct* pbl::Gaussian::ptr_
protected

Definition at line 167 of file Gaussian.h.


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


problib
Author(s): Sjoerd van den Dries, Jos Elfring
autogenerated on Fri Apr 16 2021 02:32:19