A Gaussian with variance independent in each dimension. More...
#include <vpdl_gaussian.h>
Public Types | |
typedef vpdt_field_default< T, n >::type | vector |
the data type used for vectors. | |
typedef vpdt_field_traits < vector >::matrix_type | matrix |
the data type used for matrices. | |
typedef matrix | covar_type |
the type used internally for covariance. | |
typedef vpdt_field_default< T, n >::type | field_type |
the data type used for vectors. | |
Public Member Functions | |
vpdl_gaussian (unsigned int var_dim=n) | |
Constructor. | |
vpdl_gaussian (const vector &mean_val, const covar_type &covar) | |
Constructor - from mean and variance. | |
virtual | ~vpdl_gaussian () |
Destructor. | |
virtual vpdl_distribution< T, n > * | clone () const |
Create a copy on the heap and return base class pointer. | |
virtual unsigned int | dimension () const |
Return the run time dimension, which does not equal n when n==0 . | |
virtual T | density (const vector &pt) const |
Evaluate the unnormalized density at a point. | |
virtual T | prob_density (const vector &pt) const |
Evaluate the probability density at a point. | |
virtual T | log_prob_density (const vector &pt) const |
Evaluate the log probability density at a point. | |
virtual T | gradient_density (const vector &pt, vector &g) const |
Compute the gradient of the unnormalized density at a point. | |
virtual T | norm_const () const |
The normalization constant for the density. | |
T | sqr_mahal_dist (const vector &pt) const |
The squared Mahalanobis distance to this point. | |
virtual T | cumulative_prob (const vector &pt) const |
Evaluate the cumulative distribution function at a point. | |
virtual const vector & | mean () const |
Access the mean directly. | |
virtual void | set_mean (const vector &mean_val) |
Set the mean. | |
virtual void | compute_mean (vector &mean_val) const |
Compute the mean of the distribution. | |
covar_type | covariance () const |
Access the covariance - requires computation. | |
void | set_covariance (const covar_type &covar) |
Set the covariance matrix. | |
virtual void | compute_covar (matrix &covar) const |
Compute the covariance of the distribution. | |
const matrix & | covar_eigenvecs () const |
Access the eigenvectors of the covariance matrix. | |
const vector & | covar_eigenvals () const |
Access the eigenvalues of the covariance matrix. | |
void | set_covar_eigenvecs (const matrix &m) |
Set the eigenvectors of the covariance matrix. | |
void | set_covar_eigenvals (const vector &v) |
Set the eigenvalues of the covariance matrix. | |
virtual vector | inverse_cdf (const T &p) const |
Compute the inverse of the cumulative_prob() function. | |
virtual T | box_prob (const vector &min_pt, const vector &max_pt) const |
The probability of being in an axis-aligned box. | |
Protected Attributes | |
vpdt_gaussian< vector > | impl_ |
the Gaussian implementation from vpdt. |
A Gaussian with variance independent in each dimension.
Definition at line 23 of file vpdl_gaussian.h.
typedef matrix vpdl_gaussian< T, n >::covar_type |
the type used internally for covariance.
Definition at line 31 of file vpdl_gaussian.h.
typedef vpdt_field_default<T,n>::type vpdl_distribution< T, n >::field_type [inherited] |
the data type used for vectors.
Reimplemented in vpdl_mixture_of< dist_t >.
Definition at line 36 of file vpdl_distribution.h.
typedef vpdt_field_traits<vector>::matrix_type vpdl_gaussian< T, n >::matrix |
the data type used for matrices.
Reimplemented from vpdl_distribution< T, n >.
Definition at line 29 of file vpdl_gaussian.h.
typedef vpdt_field_default<T,n>::type vpdl_gaussian< T, n >::vector |
the data type used for vectors.
Reimplemented from vpdl_gaussian_base< T, n >.
Definition at line 27 of file vpdl_gaussian.h.
vpdl_gaussian< T, n >::vpdl_gaussian | ( | unsigned int | var_dim = n | ) | [inline] |
Constructor.
Optionally initialize the dimension for when n==0. Otherwise var_dim is ignored
Definition at line 36 of file vpdl_gaussian.h.
vpdl_gaussian< T, n >::vpdl_gaussian | ( | const vector & | mean_val, |
const covar_type & | covar | ||
) | [inline] |
Constructor - from mean and variance.
Definition at line 40 of file vpdl_gaussian.h.
virtual vpdl_gaussian< T, n >::~vpdl_gaussian | ( | ) | [inline, virtual] |
Destructor.
Definition at line 44 of file vpdl_gaussian.h.
T vpdl_distribution< T, n >::box_prob | ( | const vector & | min_pt, |
const vector & | max_pt | ||
) | const [virtual, inherited] |
The probability of being in an axis-aligned box.
The box is defined by two points, the minimum and maximum. Implemented in terms of cumulative_prob()
by default.
Reimplemented in vpdl_mixture< T, n >, vpdl_kernel_gaussian_sfbw< T, n >, vpdl_gaussian_sphere< T, n >, and vpdl_mixture_of< dist_t >.
Definition at line 86 of file vpdl_distribution.txx.
virtual vpdl_distribution<T,n>* vpdl_gaussian< T, n >::clone | ( | ) | const [inline, virtual] |
Create a copy on the heap and return base class pointer.
Implements vpdl_distribution< T, n >.
Definition at line 47 of file vpdl_gaussian.h.
virtual void vpdl_gaussian< T, n >::compute_covar | ( | matrix & | covar | ) | const [inline, virtual] |
Compute the covariance of the distribution.
Implements vpdl_distribution< T, n >.
Definition at line 129 of file vpdl_gaussian.h.
virtual void vpdl_gaussian< T, n >::compute_mean | ( | vector & | mean_val | ) | const [inline, virtual] |
Compute the mean of the distribution.
Implements vpdl_distribution< T, n >.
Definition at line 112 of file vpdl_gaussian.h.
const vector& vpdl_gaussian< T, n >::covar_eigenvals | ( | ) | const [inline] |
Access the eigenvalues of the covariance matrix.
Definition at line 138 of file vpdl_gaussian.h.
const matrix& vpdl_gaussian< T, n >::covar_eigenvecs | ( | ) | const [inline] |
Access the eigenvectors of the covariance matrix.
Definition at line 135 of file vpdl_gaussian.h.
covar_type vpdl_gaussian< T, n >::covariance | ( | ) | const [inline] |
Access the covariance - requires computation.
Definition at line 115 of file vpdl_gaussian.h.
virtual T vpdl_gaussian< T, n >::cumulative_prob | ( | const vector & | pt | ) | const [inline, virtual] |
Evaluate the cumulative distribution function at a point.
This is the integral of the density function from negative infinity (in all dimensions) to the point in question
Implements vpdl_distribution< T, n >.
Definition at line 100 of file vpdl_gaussian.h.
virtual T vpdl_gaussian< T, n >::density | ( | const vector & | pt | ) | const [inline, virtual] |
Evaluate the unnormalized density at a point.
Implements vpdl_distribution< T, n >.
Definition at line 56 of file vpdl_gaussian.h.
virtual unsigned int vpdl_gaussian< T, n >::dimension | ( | ) | const [inline, virtual] |
Return the run time dimension, which does not equal n
when n==0
.
Implements vpdl_distribution< T, n >.
Definition at line 53 of file vpdl_gaussian.h.
virtual T vpdl_gaussian< T, n >::gradient_density | ( | const vector & | pt, |
vector & | g | ||
) | const [inline, virtual] |
Compute the gradient of the unnormalized density at a point.
g | the gradient vector |
Implements vpdl_distribution< T, n >.
Definition at line 77 of file vpdl_gaussian.h.
vpdl_distribution< T, n >::vector vpdl_distribution< T, n >::inverse_cdf | ( | const T & | p | ) | const [virtual, inherited] |
Compute the inverse of the cumulative_prob() function.
The value of x: P(x'<x) = P for x' drawn from the distribution.
The value of x: P(x'<x) = P for x' drawn from the distribution. This is only valid for univariate distributions multivariate distributions will return -infinity
Definition at line 75 of file vpdl_distribution.txx.
virtual T vpdl_gaussian< T, n >::log_prob_density | ( | const vector & | pt | ) | const [inline, virtual] |
Evaluate the log probability density at a point.
Reimplemented from vpdl_distribution< T, n >.
Definition at line 68 of file vpdl_gaussian.h.
virtual const vector& vpdl_gaussian< T, n >::mean | ( | ) | const [inline, virtual] |
Access the mean directly.
Implements vpdl_gaussian_base< T, n >.
Definition at line 106 of file vpdl_gaussian.h.
virtual T vpdl_gaussian< T, n >::norm_const | ( | ) | const [inline, virtual] |
The normalization constant for the density.
When density() is multiplied by this value it becomes prob_density norm_const() is reciprocal of the integral of density over the entire field
Implements vpdl_distribution< T, n >.
Definition at line 85 of file vpdl_gaussian.h.
virtual T vpdl_gaussian< T, n >::prob_density | ( | const vector & | pt | ) | const [inline, virtual] |
Evaluate the probability density at a point.
Reimplemented from vpdl_distribution< T, n >.
Definition at line 62 of file vpdl_gaussian.h.
void vpdl_gaussian< T, n >::set_covar_eigenvals | ( | const vector & | v | ) | [inline] |
Set the eigenvalues of the covariance matrix.
Definition at line 144 of file vpdl_gaussian.h.
void vpdl_gaussian< T, n >::set_covar_eigenvecs | ( | const matrix & | m | ) | [inline] |
Set the eigenvectors of the covariance matrix.
Definition at line 141 of file vpdl_gaussian.h.
void vpdl_gaussian< T, n >::set_covariance | ( | const covar_type & | covar | ) | [inline] |
Set the covariance matrix.
Definition at line 123 of file vpdl_gaussian.h.
virtual void vpdl_gaussian< T, n >::set_mean | ( | const vector & | mean_val | ) | [inline, virtual] |
Set the mean.
Implements vpdl_gaussian_base< T, n >.
Definition at line 109 of file vpdl_gaussian.h.
T vpdl_gaussian< T, n >::sqr_mahal_dist | ( | const vector & | pt | ) | const [inline] |
The squared Mahalanobis distance to this point.
Non-virtual for efficiency
Definition at line 92 of file vpdl_gaussian.h.
vpdt_gaussian<vector> vpdl_gaussian< T, n >::impl_ [protected] |
the Gaussian implementation from vpdt.
Definition at line 148 of file vpdl_gaussian.h.