The interacting multiple model (IMM) filter's steps over a hybrid state, without the state: a switching process model, the method that predicts the modes whose models carry none of their own, and the scratch the modes are mixed and updated into, acting on a Hybrid passed in (decisions.md [filters-and-recursions]).
More...
|
|
using | Scalar = typename Params<Component_>::Scalar |
| | the scalar type
|
|
using | SpaceType = typename Params<Component_>::SpaceType |
| | the state space
|
|
using | ModelType = Model_ |
| | the switching model
|
|
using | MethodType = Method_ |
| | the prediction method
|
|
using | ModeSpaceType = typename Model_::ModeSpaceType |
| | the discrete mode space
|
|
using | ComponentType = Params<Component_> |
| | one mode's component
|
|
using | StateType = HybridParams<Component_, ModeSpaceType, Allocator_> |
| | the state the steps act on
|
|
using | allocator_type = Allocator_ |
| | the scratch's allocator
|
|
using | JointType = HybridPredictedJoint<SpaceType, ModeSpaceType, Scalar, Allocator_> |
| | what predictJoint() records
|
|
template<Measurement M> |
| using | MeasuredType = typename internal::ImmMeasured<ComponentType, M>::type |
| | The MeasurementUpdate of M on one mode's component, or, for a square-root form, the FilterUpdate of its one branch.
|
| template<Measurement M> |
| using | ResultType |
| | What update() with M fills when given a result: one branch per mode for noise by mode axis, every noise component's branch otherwise.
|
|
template<Measurement M> |
| using | UpdateType = std::expected<ResultType<M>, NumericError> |
| | What update() with M returns: the ResultType in a std::expected (decisions.md [innovation-cholesky]).
|
|
template<typename S> |
| using | SwitchingResultType = ResultType<typename S::template MeasurementType<0>> |
| | What update() with the SwitchingMeasurement S fills when given a result: the ResultType of its first measurement, which every one of its measurements shares.
|
|
template<typename S> |
| using | SwitchingUpdateType = std::expected<SwitchingResultType<S>, NumericError> |
| | What update() with the SwitchingMeasurement S returns: the SwitchingResultType in a std::expected.
|
| template<Measurement M, typename Space, typename P> |
| using | GivenMeasuredType |
| | The MeasurementUpdate of M on one mode's Gaussian, with the block named by the path P of a state in Space given (see update(state, measurement, pinned, policy)).
|
| template<Measurement M, typename Space, typename P> |
| using | GivenResultType |
| | What update(state, measurement, pinned, policy) with M fills when given a result: one branch per mode for noise by mode axis, as ResultType has.
|
|
template<Measurement M, typename Space, typename P> |
| using | GivenUpdateType = std::expected<GivenResultType<M, Space, P>, NumericError> |
| | What update(state, measurement, pinned, policy) with M returns.
|
|
| | ImmRecursion (Model_ model, MethodFor< Model_, Method_ > method={}, Allocator_ const &allocator={}) |
| | The recursion with switching model model and prediction method method, which the modes whose models carry none of their own predict by, with scratch for every mode from allocator.
|
| allocator_type | get_allocator () const |
|
void | resetScratch (Allocator_ const &allocator) |
| | Replaces the scratch with storage from allocator, when a state from another allocator arrives.
|
| Model_ const & | model () const |
| Model_ & | model () |
| Method_ const & | method () const |
| ModeSpaceType const & | modeSpace () const |
| bool | partitions (SpaceType const &space) const |
template<typename... Inputs>
requires (!isFixedStep<Model_>) |
| auto | predict (StateType &state, TimeStep< Scalar > auto const &dt, Inputs const &... inputs) |
| | Mixes state's components through the chain, moves each by dt, any TimeStep (see Time steps), through its mode's process model, with inputs passed as in Emrys::predict(), and moves the mode probabilities one step of the chain.
|
template<typename... Inputs>
requires isFixedStep<Model_> |
| auto | predict (StateType &state, Inputs const &... inputs) |
| | Mixes state's components through the chain, moves each by its mode's fixed-step model's step, by that model's method, with inputs passed as in Emrys::predict(), and moves the mode probabilities one step of the chain, returning as predict(state, dt, inputs...) does.
|
template<typename... Inputs>
requires (!isFixedStep<Model_> && !IsForm) |
| JointType | predictJoint (StateType &state, TimeStep< Scalar > auto const &dt, Inputs const &... inputs) |
| | Moves state forward as predict(state, dt, inputs...) does.
|
template<typename JointAllocator, typename... Inputs>
requires (!isFixedStep<Model_> && !IsForm) |
| void | predictJoint (StateType &state, TimeStep< Scalar > auto const &dt, HybridPredictedJoint< SpaceType, ModeSpaceType, Scalar, JointAllocator > &joint, Inputs const &... inputs) |
| | As predictJoint(state, dt, inputs...), but into joint, whose storage is reused: with the same joint at every step, recording allocates nothing once it has been filled.
|
template<typename... Inputs>
requires (isFixedStep<Model_> && !IsForm) |
| JointType | predictJoint (StateType &state, Inputs const &... inputs) |
| | Moves state forward as predict(state, inputs...) does with fixed-step models.
|
template<typename JointAllocator, typename... Inputs>
requires (isFixedStep<Model_> && !IsForm) |
| void | predictJoint (StateType &state, HybridPredictedJoint< SpaceType, ModeSpaceType, Scalar, JointAllocator > &joint, Inputs const &... inputs) |
| | As predictJoint(state, inputs...), but into joint, whose storage is reused.
|
template<Measurement M, typename Policy = reductions::Collapse>
requires (!internal::isGivenBlock<Policy>) |
| internal::UnlessGivenBlock< UpdateTypeOf< M >, Policy >::type | update (StateType &state, M const &measurement, Policy const &policy={}) |
| | Conditions each of state's components on measurement, by the measurement's own method, reduces its branches with policy (Collapse, Select, or a Gate), and multiplies each mode's probability by \( p(z \mid m) \).
|
| template<Measurement M, typename Policy, typename ModeUpdate, typename ResultAllocator> |
| std::expected< void, NumericError > | update (StateType &state, M const &measurement, Policy const &policy, ImmFilterUpdate< ModeUpdate, Scalar, ResultAllocator > &result) |
| | As update(state, measurement, policy), but into result, whose storage is reused: with the same result at every step, an update allocates nothing once it has been as large.
|
| template<typename P, Measurement... Ms, typename Policy = reductions::Collapse> |
| SwitchingUpdateType< SwitchingMeasurement< P, Ms... > > | update (StateType &state, SwitchingMeasurement< P, Ms... > const &measurement, Policy const &policy={}) |
| | As update(state, measurement, policy), but with a measurement per value of the mode axis that measurement names (see SwitchingMeasurement): each mode is updated by the measurement that its value in that axis selects, and its own likelihood \( p(z \mid m) \) reweights it.
|
| template<typename P, Measurement... Ms, typename Policy, typename ModeUpdate, typename ResultAllocator> |
| std::expected< void, NumericError > | update (StateType &state, SwitchingMeasurement< P, Ms... > const &measurement, Policy const &policy, ImmFilterUpdate< ModeUpdate, Scalar, ResultAllocator > &result) |
| | As update(state, measurement, policy) with a SwitchingMeasurement, but into result, whose storage is reused.
|
template<Measurement M, typename Space, typename P, typename Value, typename Policy = reductions::Collapse>
requires (!IsForm) |
| GivenUpdateType< M, Space, P > | update (StateType &state, M const &measurement, GivenBlock< Space, P, Value > const &pinned, Policy const &policy={}) |
| | As update(state, measurement, policy), but with state a hybrid over the rest of a state and the block that pinned names given separately, as given() makes it: each mode's Gaussian is conditioned as update(prior, measurement, given) conditions one.
|
template<Measurement M, typename Space, typename P, typename Value, typename Policy, typename ModeUpdate, typename ResultAllocator>
requires (!IsForm) |
| std::expected< void, NumericError > | update (StateType &state, M const &measurement, GivenBlock< Space, P, Value > const &pinned, Policy const &policy, ImmFilterUpdate< ModeUpdate, Scalar, ResultAllocator > &result) |
| | As update(state, measurement, pinned, policy), but into result, whose storage is reused.
|
template<typename Space, typename P, typename M, typename Value, typename Policy, typename ModeUpdate, typename ResultAllocator>
requires (!IsForm && !internal::isByMode<M>) |
| std::expected< void, NumericError > | updateGiven (StateType &state, internal::PinnedMeasurement< Space, P, M > const &f, Value const &value, Policy const &policy, ImmFilterUpdate< ModeUpdate, Scalar, ResultAllocator > &result) |
| | As update(state, measurement, pinned, policy, result), with the measurement over the rest and the given block already resolved as f and the block's value value: a caller that updates many hybrids, each given its own value, resolves the measurement once.
|
| template<Measurement M> |
| ResultType< M > | emptyUpdate (Allocator_ const &allocator, Eigen::Index modes) const |
| template<Measurement M, typename Space, typename P> |
| GivenResultType< M, Space, P > | emptyGivenUpdate (Allocator_ const &allocator, Eigen::Index modes) const |
| JointType | emptyJoint (StateType const &state) const |
template<Component Component_, typename Model_, typename Method_ = DefaultMethodFor<Model_>, typename Allocator_ = DefaultAllocator>
class Emrys::ImmRecursion< Component_, Model_, Method_, Allocator_ >
The interacting multiple model (IMM) filter's steps over a hybrid state, without the state: a switching process model, the method that predicts the modes whose models carry none of their own, and the scratch the modes are mixed and updated into, acting on a Hybrid passed in (decisions.md [filters-and-recursions]).
predict() first mixes: the component that mode j starts from is the collapse of every mode's component, weighted by the probability \( \mu_{i \mid j} \propto \Pi_{ij} \mu_i \) that the target was in mode i given that it is now in j. Each mixed component is then predicted through its mode's process model, by the model's own method where it carries one (withMethod(), FixedStepModel) and by the recursion's otherwise [switching-models], and the mode probabilities move one step of the chain. When the chain is the identity, the mixing would give each mode its own component, so predict() moves each as it is and leaves the probabilities. update() updates each mode's component as a KalmanRecursion would and multiplies each mode's probability by \( p(z \mid m) \).
The components may be in square-root form (decisions.md [gaussian-forms]): the mixing collapses factors by triangularization (see ComponentTraits), each mode predicts and updates in place as a KalmanRecursion over the form does, so predict() returns a std::expected, and the policy is Collapse alone, the form's update having one branch. predictJoint() is the covariance form's.
The interacting multiple model algorithm of Blom and Bar-Shalom (1988), as given in Hashimzade et al. (2024), ยง2.2.3, Algorithm 2 with one lag: mixing, mode-matched filtering, mode probability update, and the combined estimate as the state's collapsed().
ImmFilter owns a hybrid and runs this on it; MixtureFilter runs it on each hybrid of a mixture of hybrids, in order, since the scratch is one per recursion (not Reentrant). The scratch comes from the allocator the recursion is given, which must equal the hybrids' (see Allocation).
- Template Parameters
-
| Component_ | the component given one mode (see Component), such as a Gaussian |
| Model_ | a SwitchingModel over the mode space, of process models whose blocks partition the state space; with fixed-step models, predict() takes no time step |
| Method_ | the prediction method of every mode whose model carries none of its own (see withMethod()); ModelsMethod with fixed-step models, which all carry one |
| Allocator_ | the hybrid's allocator (see Allocation) |
- See also
- ImmFilter, class Hybrid