Public Types | Public Member Functions | Public Attributes | List of all members
vpdt_gaussian< F, Covar, Metric > Class Template Reference

A Gaussian with variance independent in each dimension. More...

#include <vpdt_gaussian.h>

Inheritance diagram for vpdt_gaussian< F, Covar, Metric >:
Inheritance graph
[legend]

Public Types

typedef F field_type
 The field type. More...
 
typedef Covar covar_type
 The covariance type. More...
 
typedef Metric metric_type
 The metric type. More...
 
typedef vpdt_field_traits< F >::scalar_type T
 the data type used for scalars. More...
 
typedef vpdt_field_traits< F >::vector_type vector
 the data type used for vectors. More...
 
typedef vpdt_field_traits< F >::matrix_type matrix
 the data type used for matrices. More...
 

Public Member Functions

 vpdt_gaussian (unsigned int var_dim=vpdt_field_traits< F >::dimension)
 Constructor. More...
 
 vpdt_gaussian (const F &m, const covar_type &c)
 Constructor - from mean and variance. More...
 
unsigned int dimension () const
 Return the dimension. More...
 
T density (const F &pt) const
 Evaluate the unnormalized density at a point pt. More...
 
T gradient_density (const F &pt, vector &g) const
 Compute the gradient of the density function, returned in g. More...
 
T norm_const () const
 compute the normalization constant (independent of sample point). More...
 
T sqr_mahal_dist (const F &pt) const
 The squared Mahalanobis distance to this point. More...
 
T cumulative_prob (const F &pt) const
 Evaluate the cumulative distribution function at a point. More...
 
void compute_mean (vector &m) const
 Compute the mean of the distribution. More...
 
void compute_covar (matrix &c) const
 Compute the covariance matrix of the distribution. More...
 

Public Attributes

mean
 the mean. More...
 
covar_type covar
 the matrix covariance. More...
 

Detailed Description

template<class F, class Covar = typename vpdt_eigen_sym_matrix_gen<F>::type, class Metric = vpdt_norm_metric<F,Covar>>
class vpdt_gaussian< F, Covar, Metric >

A Gaussian with variance independent in each dimension.

Definition at line 39 of file vpdt_gaussian.h.

Member Typedef Documentation

◆ covar_type

template<class F, class Covar = typename vpdt_eigen_sym_matrix_gen<F>::type, class Metric = vpdt_norm_metric<F,Covar>>
typedef Covar vpdt_gaussian< F, Covar, Metric >::covar_type

The covariance type.

Definition at line 45 of file vpdt_gaussian.h.

◆ field_type

template<class F, class Covar = typename vpdt_eigen_sym_matrix_gen<F>::type, class Metric = vpdt_norm_metric<F,Covar>>
typedef F vpdt_gaussian< F, Covar, Metric >::field_type

The field type.

Definition at line 43 of file vpdt_gaussian.h.

◆ matrix

template<class F, class Covar = typename vpdt_eigen_sym_matrix_gen<F>::type, class Metric = vpdt_norm_metric<F,Covar>>
typedef vpdt_field_traits<F>::matrix_type vpdt_gaussian< F, Covar, Metric >::matrix

the data type used for matrices.

Definition at line 54 of file vpdt_gaussian.h.

◆ metric_type

template<class F, class Covar = typename vpdt_eigen_sym_matrix_gen<F>::type, class Metric = vpdt_norm_metric<F,Covar>>
typedef Metric vpdt_gaussian< F, Covar, Metric >::metric_type

The metric type.

Definition at line 47 of file vpdt_gaussian.h.

◆ T

template<class F, class Covar = typename vpdt_eigen_sym_matrix_gen<F>::type, class Metric = vpdt_norm_metric<F,Covar>>
typedef vpdt_field_traits<F>::scalar_type vpdt_gaussian< F, Covar, Metric >::T

the data type used for scalars.

Definition at line 50 of file vpdt_gaussian.h.

◆ vector

template<class F, class Covar = typename vpdt_eigen_sym_matrix_gen<F>::type, class Metric = vpdt_norm_metric<F,Covar>>
typedef vpdt_field_traits<F>::vector_type vpdt_gaussian< F, Covar, Metric >::vector

the data type used for vectors.

Definition at line 52 of file vpdt_gaussian.h.

Constructor & Destructor Documentation

◆ vpdt_gaussian() [1/2]

template<class F, class Covar = typename vpdt_eigen_sym_matrix_gen<F>::type, class Metric = vpdt_norm_metric<F,Covar>>
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 59 of file vpdt_gaussian.h.

◆ vpdt_gaussian() [2/2]

template<class F, class Covar = typename vpdt_eigen_sym_matrix_gen<F>::type, class Metric = vpdt_norm_metric<F,Covar>>
vpdt_gaussian< F, Covar, Metric >::vpdt_gaussian ( const F &  m,
const covar_type c 
)
inline

Constructor - from mean and variance.

Definition at line 68 of file vpdt_gaussian.h.

Member Function Documentation

◆ compute_covar()

template<class F, class Covar = typename vpdt_eigen_sym_matrix_gen<F>::type, class Metric = vpdt_norm_metric<F,Covar>>
void vpdt_gaussian< F, Covar, Metric >::compute_covar ( matrix c) const
inline

Compute the covariance matrix of the distribution.

Definition at line 119 of file vpdt_gaussian.h.

◆ compute_mean()

template<class F, class Covar = typename vpdt_eigen_sym_matrix_gen<F>::type, class Metric = vpdt_norm_metric<F,Covar>>
void vpdt_gaussian< F, Covar, Metric >::compute_mean ( vector m) const
inline

Compute the mean of the distribution.

Definition at line 116 of file vpdt_gaussian.h.

◆ cumulative_prob()

template<class F, class Covar = typename vpdt_eigen_sym_matrix_gen<F>::type, class Metric = vpdt_norm_metric<F,Covar>>
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 109 of file vpdt_gaussian.h.

◆ density()

template<class F, class Covar = typename vpdt_eigen_sym_matrix_gen<F>::type, class Metric = vpdt_norm_metric<F,Covar>>
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 76 of file vpdt_gaussian.h.

◆ dimension()

template<class F, class Covar = typename vpdt_eigen_sym_matrix_gen<F>::type, class Metric = vpdt_norm_metric<F,Covar>>
unsigned int vpdt_gaussian< F, Covar, Metric >::dimension ( ) const
inline

Return the dimension.

Definition at line 72 of file vpdt_gaussian.h.

◆ gradient_density()

template<class F, class Covar = typename vpdt_eigen_sym_matrix_gen<F>::type, class Metric = vpdt_norm_metric<F,Covar>>
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 83 of file vpdt_gaussian.h.

◆ norm_const()

template<class F, class Covar = typename vpdt_eigen_sym_matrix_gen<F>::type, class Metric = vpdt_norm_metric<F,Covar>>
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 93 of file vpdt_gaussian.h.

◆ sqr_mahal_dist()

template<class F, class Covar = typename vpdt_eigen_sym_matrix_gen<F>::type, class Metric = vpdt_norm_metric<F,Covar>>
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 101 of file vpdt_gaussian.h.

Member Data Documentation

◆ covar

template<class F, class Covar = typename vpdt_eigen_sym_matrix_gen<F>::type, class Metric = vpdt_norm_metric<F,Covar>>
covar_type vpdt_gaussian< F, Covar, Metric >::covar

the matrix covariance.

Definition at line 131 of file vpdt_gaussian.h.

◆ mean

template<class F, class Covar = typename vpdt_eigen_sym_matrix_gen<F>::type, class Metric = vpdt_norm_metric<F,Covar>>
F vpdt_gaussian< F, Covar, Metric >::mean

the mean.

Definition at line 129 of file vpdt_gaussian.h.


The documentation for this class was generated from the following file: