EmrysFilter 0.1.0
State estimation utilities in C++23 using Eigen
Loading...
Searching...
No Matches
Emrys::methods::Iterated< Method, Scalar > Struct Template Reference

Iterated method, for a measurement update: the update of Method relinearized with respect to its own posterior, with the prior held fixed, until the mean stops moving. More...

#include <EmrysFilter/Models/Methods.h>

Public Attributes

Method method {}
 the method relinearized at each iterate
Scalar tolerance = Scalar(1e-3)
 the largest step that stops it, in prior standard deviations
std::size_t maxIterations = 10
 the most linearizations it makes, at least 1

Detailed Description

template<typename Method = Linearized, RealScalar Scalar = double>
struct Emrys::methods::Iterated< Method, Scalar >

Iterated method, for a measurement update: the update of Method relinearized with respect to its own posterior, with the prior held fixed, until the mean stops moving.

With Linearized it is the iterated extended Kalman filter's update, which is Gauss-Newton on the update's least-squares problem and so finds the posterior's mode where one linearization at the prior mean falls short, as with a precise measurement of a poorly known state. With a sigma-point method (an UnscentedRule or a PointSet) it is the iterated posterior linearization filter's update (decisions.md [iterated-update], [sigma-point-sets]).

Each iteration linearizes the measurement about the iterate \( x_i = \mu \boxplus \delta_i \), with \( \delta_0 = 0 \), and takes the Kalman update from the prior \( (\mu, P) \) under that linearization. Linearized takes the Jacobian at \( x_i \); a sigma-point method takes the statistical linearization \( (G_i, \Omega_i) \) of the measurement over the iterate's posterior, its points spread about \( x_i \) by the posterior covariance of the blocks read, \( P_i = P - K_{i-1} S_{i-1} K_{i-1}^T \), carried to \( x_i \)'s chart by the reset Jacobian, and its \( \Omega_i \) added to the noise. With \( h \) the measurement function and \( G_i \) its Jacobian in \( \delta \) at \( \delta_i \), the predicted measurement is \( h(x_i) \boxplus (-G_i \delta_i) \), the residual \( r_i \) is the observation's from it, and the step is \( \delta_{i+1} = K_i r_i \). On a space with its own \( \boxplus \) the Jacobian in \( \delta \) is the Jacobian at \( x_i \) times the reset Jacobian (resetJacobian()) of the prior mean and \( \delta_i \), so the iteration is Gauss-Newton in the prior's own chart. The iteration stops at the linearization after a step that moved no coordinate by more than tolerance of its prior standard deviation, \( |\delta_i - \delta_{i-1}| \le \mathrm{tolerance} \cdot \sqrt{P_{jj}} \), or at linearization number maxIterations, and that linearization's update is the result, covariance and Innovation included. Each branch of the update reports which (UpdateBranch::iterations and UpdateBranch::converged). One iteration is Method's update exactly.

A sensor takes it as its method [method-per-measurement]; a transform or a prediction has no posterior to relinearize at and refuses it, as do the updates given a block of the Rao-Blackwellized filters. With mixture noise each component's branch iterates on its own, since its posterior is its own.

The update of Bell and Cathey (1993), who show the iterated Kalman filter's update to be the Gauss-Newton method for the maximum a posteriori estimate, on a vector state. On a manifold, Hertzberg et al. (2013), §4.1 and table 1, take each Gauss-Newton step in the chart at the iterate, \( x_{i+1} = x_i \boxplus \Delta \); here every step is in the prior's chart instead, where the prior's own residual is \( \delta \) with covariance \( P \) as it stands, and the reset Jacobian carries the measurement's Jacobian there. Bell and Cathey leave the stopping rule open; this one is scaled by the prior so that one tolerance serves coordinates in any unit.

With a sigma-point method it is algorithm 1 of García-Fernández,Svensson, Morelande, and Särkkä (2015), the iterated posterior linearization filter, whose statistical linearization with respect to the current posterior approximation they show to minimize the expected divergence of the linearized from the true measurement density, and which they show to be the iterated extended Kalman filter when the moments are taken by linearization at the mean. They stop when the Kullback-Leibler divergence between successive posteriors falls below a threshold; this stops by the step in the mean, as above, so that one rule and one tolerance serve every method. The first iteration is the sigma-point update itself.

auto const ranger = measurementModel(rangeBearing, reads(path<Position>), additiveNoise(noise));
auto const result = filter.update(observe(methods::iterated(methods::linearized(), {.tolerance = 1e-6}), ranger, z));
// result.branches[0].iterations, .converged
auto const plf = observe(methods::iterated(methods::cubature()), ranger, z);
AdditiveNoise< typename internal::HeldOf< std::unwrap_ref_decay_t< Parts > >::type... > additiveNoise(Parts &&... parts)
Definition Policies.h:523
auto observe(Method method, M &&model, Z &&observation, Args &&... args)
Definition MeasurementModel.h:1399
auto reads(Items const &...)
Definition Policies.h:196
auto measurementModel(F &&function, Policies &&... policies)
Definition MeasurementModel.h:913
constexpr TagPath< Tags... > path
The path TagPath<Tags...> as a value, for a call that takes its paths as arguments rather than as tem...
Definition TagPath.h:372
constexpr Linearized linearized()
Definition Methods.h:333
Iterated< Method, Scalar > iterated(Method method={}, IteratedOptions< Scalar > options={})
Definition Methods.h:985
constexpr Cubature cubature()
Definition Methods.h:488

The tolerance and the iteration cap are run-time values, given to iterated() as an IteratedOptions, since they set how much work is done rather than which algorithm runs (decisions.md [policy-factories]). They are held in Scalar, double unless iterated() names it, so a float filter writes iterated<float>(method, {.tolerance = 1e-6f}) and holds no double [embedded-builds].

Template Parameters
Methodthe method relinearized: Linearized, or a sigma-point method
Scalarthe scalar of the tolerance

The documentation for this struct was generated from the following file: