|
EmrysFilter 0.1.0
State estimation utilities in C++23 using Eigen
|
Action that raises every mode less probable than probability to it, scaling the others down to keep the sum one, so that no mode is ruled out for good.
More...
#include <EmrysFilter/Distributions/Upkeep.h>
Public Member Functions | |
| template<typename State> requires requires(State & state) { state.modes().logTotalWeight(); state.modes().logWeights(); state.setModes(state.modes()); } | |
| std::expected< bool, WeightError > | operator() (State &state) const |
| Floors state's mode probabilities, read by modes() and written by setModes(). | |
| template<typename Space, typename Scalar> | |
| std::expected< bool, WeightError > | operator() (CategoricalParams< Space, Scalar > &categorical) const |
| Floors the probabilities of categorical, the state of a HiddenMarkovFilter, as those of a hybrid's modes. | |
| template<typename Component, typename Allocator> requires requires(typename MixtureParams<Component, Allocator>::ComponentType & hybrid) { hybrid.setModes(hybrid.modes()); } | |
| std::expected< bool, WeightError > | operator() (MixtureParams< Component, Allocator > &mixture) const |
| Floors the mode probabilities of each component of mixture, a mixture of hybrids, and leaves the components' weights as they are. | |
Public Attributes | |
| Scalar_ | probability |
| no mode is left less probable than this | |
Action that raises every mode less probable than probability to it, scaling the others down to keep the sum one, so that no mode is ruled out for good.
The state is anything with modes() and setModes(), such as the Hybrid of an ImmFilter; a CategoricalParams, the state of a HiddenMarkovFilter, whose values it floors as modes; or a MixtureParams of hybrids, each of whose components it floors in turn.
Under Bayes' rule a mode whose probability is zero can never come back, and one that is merely tiny takes as much evidence to come back as it took to fall. An AmmFilter, whose chain moves no probability between modes, then cannot follow a change of mode; applied after each update, the floor keeps every mode within reach of the next few measurements. probability times the number of modes must not exceed one.
The lower bound on the model probabilities of Athans et al. (1977), §V-F, set there so that the identification stays "sensitive to such changes". The paper does not say how the probabilities are brought back to a sum of one. Here the modes above the floor share what the floored ones leave in proportion to their probabilities, and a mode that sharing takes below the floor is floored too, so every mode ends at least at the floor and the ratios among the modes it doesn't floor are unchanged. Unlike the other actions it changes the distribution on purpose, by at most probability times the number of modes in total variation, which is why it is upkeep the caller places rather than an option of the filter (decisions.md [autonomous-multiple-model]).
Scalar_ is the type of probability, deduced from the one given (upkeep::floorModes(1e-3f) holds a float).
|
inlinenodiscard |
Floors the probabilities of categorical, the state of a HiddenMarkovFilter, as those of a hybrid's modes.
|
inlinenodiscard |
Floors the mode probabilities of each component of mixture, a mixture of hybrids, and leaves the components' weights as they are.
|
inlinenodiscard |
Floors state's mode probabilities, read by modes() and written by setModes().