The base class for all probability distributions. More...
#include <vpdl_distribution.h>
Public Types | |
typedef vpdt_field_default< T, n >::type | field_type |
the data type used for vectors. | |
typedef vpdt_field_default< T, n >::type | vector |
the data type used for vectors. | |
typedef vpdt_field_traits < field_type >::matrix_type | matrix |
the data type used for matrices. | |
Public Member Functions | |
virtual | ~vpdl_distribution () |
virtual unsigned int | dimension () const =0 |
Return the run time dimension, which does not equal n when n==0 . | |
virtual vpdl_distribution< T, n > * | clone () const =0 |
Create a copy on the heap and return base class pointer. | |
virtual T | density (const vector &pt) const =0 |
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 =0 |
Compute the gradient of the unnormalized density at a point. | |
virtual T | norm_const () const =0 |
The normalization constant for the density. | |
virtual T | cumulative_prob (const vector &pt) const =0 |
Evaluate the cumulative distribution function at a point. | |
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. | |
virtual void | compute_mean (vector &mean) const =0 |
Compute the mean of the distribution. | |
virtual void | compute_covar (matrix &covar) const =0 |
Compute the covariance of the distribution. |
The base class for all probability distributions.
There is a distinct polymorphic class hierarchy for each choice of template parameters. The vector and matrix data types vary with both T
and n
.
T | is the scalar type use for numerical calculations (generally double or float) |
n | is the fixed dimension of the space with special case 0 (the default) indicating dynamic dimension set at run time.
|
Definition at line 30 of file vpdl_distribution.h.
typedef vpdt_field_default<T,n>::type vpdl_distribution< T, n >::field_type |
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<field_type>::matrix_type vpdl_distribution< T, n >::matrix |
the data type used for matrices.
Reimplemented in vpdl_kernel_vbw_base< T, n >, vpdl_kernel_fbw_base< T, n >, vpdl_mixture_of< dist_t >, vpdl_mixture< T, n >, vpdl_gaussian_sphere< T, n >, vpdl_kernel_base< T, n >, vpdl_gaussian_indep< T, n >, vpdl_kernel_gaussian_sfbw< T, n >, vpdl_gaussian< T, n >, vpdl_multi_cmp_dist< T, n >, and vpdl_multi_cmp_dist< vpdt_dist_traits< dist_t >::scalar_type, vpdt_dist_traits< dist_t >::dimension >.
Definition at line 41 of file vpdl_distribution.h.
typedef vpdt_field_default<T,n>::type vpdl_distribution< T, n >::vector |
the data type used for vectors.
Reimplemented in vpdl_kernel_vbw_base< T, n >, vpdl_kernel_fbw_base< T, n >, vpdl_mixture_of< dist_t >, vpdl_mixture< T, n >, vpdl_gaussian_sphere< T, n >, vpdl_kernel_base< T, n >, vpdl_gaussian_indep< T, n >, vpdl_kernel_gaussian_sfbw< T, n >, vpdl_gaussian< T, n >, vpdl_gaussian_base< T, n >, vpdl_multi_cmp_dist< T, n >, and vpdl_multi_cmp_dist< vpdt_dist_traits< dist_t >::scalar_type, vpdt_dist_traits< dist_t >::dimension >.
Definition at line 39 of file vpdl_distribution.h.
virtual vpdl_distribution< T, n >::~vpdl_distribution | ( | ) | [inline, virtual] |
Definition at line 33 of file vpdl_distribution.h.
T vpdl_distribution< T, n >::box_prob | ( | const vector & | min_pt, |
const vector & | max_pt | ||
) | const [virtual] |
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_distribution< T, n >::clone | ( | ) | const [pure virtual] |
Create a copy on the heap and return base class pointer.
Implemented in vpdl_mixture< T, n >, vpdl_mixture_of< dist_t >, vpdl_gaussian_sphere< T, n >, vpdl_gaussian_indep< T, n >, vpdl_gaussian< T, n >, and vpdl_kernel_gaussian_sfbw< T, n >.
virtual void vpdl_distribution< T, n >::compute_covar | ( | matrix & | covar | ) | const [pure virtual] |
Compute the covariance of the distribution.
This may be trivial for distributions like Gaussians, but actually involves computation for others.
Implemented in vpdl_mixture< T, n >, vpdl_kernel_gaussian_sfbw< T, n >, vpdl_gaussian_sphere< T, n >, vpdl_gaussian< T, n >, vpdl_gaussian_indep< T, n >, and vpdl_mixture_of< dist_t >.
virtual void vpdl_distribution< T, n >::compute_mean | ( | vector & | mean | ) | const [pure virtual] |
Compute the mean of the distribution.
This may be trivial for distributions like Gaussians, but actually involves computation for others.
Implemented in vpdl_mixture< T, n >, vpdl_gaussian_sphere< T, n >, vpdl_mixture_of< dist_t >, vpdl_gaussian_indep< T, n >, vpdl_gaussian< T, n >, and vpdl_kernel_base< T, n >.
virtual T vpdl_distribution< T, n >::cumulative_prob | ( | const vector & | pt | ) | const [pure 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
Implemented in vpdl_mixture< T, n >, vpdl_kernel_gaussian_sfbw< T, n >, vpdl_mixture_of< dist_t >, vpdl_gaussian_sphere< T, n >, vpdl_gaussian_indep< T, n >, and vpdl_gaussian< T, n >.
virtual T vpdl_distribution< T, n >::density | ( | const vector & | pt | ) | const [pure virtual] |
Evaluate the unnormalized density at a point.
Implemented in vpdl_mixture< T, n >, vpdl_mixture_of< dist_t >, vpdl_gaussian_sphere< T, n >, vpdl_gaussian_indep< T, n >, vpdl_gaussian< T, n >, and vpdl_kernel_gaussian_sfbw< T, n >.
virtual unsigned int vpdl_distribution< T, n >::dimension | ( | ) | const [pure virtual] |
Return the run time dimension, which does not equal n
when n==0
.
Implemented in vpdl_mixture< T, n >, vpdl_mixture_of< dist_t >, vpdl_gaussian_sphere< T, n >, vpdl_gaussian_indep< T, n >, vpdl_gaussian< T, n >, and vpdl_kernel_base< T, n >.
virtual T vpdl_distribution< T, n >::gradient_density | ( | const vector & | pt, |
vector & | g | ||
) | const [pure virtual] |
Compute the gradient of the unnormalized density at a point.
g | the gradient vector |
Implemented in vpdl_mixture< T, n >, vpdl_mixture_of< dist_t >, vpdl_kernel_gaussian_sfbw< T, n >, vpdl_gaussian_sphere< T, n >, vpdl_gaussian_indep< T, n >, and vpdl_gaussian< T, n >.
vpdl_distribution< T, n >::vector vpdl_distribution< T, n >::inverse_cdf | ( | const T & | p | ) | const [virtual] |
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_distribution< T, n >::log_prob_density | ( | const vector & | pt | ) | const [inline, virtual] |
Evaluate the log probability density at a point.
Reimplemented in vpdl_gaussian_sphere< T, n >, vpdl_gaussian_indep< T, n >, and vpdl_gaussian< T, n >.
Definition at line 62 of file vpdl_distribution.h.
virtual T vpdl_distribution< T, n >::norm_const | ( | ) | const [pure 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
Implemented in vpdl_mixture< T, n >, vpdl_kernel_fbw_base< T, n >, vpdl_mixture_of< dist_t >, vpdl_gaussian_sphere< T, n >, vpdl_gaussian_indep< T, n >, and vpdl_gaussian< T, n >.
virtual T vpdl_distribution< T, n >::prob_density | ( | const vector & | pt | ) | const [inline, virtual] |
Evaluate the probability density at a point.
Reimplemented in vpdl_mixture< T, n >, vpdl_mixture_of< dist_t >, vpdl_kernel_gaussian_sfbw< T, n >, vpdl_gaussian_sphere< T, n >, vpdl_gaussian_indep< T, n >, and vpdl_gaussian< T, n >.
Definition at line 56 of file vpdl_distribution.h.