EmrysFilter 0.1.0
State estimation utilities in C++23 using Eigen
Loading...
Searching...
No Matches
Resampling.h File Reference

The resamplers: function objects that draw ancestors in proportion to weights, which ParticleSet::resample() and the Resample upkeep action call. More...

#include <algorithm>
#include <cmath>
#include <concepts>
#include <cstddef>
#include <random>
#include <span>
#include <utility>
#include <vector>
#include <EmrysFilter/Core/Execution.h>
#include <EmrysFilter/Core/Macros.h>

Go to the source code of this file.

Classes

struct  Emrys::resamplers::Multinomial
 Draws each ancestor independently. More...
struct  Emrys::resamplers::Stratified
 Draws one uniform in each of M equal strata of [0, 1). More...
struct  Emrys::resamplers::Systematic
 Uses one uniform offset for M evenly spaced positions in [0, 1). More...
struct  Emrys::resamplers::Residual< Inner >
 Chooses index i floor( \( M w_i / \sum w \)) times deterministically, then draws the remainder with Inner from the fractional parts. More...

Namespaces

namespace  Emrys::resamplers
 The resamplers, each made by its factory (decisions.md [policy-factories]): multinomial(), stratified(), systematic(), and residual().

Concepts

concept  Emrys::Resampler
 Requirements on a resampler for scalar type Scalar and random generator G.
concept  Emrys::ResamplerWithScratch
 A Resampler that also takes scratch, called as r(weights, ancestors, rng, scratch) with scratch a std::span<Scalar> of at least weights.size() + ancestors.size() elements.
concept  Emrys::ResamplerUnder
 A Resampler that also runs under the execution policy P, called as r(policy, weights, ancestors, rng).

Functions

constexpr Multinomial Emrys::resamplers::multinomial ()
constexpr Stratified Emrys::resamplers::stratified ()
constexpr Systematic Emrys::resamplers::systematic ()
template<typename Inner = Multinomial>
constexpr Residual< Inner > Emrys::resamplers::residual (Inner inner={})

Detailed Description

The resamplers: function objects that draw ancestors in proportion to weights, which ParticleSet::resample() and the Resample upkeep action call.

Multinomial, stratified, systematic, and residual resampling, sequentially or under an execution policy, with the Resampler and ResamplerUnder concepts. Read ChiSquared.h next.