|
EmrysFilter 0.1.0
State estimation utilities in C++23 using Eigen
|
Action that removes every point whose normalized probability is below probability, renormalizing the rest; the most probable point is always kept.
More...
#include <EmrysFilter/Distributions/Upkeep.h>
Public Member Functions | |
| template<typename State> requires requires(State & state, typename State::Scalar logThreshold) { state.pruneBelow(logThreshold); } | |
| std::expected< bool, WeightError > | operator() (State &state) const |
| Prunes state. | |
Public Attributes | |
| Scalar_ | probability |
| points less probable than this are removed | |
Action that removes every point whose normalized probability is below probability, renormalizing the rest; the most probable point is always kept.
The state is anything with pruneBelow(logThreshold) returning the log of the weight removed, or a std::expected of it with a WeightError: a ParticleSet or a ParticleGaussianParams, a MixtureParams, the state of a MixtureFilter, which fails as logTotalWeight() does, or a GridGaussianParams, the state of an RbPointMassFilter, whose prune can't fail. The threshold is absolute, the same whatever the number of points; a caller who wants it relative to something, such as the cell size of a grid that subdivide() refines, adjusts it. It doesn't bound the probability removed, which on \( N \) points can reach \( (N - 1) \) times the threshold: pruneBelow(1e-6) on a flat distribution over two million cells keeps only the most probable. Under subdivide(k) in \( d \) dimensions each child holds \( 1/k^d \) of its parent, so the same threshold cuts a density \( k^d \) times higher after each refinement; a caller who wants the same cut divides the threshold by \( k^d \). PruneTail bounds the total. Scalar_ is the type of probability, deduced from the one given (upkeep::pruneBelow(1e-4f) holds a float).
|
inlinenodiscard |
Prunes state.