$search

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]

List of all members.

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.
 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::matgetCovariance () 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::vecgetMean () const
 Returns the mean of the Gaussian.
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.
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

GaussianStructptr_

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 50 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:
dim The 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:
mean The mean vector of the Gaussian
cov The 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 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.

Parameters:
v The 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.

bool Gaussian::getExpectedValue ( arma::vec v  )  const [virtual]

Returns the expected value E[x] of the Gaussian, which corresponds to its mean.

Parameters:
v The 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:
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.

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

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

Definition at line 157 of file Gaussian.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


problib
Author(s): Sjoerd van den Dries
autogenerated on Tue Mar 5 12:28:32 2013