A Gaussian with (hyper-)spherical covariance. More...
#include <vpdl_gaussian_sphere.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 T | 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_sphere (unsigned int var_dim=n) | |
Constructor. | |
vpdl_gaussian_sphere (const vector &mean_val, const covar_type &var) | |
Constructor - from mean and variance. | |
virtual | ~vpdl_gaussian_sphere () |
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. | |
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. | |
T | box_prob (const vector &min_pt, const vector &max_pt) const |
The probability of being in an axis-aligned box. | |
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. | |
const covar_type & | covariance () const |
Access the scalar variance. | |
void | set_covariance (const covar_type &var) |
Set the scalar variance. | |
virtual void | compute_covar (matrix &covar) const |
Compute the covariance of the distribution. | |
virtual vector | inverse_cdf (const T &p) const |
Compute the inverse of the cumulative_prob() function. | |
Protected Attributes | |
vpdt_gaussian< vector, covar_type > | impl_ |
the Gaussian implementation from vpdt. |
A Gaussian with (hyper-)spherical covariance.
Definition at line 26 of file vpdl_gaussian_sphere.h.
typedef T vpdl_gaussian_sphere< T, n >::covar_type |
the type used internally for covariance.
Definition at line 34 of file vpdl_gaussian_sphere.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_sphere< T, n >::matrix |
the data type used for matrices.
Reimplemented from vpdl_distribution< T, n >.
Definition at line 32 of file vpdl_gaussian_sphere.h.
typedef vpdt_field_default<T,n>::type vpdl_gaussian_sphere< T, n >::vector |
the data type used for vectors.
Reimplemented from vpdl_gaussian_base< T, n >.
Definition at line 30 of file vpdl_gaussian_sphere.h.
vpdl_gaussian_sphere< T, n >::vpdl_gaussian_sphere | ( | unsigned int | var_dim = n | ) | [inline] |
Constructor.
Optionally initialize the dimension for when n==0. Otherwise var_dim is ignored
Definition at line 39 of file vpdl_gaussian_sphere.h.
vpdl_gaussian_sphere< T, n >::vpdl_gaussian_sphere | ( | const vector & | mean_val, |
const covar_type & | var | ||
) | [inline] |
Constructor - from mean and variance.
Definition at line 43 of file vpdl_gaussian_sphere.h.
virtual vpdl_gaussian_sphere< T, n >::~vpdl_gaussian_sphere | ( | ) | [inline, virtual] |
Destructor.
Definition at line 47 of file vpdl_gaussian_sphere.h.
T vpdl_gaussian_sphere< T, n >::box_prob | ( | const vector & | min_pt, |
const vector & | max_pt | ||
) | const [inline, virtual] |
The probability of being in an axis-aligned box.
The box is defined by two points, the minimum and maximum. Reimplemented for efficiency since the axis are independent
Reimplemented from vpdl_distribution< T, n >.
Definition at line 111 of file vpdl_gaussian_sphere.h.
virtual vpdl_distribution<T,n>* vpdl_gaussian_sphere< 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 50 of file vpdl_gaussian_sphere.h.
virtual void vpdl_gaussian_sphere< T, n >::compute_covar | ( | matrix & | covar | ) | const [inline, virtual] |
Compute the covariance of the distribution.
Should be the identity matrix times var_
Implements vpdl_distribution< T, n >.
Definition at line 144 of file vpdl_gaussian_sphere.h.
virtual void vpdl_gaussian_sphere< T, n >::compute_mean | ( | vector & | mean_val | ) | const [inline, virtual] |
Compute the mean of the distribution.
Implements vpdl_distribution< T, n >.
Definition at line 134 of file vpdl_gaussian_sphere.h.
const covar_type& vpdl_gaussian_sphere< T, n >::covariance | ( | ) | const [inline] |
Access the scalar variance.
Definition at line 137 of file vpdl_gaussian_sphere.h.
virtual T vpdl_gaussian_sphere< 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 103 of file vpdl_gaussian_sphere.h.
virtual T vpdl_gaussian_sphere< T, n >::density | ( | const vector & | pt | ) | const [inline, virtual] |
Evaluate the unnormalized density at a point.
Implements vpdl_distribution< T, n >.
Definition at line 59 of file vpdl_gaussian_sphere.h.
virtual unsigned int vpdl_gaussian_sphere< 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 56 of file vpdl_gaussian_sphere.h.
virtual T vpdl_gaussian_sphere< 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 80 of file vpdl_gaussian_sphere.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_sphere< 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 71 of file vpdl_gaussian_sphere.h.
virtual const vector& vpdl_gaussian_sphere< T, n >::mean | ( | ) | const [inline, virtual] |
Access the mean directly.
Implements vpdl_gaussian_base< T, n >.
Definition at line 128 of file vpdl_gaussian_sphere.h.
T vpdl_gaussian_sphere< 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 88 of file vpdl_gaussian_sphere.h.
virtual T vpdl_gaussian_sphere< 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 65 of file vpdl_gaussian_sphere.h.
void vpdl_gaussian_sphere< T, n >::set_covariance | ( | const covar_type & | var | ) | [inline] |
Set the scalar variance.
Definition at line 140 of file vpdl_gaussian_sphere.h.
virtual void vpdl_gaussian_sphere< T, n >::set_mean | ( | const vector & | mean_val | ) | [inline, virtual] |
Set the mean.
Implements vpdl_gaussian_base< T, n >.
Definition at line 131 of file vpdl_gaussian_sphere.h.
T vpdl_gaussian_sphere< T, n >::sqr_mahal_dist | ( | const vector & | pt | ) | const [inline] |
The squared Mahalanobis distance to this point.
Non-virtual for efficiency
Definition at line 95 of file vpdl_gaussian_sphere.h.
vpdt_gaussian<vector,covar_type> vpdl_gaussian_sphere< T, n >::impl_ [protected] |
the Gaussian implementation from vpdt.
Definition at line 151 of file vpdl_gaussian_sphere.h.