A mixture of a fixed type of distributions. More...
#include <vpdt_mixture_of.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 dist_t::field_type | field_type |
| the data type to represent a point in the field. More... | |
| typedef dist_t | component_type |
| define the component type. More... | |
| typedef dist_t::field_type | F |
| the data type to represent a point in the field. More... | |
| typedef vpdt_field_traits< field_type >::scalar_type | T |
| define the scalar type (normally specified by template parameter T). More... | |
| typedef vpdt_field_traits< field_type >::vector_type | vector |
| define the vector type. More... | |
| typedef vpdt_field_traits< field_type >::matrix_type | matrix |
| the data type used for matrices. More... | |
Public Member Functions | |
| vpdt_mixture_of () | |
| vpdt_mixture_of (const vpdt_mixture_of< dist_t > &other) | |
| ~vpdt_mixture_of () | |
| vpdt_mixture_of< dist_t > & | operator= (const vpdt_mixture_of< dist_t > &rhs) |
| Assignment operator. More... | |
| 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 dist_t & | distribution (unsigned int index) const |
| Access (const) a component distribution of the mixture. More... | |
| dist_t & | 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 dist_t &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... | |
| T | density (const F &pt) const |
| Compute the unnormalized density at this point. More... | |
| T | gradient_density (const F &pt, vector &g) const |
| Compute the gradient of the unnormalized density at a point. More... | |
| T | cumulative_prob (const F &pt) const |
| Evaluate the cumulative distribution function at a point. More... | |
| void | compute_mean (F &mean) const |
| Compute the mean of the distribution. More... | |
| void | compute_covar (matrix &covar) const |
| Compute the covariance of the distribution. More... | |
| 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... | |
Static Public Attributes | |
| static const unsigned int | n = vpdt_field_traits<field_type>::dimension |
| define the fixed dimension (normally specified by template parameter n). More... | |
Private Attributes | |
| std::vector< component * > | components_ |
| The vector of components. More... | |
Friends | |
| T | vpdt_box_prob (const vpdt_mixture_of< dist_t > &d, const F &min_pt, const F &max_pt) |
A mixture of a fixed type of distributions.
A mixture is a weighted linear combination of other mixtures. This class represents a mixture of a specific type of distribution. Each component in the mixture has its own weight and parameters, but each must be of the same type.
| dist_t | is the type of a component distribution |
Definition at line 27 of file vpdt_mixture_of.h.
| typedef dist_t vpdt_mixture_of< dist_t >::component_type |
define the component type.
Definition at line 57 of file vpdt_mixture_of.h.
| typedef dist_t::field_type vpdt_mixture_of< dist_t >::F |
the data type to represent a point in the field.
Definition at line 62 of file vpdt_mixture_of.h.
| typedef dist_t::field_type vpdt_mixture_of< dist_t >::field_type |
the data type to represent a point in the field.
Definition at line 55 of file vpdt_mixture_of.h.
| typedef vpdt_field_traits<field_type>::matrix_type vpdt_mixture_of< dist_t >::matrix |
the data type used for matrices.
Definition at line 68 of file vpdt_mixture_of.h.
| typedef vpdt_field_traits<field_type>::scalar_type vpdt_mixture_of< dist_t >::T |
define the scalar type (normally specified by template parameter T).
Definition at line 64 of file vpdt_mixture_of.h.
| typedef vpdt_field_traits<field_type>::vector_type vpdt_mixture_of< dist_t >::vector |
define the vector type.
Definition at line 66 of file vpdt_mixture_of.h.
|
inline |
Definition at line 118 of file vpdt_mixture_of.h.
|
inline |
Definition at line 121 of file vpdt_mixture_of.h.
|
inline |
Definition at line 131 of file vpdt_mixture_of.h.
|
inline |
Compute the covariance of the distribution.
Definition at line 282 of file vpdt_mixture_of.h.
|
inline |
Compute the mean of the distribution.
weighted average of the component means
Definition at line 262 of file vpdt_mixture_of.h.
|
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 247 of file vpdt_mixture_of.h.
|
inline |
Compute the unnormalized density at this point.
Definition at line 212 of file vpdt_mixture_of.h.
|
inline |
Return the run time dimension, which does not equal n when n==0.
Definition at line 154 of file vpdt_mixture_of.h.
|
inline |
Access (const) a component distribution of the mixture.
Definition at line 165 of file vpdt_mixture_of.h.
|
inline |
Access a component distribution of the mixture.
Definition at line 172 of file vpdt_mixture_of.h.
|
inline |
Compute the gradient of the unnormalized density at a point.
| g | the gradient vector |
Definition at line 227 of file vpdt_mixture_of.h.
|
inline |
Insert a new component at the end of the vector.
Definition at line 194 of file vpdt_mixture_of.h.
|
inline |
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
Definition at line 314 of file vpdt_mixture_of.h.
|
inline |
Normalize the weights of the components to add to 1.
Definition at line 325 of file vpdt_mixture_of.h.
|
inline |
Return the number of components in the mixture.
Definition at line 162 of file vpdt_mixture_of.h.
|
inline |
Assignment operator.
Definition at line 139 of file vpdt_mixture_of.h.
|
inline |
Remove the last component in the vector.
Definition at line 202 of file vpdt_mixture_of.h.
|
inline |
Set the weight of a component in the mixture.
Definition at line 186 of file vpdt_mixture_of.h.
|
inline |
Sort the components in order of decreasing weight.
Definition at line 334 of file vpdt_mixture_of.h.
|
inline |
Sort the components in the range idx1 to idx2 in order of decreasing weight.
Definition at line 337 of file vpdt_mixture_of.h.
|
inline |
Sort the components using any StrictWeakOrdering function.
The prototype should be
Definition at line 348 of file vpdt_mixture_of.h.
|
inline |
Sort the components in the range idx1 to idx2 using any StrictWeakOrdering function.
Definition at line 353 of file vpdt_mixture_of.h.
|
inline |
Return the weight of a component in the mixture.
Definition at line 179 of file vpdt_mixture_of.h.
|
friend |
|
private |
The vector of components.
Definition at line 114 of file vpdt_mixture_of.h.
|
static |
define the fixed dimension (normally specified by template parameter n).
Definition at line 60 of file vpdt_mixture_of.h.
1.8.15