vpdl_kernel_gaussian_sfbw< T, n > Class Template Reference

#include <vpdl_kernel_gaussian_sfbw.h>

Inheritance diagram for vpdl_kernel_gaussian_sfbw< T, n >:

Inheritance graph
[legend]

List of all members.


Detailed Description

template<class T, unsigned int n = 0>
class vpdl_kernel_gaussian_sfbw< T, n >

A fixed bandwidth spherical Gaussian kernel distribution.

The bandwidth is the standard deviation of the Gaussian kernel.

Definition at line 24 of file vpdl_kernel_gaussian_sfbw.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 vpdt_field_default< T,
n >::type 
field_type
 the data type used for vectors.

Public Member Functions

 vpdl_kernel_gaussian_sfbw ()
 Default Constructor.
 vpdl_kernel_gaussian_sfbw (const vcl_vector< vector > &samples, T bandwidth=T(1))
 Constructor - from sample centers and bandwidth (variance).
virtual vpdl_distribution< T, n > * clone () const
 Create a copy on the heap and return base class pointer.
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 gradient_density (const vector &pt, vector &g) const
 Compute the gradient of the unnormalized density at a point.
virtual T cumulative_prob (const vector &pt) const
 Evaluate the cumulative distribution function at a point.
box_prob (const vector &min_pt, const vector &max_pt) const
 The probability of being in an axis-aligned box.
virtual void compute_covar (matrix &covar) const
 Compute the covariance of the distribution.
virtual T kernel_norm_const () const
 The normalization constant for the kernel.
bandwidth () const
 Access the bandwidth.
void set_bandwidth (T b)
 Set the kernel bandwidth.
virtual T norm_const () const
 The normalization constant for the density.
unsigned int num_components () const
 Return the number of components in the mixture.
virtual unsigned int dimension () const
 Return the run time dimension, which does not equal n when n==0.
virtual void add_sample (const vector &s)
 Add a new sample point.
virtual void clear_samples ()
 Remove all sample points.
virtual void set_samples (const vcl_vector< vector > &samples)
 Set the collection of sample points.
const vcl_vector< vector > & samples () const
 Access the sample points.
virtual void compute_mean (vector &mean) const
 Compute the mean of the distribution.
virtual T log_prob_density (const vector &pt) const
 Evaluate the log probability density at a point.
virtual vector inverse_cdf (const T &p) const
 Compute the inverse of the cumulative_prob() function.
virtual void compute_covar (matrix &covar) const =0
 Compute the covariance of the distribution.

Member Typedef Documentation

template<class T, unsigned int n = 0>
typedef vpdt_field_default<T,n>::type vpdl_kernel_gaussian_sfbw< T, n >::vector

the data type used for vectors.

Reimplemented from vpdl_kernel_fbw_base< T, n >.

Definition at line 28 of file vpdl_kernel_gaussian_sfbw.h.

template<class T, unsigned int n = 0>
typedef vpdt_field_traits<vector>::matrix_type vpdl_kernel_gaussian_sfbw< T, n >::matrix

the data type used for matrices.

Reimplemented from vpdl_kernel_fbw_base< T, n >.

Definition at line 30 of file vpdl_kernel_gaussian_sfbw.h.

template<class T, unsigned int n = 0>
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.


Constructor & Destructor Documentation

template<class T, unsigned int n = 0>
vpdl_kernel_gaussian_sfbw< T, n >::vpdl_kernel_gaussian_sfbw (  )  [inline]

Default Constructor.

Definition at line 33 of file vpdl_kernel_gaussian_sfbw.h.

template<class T, unsigned int n = 0>
vpdl_kernel_gaussian_sfbw< T, n >::vpdl_kernel_gaussian_sfbw ( const vcl_vector< vector > &  samples,
bandwidth = T(1) 
) [inline]

Constructor - from sample centers and bandwidth (variance).

Definition at line 36 of file vpdl_kernel_gaussian_sfbw.h.


Member Function Documentation

template<class T, unsigned int n = 0>
virtual vpdl_distribution<T,n>* vpdl_kernel_gaussian_sfbw< 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 41 of file vpdl_kernel_gaussian_sfbw.h.

template<class T, unsigned int n = 0>
virtual T vpdl_kernel_gaussian_sfbw< T, n >::density ( const vector pt  )  const [inline, virtual]

Evaluate the unnormalized density at a point.

Implements vpdl_distribution< T, n >.

Definition at line 47 of file vpdl_kernel_gaussian_sfbw.h.

template<class T, unsigned int n = 0>
virtual T vpdl_kernel_gaussian_sfbw< 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 69 of file vpdl_kernel_gaussian_sfbw.h.

template<class T, unsigned int n = 0>
virtual T vpdl_kernel_gaussian_sfbw< T, n >::gradient_density ( const vector pt,
vector g 
) const [inline, virtual]

Compute the gradient of the unnormalized density at a point.

Returns:
the density at pt since it is usually needed as well, and is often trivial to compute while computing gradient
Return values:
g the gradient vector

Implements vpdl_distribution< T, n >.

Definition at line 82 of file vpdl_kernel_gaussian_sfbw.h.

template<class T, unsigned int n = 0>
virtual T vpdl_kernel_gaussian_sfbw< 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 114 of file vpdl_kernel_gaussian_sfbw.h.

template<class T, unsigned int n = 0>
T vpdl_kernel_gaussian_sfbw< 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 effeciency since the axis are independent

Reimplemented from vpdl_distribution< T, n >.

Definition at line 138 of file vpdl_kernel_gaussian_sfbw.h.

template<class T, unsigned int n = 0>
virtual void vpdl_kernel_gaussian_sfbw< T, n >::compute_covar ( matrix covar  )  const [inline, virtual]

Compute the covariance of the distribution.

Definition at line 164 of file vpdl_kernel_gaussian_sfbw.h.

template<class T, unsigned int n = 0>
virtual T vpdl_kernel_gaussian_sfbw< T, n >::kernel_norm_const (  )  const [inline, virtual]

The normalization constant for the kernel.

Implements vpdl_kernel_fbw_base< T, n >.

Definition at line 187 of file vpdl_kernel_gaussian_sfbw.h.

template<class T, unsigned int n = 0>
T vpdl_kernel_fbw_base< T, n >::bandwidth (  )  const [inline, inherited]

Access the bandwidth.

Definition at line 119 of file vpdl_kernel_base.h.

template<class T, unsigned int n = 0>
void vpdl_kernel_fbw_base< T, n >::set_bandwidth ( b  )  [inline, inherited]

Set the kernel bandwidth.

Definition at line 122 of file vpdl_kernel_base.h.

template<class T, unsigned int n = 0>
virtual T vpdl_kernel_fbw_base< T, n >::norm_const (  )  const [inline, virtual, inherited]

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 130 of file vpdl_kernel_base.h.

template<class T, unsigned int n = 0>
unsigned int vpdl_kernel_base< T, n >::num_components (  )  const [inline, virtual, inherited]

Return the number of components in the mixture.

Implements vpdl_multi_cmp_dist< T, n >.

Definition at line 41 of file vpdl_kernel_base.h.

template<class T, unsigned int n = 0>
virtual unsigned int vpdl_kernel_base< T, n >::dimension (  )  const [inline, virtual, inherited]

Return the run time dimension, which does not equal n when n==0.

Implements vpdl_distribution< T, n >.

Definition at line 44 of file vpdl_kernel_base.h.

template<class T, unsigned int n = 0>
virtual void vpdl_kernel_base< T, n >::add_sample ( const vector s  )  [inline, virtual, inherited]

Add a new sample point.

Reimplemented in vpdl_kernel_vbw_base< T, n >.

Definition at line 52 of file vpdl_kernel_base.h.

template<class T, unsigned int n = 0>
virtual void vpdl_kernel_base< T, n >::clear_samples (  )  [inline, virtual, inherited]

Remove all sample points.

Reimplemented in vpdl_kernel_vbw_base< T, n >.

Definition at line 60 of file vpdl_kernel_base.h.

template<class T, unsigned int n = 0>
virtual void vpdl_kernel_base< T, n >::set_samples ( const vcl_vector< vector > &  samples  )  [inline, virtual, inherited]

Set the collection of sample points.

Reimplemented in vpdl_kernel_vbw_base< T, n >.

Definition at line 66 of file vpdl_kernel_base.h.

template<class T, unsigned int n = 0>
const vcl_vector<vector>& vpdl_kernel_base< T, n >::samples (  )  const [inline, inherited]

Access the sample points.

Definition at line 72 of file vpdl_kernel_base.h.

template<class T, unsigned int n = 0>
virtual void vpdl_kernel_base< T, n >::compute_mean ( vector mean  )  const [inline, virtual, inherited]

Compute the mean of the distribution.

Assume that each kernel has its mean at the sample point

Implements vpdl_distribution< T, n >.

Definition at line 79 of file vpdl_kernel_base.h.

template<class T, unsigned int n = 0>
virtual T vpdl_distribution< T, n >::log_prob_density ( const vector pt  )  const [inline, virtual, inherited]

Evaluate the log probability density at a point.

Reimplemented in vpdl_gaussian< T, n >, vpdl_gaussian_indep< T, n >, and vpdl_gaussian_sphere< T, n >.

Definition at line 62 of file vpdl_distribution.h.

template<class T, unsigned int n>
vpdl_distribution< T, n >::vector vpdl_distribution< T, n >::inverse_cdf ( const T &  p  )  const [inline, virtual, inherited]

Compute the inverse of the cumulative_prob() function.

The value of x: P(x'<x) = P for x' drawn from the distribution.

Note:
This is only valid for univariate distributions multivariate distributions will return a quiet NaN
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.

template<class T, unsigned int n = 0>
virtual void vpdl_distribution< T, n >::compute_covar ( matrix covar  )  const [pure virtual, inherited]

Compute the covariance of the distribution.

This may be trivial for distributions like Gaussians, but actually involves computation for others.

Implemented in vpdl_mixture_of< dist_t >.


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

Generated on Sun Nov 22 06:22:39 2009 for core/vpdl by  doxygen 1.5.5