|
EmrysFilter 0.1.0
State estimation utilities in C++23 using Eigen
|
A reduction policy for a filter that keeps a State per update: it reduces an update's branches to at most one State (decisions.md [reduction-policies]). More...
#include <EmrysFilter/Models/Reduction.h>
A reduction policy for a filter that keeps a State per update: it reduces an update's branches to at most one State (decisions.md [reduction-policies]).
Update is a MeasurementUpdate, and the policy is given its branches, as an rvalue: one UpdateBranch per measurement-noise component, each with its logWeight (its posterior probability among them), posterior, innovation, nis(), and logLikelihood(). A policy sees the branches and nothing else, not the prior (decisions.md [composed-features]); what it needs of the prior is in the posteriors. It may move the posteriors out: the filter reads only the rest after it. It does one of two things:
std::optional, or nothing to keep none. What it returns stands for every branch it was given. Collapse and Select do this.out, given as a second argument, by out.add(logWeight, component), moving the component in. logWeight is the log-probability, among the branches, of the ones the component stands for: a branch's own logWeight for a branch kept as it is, and the log of the summed weights of the ones merged into it. Adding nothing keeps none. Keep and Gate do this.Keeping none rejects the measurement, and a filter of one state keeps its prior. A filter of several components, modes, or points weights each one kept by its prior weight, the observation's likelihood, and the added log-weight, so that branches the policy dropped, such as those a Gate fails, are not credited to what it kept; the evidence counts every branch.
A filter whose output holds one component, a KalmanRecursion's and those that reduce per mode or per point, requires this of its policy; a policy that adds twice fails an assertion, and Keep, which requires an output that holds several, fails the constraint. A MixtureFilter's output holds several (see MixtureReductionPolicy). usage.md, "Writing a reduction policy", shows one of the user's own (decisions.md [user-extension-points]).