Mixture Reducers

class stonesoup.mixturereducer.base.MixtureReducer[source]

Bases: Base

Mixture Reducer base class

class stonesoup.mixturereducer.gaussianmixture.GaussianMixtureReducer(prune_threshold: float = 1e-09, merge_threshold: float = 16, max_number_components: int = 9223372036854775807, merging: bool = True, pruning: bool = True, truncating: bool = True, kdtree_max_distance: float = None)[source]

Bases: MixtureReducer

Gaussian Mixture Reducer class:

Reduces the number of components in a Gaussian mixture to increase computational efficiency. See [1] for details. Achieved in three ways: pruning, merging, and truncating. Pruning is the act of removing low weight components from the mixture that fall below a pruning threshold. Merging is the act of combining similar components in the mixture that fall with a distance threshold into a single component. Truncating is the act of removing low weight components from the mixture so that the number of components in the mixture stays below a given threshold. Truncating is performed after the pruning and merging.

References

[1] B.-N. Vo and W.-K. Ma, “The Gaussian Mixture Probability Hypothesis Density Filter,” Signal Processing,IEEE Transactions on, vol. 54, no. 11, pp. 4091–4104, 2006..

Parameters:
  • prune_threshold (float, optional) – Mixture component weight threshold for pruning

  • merge_threshold (float, optional) – Squared Mahalanobis distance threshold for merging

  • max_number_components (int, optional) – Maximum number of components to keep in the Gaussian mixture

  • merging (bool, optional) – Flag for merging

  • pruning (bool, optional) – Flag for pruning components whose weight is below prune_threshold

  • truncating (bool, optional) – Flag for truncating components, keeping a maximum of max_number_components components

  • kdtree_max_distance (float, optional) – This defines the max Euclidean search distance for a kd-tree, used as part of the merge process as a coarse gate. Default None where tree isn’t used and all components are checked against the merge threshold.

prune_threshold: float

Mixture component weight threshold for pruning

merge_threshold: float

Squared Mahalanobis distance threshold for merging

max_number_components: int

Maximum number of components to keep in the Gaussian mixture

merging: bool

Flag for merging

pruning: bool

Flag for pruning components whose weight is below prune_threshold

truncating: bool

Flag for truncating components, keeping a maximum of max_number_components components

kdtree_max_distance: float

This defines the max Euclidean search distance for a kd-tree, used as part of the merge process as a coarse gate. Default None where tree isn’t used and all components are checked against the merge threshold.

reduce(components_list)[source]

Reduce the components of Gaussian Mixture list through pruning, merging, and truncating

Parameters:

components_list (list) – The components of Gaussian Mixture

Returns:

Reduced components

Return type:

list

prune(components_list)[source]

Pruning is the act of removing low weight components from the mixture that fall below a pruning threshold prune_threshold.

Parameters:

components_list (list) – The components of Gaussian Mixture to be pruned

Returns:

remaining_components – Components that remain after pruning

Return type:

GaussianMixtureState

merge_components(component_1, component_2)[source]

Merge two similar components

Parameters:
Returns:

merged_component – Merged Gaussian component

Return type:

WeightedGaussianState

merge(components_list)[source]

Merging is the act of combining similar components in the mixture that fall with a distance threshold merge_threshold into a single component.

Parameters:

components_list (list) – Components of the Gaussian Mixture to be merged

Returns:

Merged components

Return type:

list

truncate(components_list)[source]

Truncating is the act of removing low-weight components from the mixture so that the size of the mixture (number of components) stays within the given threshold max_number_components.

Parameters:

components_list (list) – Components of the Gaussian Mixture to be truncated

Returns:

The max_number_components components with the highest weights

Return type:

list