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

What a mixture filter's update did: each prior component's update before reduction, the observation's log-likelihood under the whole mixture, and whether any component accepted the measurement. More...

#include <EmrysFilter/Filters/MixtureFilter.h>

Public Types

using ComponentUpdateType = ComponentUpdate
 one component's update
using ComponentsType = internal::Buffer<ComponentUpdate, Allocator>
 the components' container

Public Member Functions

 MixtureFilterUpdate ()=default
 an empty result, from a default-constructed allocator
 MixtureFilterUpdate (Allocator const &allocator)
 An empty result whose components come from allocator.
Allocator get_allocator () const
Scalar logLikelihood () const
std::ranges::iota_view< Eigen::Index, Eigen::Index > posteriorIndices (Eigen::Index i) const

Public Attributes

ComponentsType components
 one per prior component, in order
bool accepted = false
 whether any component accepted the measurement

Detailed Description

template<typename ComponentUpdate, typename Scalar = double, typename Allocator = DefaultAllocator>
struct Emrys::MixtureFilterUpdate< ComponentUpdate, Scalar, Allocator >

What a mixture filter's update did: each prior component's update before reduction, the observation's log-likelihood under the whole mixture, and whether any component accepted the measurement.

components[i] is the update of the prior's component i by its recursion: a FilterUpdate for a Gaussian, with its own log-likelihood \( \log p(z \mid i) \), its noise components' posterior probabilities, and their NIS; an ImmFilterUpdate for a hybrid state. Its accepted is false when the recursion, such as a Gate's policy, dropped that component. When accepted is false here, no component with a nonzero weight accepted the measurement and the state kept its prior (decisions.md [update-outcomes]). Prior weights that cannot be normalized are an error of the update, not a result. posteriorIndices(i) gives the components of the state that prior component i became.

The components and the posterior indices come from Allocator, the indices reserved by the state's capacity where it has one. Passing the same result, made from the allocator, to each MixtureFilter::update(measurement, policy, result) reuses their storage.

Template Parameters
ComponentUpdatewhat the recursion's update returns for one component
Scalarscalar type, double by default
Allocatorallocator for the components' updates (see Allocation)

Member Function Documentation

◆ get_allocator()

template<typename ComponentUpdate, typename Scalar = double, typename Allocator = DefaultAllocator>
Allocator Emrys::MixtureFilterUpdate< ComponentUpdate, Scalar, Allocator >::get_allocator ( ) const
inlinenodiscard
Returns
the allocator the components come from

◆ logLikelihood()

template<typename ComponentUpdate, typename Scalar = double, typename Allocator = DefaultAllocator>
Scalar Emrys::MixtureFilterUpdate< ComponentUpdate, Scalar, Allocator >::logLikelihood ( ) const
inlinenodiscard
Returns
\( \log p(z) = \log \sum_i w_i \, p(z \mid i) \), with the prior weights normalized

◆ posteriorIndices()

template<typename ComponentUpdate, typename Scalar = double, typename Allocator = DefaultAllocator>
std::ranges::iota_view< Eigen::Index, Eigen::Index > Emrys::MixtureFilterUpdate< ComponentUpdate, Scalar, Allocator >::posteriorIndices ( Eigen::Index i) const
inlinenodiscard
Returns
the indices in the filter's state() of the components that prior component i became, consecutive and in order: none if its policy dropped it, one if the policy reduced it to one component, and one per kept branch if the policy kept several. The components of the priors before i come first, so with Collapse and nothing dropped prior i is posterior i. When accepted is false the state kept its prior, and prior i is still component i. The indices hold until the state next changes, as by a reduction through state(); the state's lineage follows the components through those too (MixtureLineage).

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