|
|
| CategoricalHistory ()=default |
| | An empty history that keeps every step.
|
|
| CategoricalHistory (Allocator_ const &allocator) |
| | An empty history that keeps every step, with nodes from allocator.
|
|
| CategoricalHistory (Lag lag, Allocator_ const &allocator={}) |
| | An empty history that keeps the newest lag steps, with nodes from allocator.
|
|
| CategoricalHistory (CategoricalHistory const &other) |
| | Copies the steps into nodes from other's allocator (see Allocation).
|
|
| CategoricalHistory (CategoricalHistory const &other, Allocator_ const &allocator) |
| | Copies other's steps into nodes from allocator.
|
|
| CategoricalHistory (CategoricalHistory &&other)=default |
| | Takes other's steps.
|
|
| CategoricalHistory (CategoricalHistory &&other, Allocator_ const &allocator) |
| | Moves other's steps into nodes from allocator, taking its nodes when the allocators are equal.
|
|
CategoricalHistory & | operator= (CategoricalHistory const &other)=default |
| | Copies other's steps and lag.
|
|
CategoricalHistory & | operator= (CategoricalHistory &&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 (CategoricalType const &latest) |
| | Fills every step's smoothed distribution 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 distribution.
|
|
void | clear () |
| | Drops every step, keeping the lag.
|
template<DiscreteSpace Space_, RealScalar Scalar_ = double, typename Allocator_ = DefaultAllocator>
class Emrys::CategoricalHistory< Space_, Scalar_, Allocator_ >
The record of a HiddenMarkovFilter's forward pass that a smoother runs backward over: one CategoricalPredictedJoint per prediction, each with room for its smoothed distribution.
GaussianHistory for a discrete state (decisions.md [smoothing], [emissions]), with the same interface: push() records the joint a filter's predictJoint() returns, smooth() takes the filter's current state and fills every step's smoothed distribution by smoothStep(), from the newest step back, and a Lag makes it a fixed-lag window that recycles its oldest node. Updates between predictions need no recording. The same record gives the most probable sequence (mostProbableSequence()) and the pairwise transition posteriors (transitionPosterior()).
for (auto const & z : observations)
{
history.
push(filter.predictJoint());
static_cast<void>(filter.update(table.observe(z)));
}
history.
smooth(filter.state());
for (auto const & step : history) { use(step.smoothed); }
CategoricalHistory()=default
An empty history that keeps every step.
void push(JointType joint)
Records joint as the newest step.
Definition CategoricalHistory.h:333
void smooth(CategoricalType const &latest)
Fills every step's smoothed distribution by smoothStep(), from the newest back, given latest,...
Definition CategoricalHistory.h:354
ValueSequence< Space, Scalar, Allocator > mostProbableSequence(CategoricalHistory< Space, Scalar, Allocator > const &history, CategoricalParams< Space, Scalar > const &latest)
Definition CategoricalHistory.h:419
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
For a bounded space every step is inline in its node, so a fixed-lag history allocates nothing once full.
- Template Parameters
-
| Space_ | the discrete space |
| Scalar_ | scalar type of the probabilities, double by default |
| Allocator_ | allocator for the steps, re-bound to the list's nodes (see Allocation) |
- See also
- smoothStep(), CategoricalPredictedJoint, HiddenMarkovFilter::predictJoint(), Smoothers