A mixture of distributions. More...
#include <vpdl_mixture.h>

Classes | |
| struct | component |
| A struct to hold the component distributions and weights. More... | |
| class | sort_adaptor |
| This adaptor allows users to define ordering functors on the components without accessing the components directly. More... | |
| class | sort_weight |
| This functor is used by default for sorting with STL. More... | |
Public Types | |
| typedef vpdt_field_default< T, n >::type | vector |
| the data type used for vectors. More... | |
| typedef vpdt_field_traits< vector >::matrix_type | matrix |
| the data type used for matrices. More... | |
| typedef vpdt_field_default< T, n >::type | field_type |
| the data type used for vectors. More... | |
Public Member Functions | |
| vpdl_mixture () | |
| Default Constructor. More... | |
| vpdl_mixture (vpdl_mixture< T, n > const &other) | |
| ~vpdl_mixture () | |
| vpdl_mixture< T, n > & | operator= (vpdl_mixture< T, n > const &rhs) |
| Assignment operator. More... | |
| virtual vpdl_distribution< T, n > * | clone () const |
| Create a copy on the heap and return base class pointer. More... | |
| virtual unsigned int | dimension () const |
Return the run time dimension, which does not equal n when n==0. More... | |
| unsigned int | num_components () const |
| Return the number of components in the mixture. More... | |
| const vpdl_distribution< T, n > & | distribution (unsigned int index) const |
| Access (const) a component distribution of the mixture. More... | |
| vpdl_distribution< T, n > & | distribution (unsigned int index) |
| Access a component distribution of the mixture. More... | |
| T | weight (unsigned int index) const |
| Return the weight of a component in the mixture. More... | |
| void | set_weight (unsigned int index, const T &w) |
| Set the weight of a component in the mixture. More... | |
| bool | insert (const vpdl_distribution< T, n > &d, const T &wght=T(0)) |
| Insert a new component at the end of the vector. More... | |
| bool | remove_last () |
| Remove the last component in the vector. More... | |
| virtual T | density (const vector &pt) const |
| Evaluate the unnormalized density at a point. More... | |
| T | prob_density (const vector &pt) const |
| Compute the probability density at this point. More... | |
| virtual T | gradient_density (const vector &pt, vector &g) const |
| Compute the gradient of the unnormalized density at a point. More... | |
| T | box_prob (const vector &min_pt, const vector &max_pt) const |
| The probability integrated over a box. More... | |
| virtual T | cumulative_prob (const vector &pt) const |
| Evaluate the cumulative distribution function at a point. More... | |
| virtual void | compute_mean (vector &mean) const |
| Compute the mean of the distribution. More... | |
| virtual void | compute_covar (matrix &covar) const |
| Compute the covariance of the distribution. More... | |
| virtual T | norm_const () const |
| The normalization constant for the density. More... | |
| void | normalize_weights () |
| Normalize the weights of the components to add to 1. More... | |
| void | sort () |
| Sort the components in order of decreasing weight. More... | |
| void | sort (unsigned int idx1, unsigned int idx2) |
| Sort the components in the range idx1 to idx2 in order of decreasing weight. More... | |
| template<class comp_type_ > | |
| void | sort (comp_type_ comp) |
| Sort the components using any StrictWeakOrdering function. More... | |
| template<class comp_type_ > | |
| void | sort (comp_type_ comp, unsigned int idx1, unsigned int idx2) |
| Sort the components in the range idx1 to idx2 using any StrictWeakOrdering function. More... | |
| virtual T | log_prob_density (const vector &pt) const |
| Evaluate the log probability density at a point. More... | |
| virtual vector | inverse_cdf (const T &p) const |
| Compute the inverse of the cumulative_prob() function. More... | |
Private Attributes | |
| std::vector< component * > | components_ |
| The vector of components. More... | |
A mixture of distributions.
A mixture is a weighted linear combination of other mixtures. This class is the most general, polymorphic version of a mixture. Internally it keeps base class pointers to clones of the supplied distributions. Each distribution in the mixture could potentially be of a different type.
Definition at line 32 of file vpdl_mixture.h.
|
inherited |
the data type used for vectors.
Definition at line 39 of file vpdl_distribution.h.
| typedef vpdt_field_traits<vector>::matrix_type vpdl_mixture< T, n >::matrix |
the data type used for matrices.
Definition at line 38 of file vpdl_mixture.h.
| typedef vpdt_field_default<T,n>::type vpdl_mixture< T, n >::vector |
the data type used for vectors.
Definition at line 36 of file vpdl_mixture.h.
|
inline |
Default Constructor.
Definition at line 95 of file vpdl_mixture.h.
|
inline |
Definition at line 98 of file vpdl_mixture.h.
|
inline |
Definition at line 108 of file vpdl_mixture.h.
|
inlinevirtual |
The probability integrated over a box.
Reimplemented from vpdl_distribution< T, n >.
Definition at line 242 of file vpdl_mixture.h.
|
inlinevirtual |
Create a copy on the heap and return base class pointer.
Implements vpdl_distribution< T, n >.
Definition at line 131 of file vpdl_mixture.h.
|
inlinevirtual |
Compute the covariance of the distribution.
Implements vpdl_distribution< T, n >.
Definition at line 293 of file vpdl_mixture.h.
|
inlinevirtual |
Compute the mean of the distribution.
weighted average of the component means
Implements vpdl_distribution< T, n >.
Definition at line 273 of file vpdl_mixture.h.
|
inlinevirtual |
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 258 of file vpdl_mixture.h.
|
inlinevirtual |
Evaluate the unnormalized density at a point.
Implements vpdl_distribution< T, n >.
Definition at line 195 of file vpdl_mixture.h.
|
inlinevirtual |
Return the run time dimension, which does not equal n when n==0.
Implements vpdl_distribution< T, n >.
Definition at line 137 of file vpdl_mixture.h.
|
inline |
Access (const) a component distribution of the mixture.
Definition at line 148 of file vpdl_mixture.h.
|
inline |
Access a component distribution of the mixture.
Definition at line 155 of file vpdl_mixture.h.
|
inlinevirtual |
Compute the gradient of the unnormalized density at a point.
| g | the gradient vector |
Implements vpdl_distribution< T, n >.
Definition at line 224 of file vpdl_mixture.h.
|
inline |
Insert a new component at the end of the vector.
Definition at line 177 of file vpdl_mixture.h.
|
virtualinherited |
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 78 of file vpdl_distribution.hxx.
|
inlinevirtualinherited |
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 65 of file vpdl_distribution.h.
|
inlinevirtual |
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 325 of file vpdl_mixture.h.
|
inline |
Normalize the weights of the components to add to 1.
Definition at line 336 of file vpdl_mixture.h.
|
inlinevirtual |
Return the number of components in the mixture.
Implements vpdl_multi_cmp_dist< T, n >.
Definition at line 145 of file vpdl_mixture.h.
|
inline |
Assignment operator.
Definition at line 116 of file vpdl_mixture.h.
|
inlinevirtual |
Compute the probability density at this point.
Reimplemented from vpdl_distribution< T, n >.
Definition at line 207 of file vpdl_mixture.h.
|
inline |
Remove the last component in the vector.
Definition at line 185 of file vpdl_mixture.h.
|
inline |
Set the weight of a component in the mixture.
Definition at line 169 of file vpdl_mixture.h.
|
inline |
Sort the components in order of decreasing weight.
Definition at line 345 of file vpdl_mixture.h.
|
inline |
Sort the components in the range idx1 to idx2 in order of decreasing weight.
Definition at line 348 of file vpdl_mixture.h.
|
inline |
Sort the components using any StrictWeakOrdering function.
The prototype should be
Definition at line 359 of file vpdl_mixture.h.
|
inline |
Sort the components in the range idx1 to idx2 using any StrictWeakOrdering function.
Definition at line 368 of file vpdl_mixture.h.
|
inline |
Return the weight of a component in the mixture.
Definition at line 162 of file vpdl_mixture.h.
|
private |
The vector of components.
Definition at line 90 of file vpdl_mixture.h.
1.8.15