The record of a Kalman filter's forward pass that a smoother runs backward over: one PredictedJoint per prediction, each with room for its smoothed Gaussian.
More...
|
|
| GaussianHistory ()=default |
| | An empty history that keeps every step.
|
|
| GaussianHistory (Allocator_ const &allocator) |
| | An empty history that keeps every step, with nodes from allocator.
|
|
| GaussianHistory (Lag lag, Allocator_ const &allocator={}) |
| | An empty history that keeps the newest lag steps, with nodes from allocator.
|
|
| GaussianHistory (GaussianHistory const &other) |
| | Copies the steps into nodes from other's allocator (see Allocation).
|
|
| GaussianHistory (GaussianHistory const &other, Allocator_ const &allocator) |
| | Copies other's steps into nodes from allocator.
|
|
| GaussianHistory (GaussianHistory &&other)=default |
| | Takes other's steps.
|
|
| GaussianHistory (GaussianHistory &&other, Allocator_ const &allocator) |
| | Moves other's steps into nodes from allocator, taking its nodes when the allocators are equal.
|
|
GaussianHistory & | operator= (GaussianHistory const &other)=default |
| | Copies other's steps and lag.
|
|
GaussianHistory & | operator= (GaussianHistory &&other)=default |
| | Takes other's steps and lag, as std::list's move assignment does.
|
| allocator_type | get_allocator () const |
| std::optional< Index > | lag () const |
| Index | size () const |
| bool | empty () const |
| Step const & | front () const |
| Step const & | back () const |
| const_iterator | begin () const |
| const_iterator | end () const |
| void | push (JointType joint) |
| | Records joint as the newest step.
|
|
void | smooth (GaussianType const &latest) |
| | Fills every step's smoothed Gaussian by smoothStep(), from the newest back, given latest, the filter's state after the newest step: its posterior \( p(x_N \mid z_{1:N}) \), which is its own smoothed Gaussian.
|
|
void | clear () |
| | Drops every step, keeping the lag.
|
template<Space Space_, RealScalar Scalar_ = double, typename Allocator_ = DefaultAllocator>
class Emrys::GaussianHistory< Space_, Scalar_, Allocator_ >
The record of a Kalman filter's forward pass that a smoother runs backward over: one PredictedJoint per prediction, each with room for its smoothed Gaussian.
The caller keeps it, outside the filter (decisions.md [smoothing]): push() records the PredictedJoint a filter's predictJoint() returns, and smooth() takes the filter's current state, the latest posterior, and fills every step's smoothed Gaussian by smoothStep(), from the newest step back. Updates between predictions need no recording: a step's filtered Gaussian is the posterior at the moment of the prediction that follows them.
for (auto const & z : measurements)
{
history.
push(filter.predictJoint(dt));
if (!filter.update(fix(z))) { break; }
}
history.
smooth(filter.state());
for (auto const & step : history) { use(step.smoothed); }
GaussianHistory()=default
An empty history that keeps every step.
void push(JointType joint)
Records joint as the newest step.
Definition GaussianHistory.h:321
void smooth(GaussianType const &latest)
Fills every step's smoothed Gaussian by smoothStep(), from the newest back, given latest,...
Definition GaussianHistory.h:344
Without a Lag it keeps every step, for fixed-interval smoothing. With a Lag of \( L \) it keeps the newest \( L \), for fixed-lag smoothing: once full, each push() reuses the oldest step's node for the new one, so it allocates nothing after the first \( L \), and after smooth() the oldest step, front(), holds \( \hat x_{k-L \mid k} \).
Fixed-lag smoothing as the backward pass over the window is that of Särkkä (2013), chapter 10, which costs \( O(L) \) backward steps per filter step; the history doesn't keep the smoothed Gaussians between calls, since a new measurement changes every one of them.
The steps live in a std::list from the allocator, one node per step, so recording never moves the steps already recorded, and a growing history asks its allocator for one node per push(), never for a larger block to copy into. Nothing else is allocated for a bounded space.
- Template Parameters
-
| Space_ | the state space |
| Scalar_ | scalar type, double by default |
| Allocator_ | allocator for the steps, re-bound to the list's nodes (see Allocation) |
- See also
- smoothStep(), PredictedJoint, KalmanFilter::predictJoint(), Smoothers