A Gaussian with variance independent in each dimension. More...
#include <vpdt_gaussian.h>
Public Types | |
typedef F | field_type |
The field type. | |
typedef Covar | covar_type |
The covariance type. | |
typedef Metric | metric_type |
The metric type. | |
typedef vpdt_field_traits< F > ::scalar_type | T |
the data type used for scalars. | |
typedef vpdt_field_traits< F > ::vector_type | vector |
the data type used for vectors. | |
typedef vpdt_field_traits< F > ::matrix_type | matrix |
the data type used for matrices. | |
Public Member Functions | |
vpdt_gaussian (unsigned int var_dim=vpdt_field_traits< F >::dimension) | |
Constructor. | |
vpdt_gaussian (const F &m, const covar_type &c) | |
Constructor - from mean and variance. | |
unsigned int | dimension () const |
Return the dimension. | |
T | density (const F &pt) const |
Evaluate the unnormalized density at a point pt. | |
T | gradient_density (const F &pt, vector &g) const |
Compute the gradient of the density function, returned in g. | |
T | norm_const () const |
compute the normalization constant (independent of sample point). | |
T | sqr_mahal_dist (const F &pt) const |
The squared Mahalanobis distance to this point. | |
T | cumulative_prob (const F &pt) const |
Evaluate the cumulative distribution function at a point. | |
void | compute_mean (vector &m) const |
Compute the mean of the distribution. | |
void | compute_covar (matrix &c) const |
Compute the covariance matrix of the distribution. | |
Public Attributes | |
F | mean |
the mean. | |
covar_type | covar |
the matrix covariance. |
A Gaussian with variance independent in each dimension.
Definition at line 35 of file vpdt_gaussian.h.
typedef Covar vpdt_gaussian< F, Covar, Metric >::covar_type |
The covariance type.
Definition at line 41 of file vpdt_gaussian.h.
typedef F vpdt_gaussian< F, Covar, Metric >::field_type |
The field type.
Definition at line 39 of file vpdt_gaussian.h.
typedef vpdt_field_traits<F>::matrix_type vpdt_gaussian< F, Covar, Metric >::matrix |
the data type used for matrices.
Definition at line 50 of file vpdt_gaussian.h.
typedef Metric vpdt_gaussian< F, Covar, Metric >::metric_type |
The metric type.
Definition at line 43 of file vpdt_gaussian.h.
typedef vpdt_field_traits<F>::scalar_type vpdt_gaussian< F, Covar, Metric >::T |
the data type used for scalars.
Definition at line 46 of file vpdt_gaussian.h.
typedef vpdt_field_traits<F>::vector_type vpdt_gaussian< F, Covar, Metric >::vector |
the data type used for vectors.
Definition at line 48 of file vpdt_gaussian.h.
vpdt_gaussian< F, Covar, Metric >::vpdt_gaussian | ( | unsigned int | var_dim = vpdt_field_traits<F>::dimension | ) | [inline] |
Constructor.
Optionally initialize the dimension for when n==0. Otherwise var_dim is ignored
Definition at line 55 of file vpdt_gaussian.h.
vpdt_gaussian< F, Covar, Metric >::vpdt_gaussian | ( | const F & | m, |
const covar_type & | c | ||
) | [inline] |
Constructor - from mean and variance.
Definition at line 64 of file vpdt_gaussian.h.
void vpdt_gaussian< F, Covar, Metric >::compute_covar | ( | matrix & | c | ) | const [inline] |
Compute the covariance matrix of the distribution.
Definition at line 115 of file vpdt_gaussian.h.
void vpdt_gaussian< F, Covar, Metric >::compute_mean | ( | vector & | m | ) | const [inline] |
Compute the mean of the distribution.
Definition at line 112 of file vpdt_gaussian.h.
T vpdt_gaussian< F, Covar, Metric >::cumulative_prob | ( | const F & | pt | ) | const [inline] |
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
Definition at line 105 of file vpdt_gaussian.h.
T vpdt_gaussian< F, Covar, Metric >::density | ( | const F & | pt | ) | const [inline] |
Evaluate the unnormalized density at a point pt.
This must be multiplied by norm_const() to integrate to 1
Definition at line 72 of file vpdt_gaussian.h.
unsigned int vpdt_gaussian< F, Covar, Metric >::dimension | ( | ) | const [inline] |
Return the dimension.
Definition at line 68 of file vpdt_gaussian.h.
T vpdt_gaussian< F, Covar, Metric >::gradient_density | ( | const F & | pt, |
vector & | g | ||
) | const [inline] |
Compute the gradient of the density function, returned in g.
The return value of the function is the density itself
Definition at line 79 of file vpdt_gaussian.h.
T vpdt_gaussian< F, Covar, Metric >::norm_const | ( | ) | const [inline] |
compute the normalization constant (independent of sample point).
Can be precomputed when evaluating at multiple points
Definition at line 89 of file vpdt_gaussian.h.
T vpdt_gaussian< F, Covar, Metric >::sqr_mahal_dist | ( | const F & | pt | ) | const [inline] |
The squared Mahalanobis distance to this point.
Non-virtual for efficiency
Definition at line 97 of file vpdt_gaussian.h.
covar_type vpdt_gaussian< F, Covar, Metric >::covar |
the matrix covariance.
Definition at line 127 of file vpdt_gaussian.h.
F vpdt_gaussian< F, Covar, Metric >::mean |
the mean.
Definition at line 125 of file vpdt_gaussian.h.