|
EmrysFilter 0.1.0
State estimation utilities in C++23 using Eigen
|
The information filter: a KalmanFilter whose state is an InfoGaussianParams, the precision and information vector about a reference (decisions.md [gaussian-forms]). More...
#include <EmrysFilter/Filters/InfoFilter.h>
Public Types | |
| using | Base |
| the filter this is | |
| Public Types inherited from Emrys::KalmanFilter< Component_, Model_, Method_, Recursion_, Upkeep_ > | |
| using | Scalar = typename Params<Component_>::Scalar |
| the scalar type | |
| using | SpaceType = typename Params<Component_>::SpaceType |
| the state space | |
| using | ModelType = Model_ |
| the process model | |
| using | MethodType = Method_ |
| the prediction method | |
| using | StateType = Params<Component_> |
| the state the filter owns | |
| using | RecursionType = Recursion_ |
| the steps it runs (see Recursion) | |
Public Member Functions | |
| InfoFilter (Model_ model, InfoGaussianParams< Space_, Scalar_ > state, MethodFor< Model_, Method_ > method={}, std::type_identity_t< Upkeep_ > upkeep={}) | |
| A filter with process model model, initial state state, and prediction method method; a fixed-step model carries its own, so there is none to give. | |
| InfoFilter (Model_ model, InfoGaussianParams< Space_, Scalar_ > state, std::type_identity_t< Upkeep_ > upkeep) | |
| A filter with process model model, initial state state, the default prediction method, and upkeep upkeep, which maintain() runs. | |
| Public Member Functions inherited from Emrys::KalmanFilter< Component_, Model_, Method_, Recursion_, Upkeep_ > | |
| KalmanFilter (Model_ model, Params< Component_ > state, MethodFor< Model_, Method_ > method={}, std::type_identity_t< Upkeep_ > upkeep={}) | |
| A filter with process model model, initial state state, prediction method method, and upkeep upkeep, which maintain() runs; a fixed-step model carries its own method, so there is none to give. | |
| KalmanFilter (Model_ model, Params< Component_ > state, std::type_identity_t< Upkeep_ > upkeep) | |
| A filter with process model model, initial state state, the default prediction method, and upkeep upkeep, which maintain() runs. | |
| KalmanFilter (Recursion_ recursion, StateType state, std::type_identity_t< Upkeep_ > upkeep={}) | |
| A filter that runs recursion, the library's or one of the user's own (see Recursion), on the initial state state, whose space the recursion's model must partition, with upkeep upkeep, which maintain() runs. | |
| StateType const & | state () const |
| StateType & | state () |
| void | setState (StateType state) |
| Replaces the state estimate, as when reinitializing, with one whose space the process model's writes partition, as the constructor's must. | |
| RecursionType const & | recursion () const |
| Model_ const & | model () const |
| Model_ & | model () |
| Method_ const & | method () const |
| template<typename... Inputs> requires (!isFixedStep<Model_>) | |
| auto | predict (TimeStep< Scalar > auto const &dt, Inputs const &... inputs) |
| Moves the state forward by dt, any TimeStep (see Time steps), through the process model, with inputs passed to its model as in Emrys::predict(): an uncertain input carries its uncertainty through the dynamics, and anything else is known. | |
|
template<typename... Inputs> requires (isFixedStep<Model_> && !internal::leadsWithSteps<Inputs...>) | |
| auto | predict (Inputs const &... inputs) |
| Moves the state forward by the fixed-step model's step, with inputs passed as in Emrys::predict(), returning as predict(dt, inputs...) does. | |
| template<typename... Inputs> requires isFixedStep<Model_> | |
| auto | predict (Steps steps, Inputs const &... inputs) |
| Moves the state forward by steps of the fixed-step model, as that many calls of predict(inputs...) do, with inputs at every step. | |
| template<typename... Inputs> requires (!isFixedStep<Model_> && !IsForm) | |
| PredictedJoint< SpaceType, Scalar > | predictJoint (TimeStep< Scalar > auto const &dt, Inputs const &... inputs) |
| Moves the state forward as predict(dt, inputs...) does. | |
| template<typename... Inputs> requires (isFixedStep<Model_> && !IsForm && !internal::leadsWithSteps<Inputs...>) | |
| PredictedJoint< SpaceType, Scalar > | predictJoint (Inputs const &... inputs) |
| Moves the state forward as predict(inputs...) does with a fixed-step model. | |
| template<Measurement M, typename Policy = reductions::Collapse> requires (!internal::isLinearizedAbout<Policy>) | |
| auto | update (M const &measurement, Policy const &policy={}) |
| Conditions the state on measurement, by the measurement's own method, and reduces the branches to the new state with policy, a ReductionPolicy to the component (Collapse, Select, or a Gate). | |
| template<Measurement M, typename Reference, typename Policy = reductions::Collapse> | |
| auto | update (M const &measurement, LinearizedAbout< Reference > const &about, Policy const &policy={}) |
| Conditions the state on measurement as update(measurement, policy) does, with the measurement linearized about about, a point or a distribution (see linearizedAbout()), rather than at the state (decisions.md [linearization-reference]): a shadow filter's update about another filter's state, which with predict(dt, about) runs the shadow's whole step about it. | |
| template<Measurement M, typename Policy, typename Result> requires (!internal::isLinearizedAbout<Policy>) | |
| std::expected< void, GaussianError > | update (M const &measurement, Policy const &policy, Result &result) |
As update(measurement, policy), but into result, the update inside the std::expected that update() returns, whose storage is reused: with the same result at every step, an update under mixture noise, whose branches are a run-time count, allocates nothing once the result has held as many (see Allocation). | |
| template<Measurement M, typename Reference, typename Policy, typename Result> | |
| std::expected< void, GaussianError > | update (M const &measurement, LinearizedAbout< Reference > const &about, Policy const &policy, Result &result) |
| As update(measurement, about, policy), but into result, as update(measurement, policy, result) fills it. | |
The information filter: a KalmanFilter whose state is an InfoGaussianParams, the precision and information vector about a reference (decisions.md [gaussian-forms]).
The update adds \( H^T S_0^{-1} H \) to the precision and the matching vector to the information vector, with \( H \) and \( S_0 \) the statistical linearization of the measurement by its own method at the mean [covariance-update-forms]: exact for an affine measurement, the extended information filter of Mutambara (1998) otherwise, and independent of the order several measurements arrive in. A state with no information in some direction ( \( \Lambda = 0 \) at the start) takes Linearized updates at its reference until the measurements determine every direction; a sigma-point update, and every prediction, go through the covariance and return GaussianError::Singular until then. Prediction converts to the covariance form, predicts as KalmanFilter does, and converts back with the reference at the predicted mean, so each step returns a std::expected. Measurement noise has one component and the policy is Collapse; there is no predictJoint().
It is the KalmanFilter it names with nothing added, as a derived class rather than an alias so that its arguments deduce on every compiler [filters-and-recursions]: InfoFilter filter{model, *toInfo(initial)}.
| Space_ | the state space (see Spaces) |
| Model_ | the process model, a ProcessModel or a FixedStepModel |
| Method_ | the prediction method; a FixedStepModel's own |
| Scalar_ | scalar type, double by default |
| Upkeep_ | the upkeep maintain() runs on the state (see Upkeep), upkeep::None unless given one; RepairCovariance does not apply to this form |
| using Emrys::InfoFilter< Space_, Model_, Method_, Scalar_, Upkeep_ >::Base |
the filter this is
|
inline |
A filter with process model model, initial state state, and prediction method method; a fixed-step model carries its own, so there is none to give.
Declared rather than inherited so that only the deduction guide below deduces the filter's arguments.