The parameters of a Rao-Blackwellized particle filter's state: weighted particles for one block of the state, each carrying a Gaussian, or a hybrid of Gaussians, over the rest.
More...
|
|
using | Scalar = Scalar_ |
| | the scalar type
|
|
using | SpaceType = Space_ |
| | the whole state space
|
|
using | PathType = Path_ |
| | the path naming the sampled block
|
|
using | PinnedSpace = typename Split::PinnedSpace |
| | the sampled block's space
|
|
using | RestSpace = typename Split::RestSpace |
| | the rest's space, in order
|
|
using | CovarianceType = Covariance_ |
| | SharedCovariance or PerPointCovariance.
|
|
using | ConditionalType = Params<Component_> |
| | a particle's distribution over the rest: a Gaussian or a hybrid
|
|
using | allocator_type = Allocator_ |
| | the allocator, re-bound per buffer
|
|
using | ParticlesType = ParticleSet<PinnedSpace, Scalar_, Allocator_> |
| | the particles of the block
|
|
using | WeightArrayType = typename ParticlesType::WeightArrayType |
| | one entry per particle
|
|
using | LogWeightsType = typename ParticlesType::LogWeightsType |
| | the particles' log-weights map
|
|
using | MeansType = SampleSet<RestSpace, Scalar_> |
| | means over the rest, one per column
|
| using | DensityType |
| | what toDensity() returns
|
|
|
| ParticleGaussianParams (Space_ space, ParticlesType particles, ConditionalType const &conditional, Covariance_={}) |
| | particles of the block in space, each with conditional as its Gaussian, or its hybrid, over the rest.
|
template<typename MeansDerived>
requires (!IsHybrid) |
| | ParticleGaussianParams (Space_ space, ParticlesType particles, Eigen::MatrixBase< MeansDerived > const &means, typename Moments< RestSpace, Scalar_ >::MatrixType const &cov, Covariance_={}) |
| | particles of the block in space, particle i with the mean means.col(i) over the rest and the covariance cov, which the particles share or each start from.
|
|
| ParticleGaussianParams (Space_ space, ParticlesType particles, std::span< ConditionalType const > conditionals) |
| | particles of the block in space, particle i with the Gaussian, or the hybrid, conditionals[i] over the rest, from any contiguous storage, such as a vector or an array.
|
| Space_ const & | space () const |
| PinnedSpace const & | pinnedSpace () const |
| RestSpace const & | restSpace () const |
| BlockRows | pinnedRows () const |
| auto const & | restIndices () const |
| BlockRows | pinnedDifferenceRows () const |
| auto const & | restDifferenceIndices () const |
| Eigen::Index | size () const |
| allocator_type | get_allocator () const |
| void | setCapacity (Eigen::Index capacity) |
| | Reserves room for capacity particles and their Gaussians, and makes holding more a precondition violation.
|
| ParticlesType const & | particles () const |
| auto | particle (Eigen::Index i) const |
| LogWeightsType | logWeights () const |
| Scalar | logWeight (Eigen::Index i) const |
| std::expected< Scalar, WeightError > | logTotalWeight () const |
|
template<ExecutionPolicy P> |
| std::expected< Scalar, WeightError > | logTotalWeight (P &&policy) const |
| | logTotalWeight() under policy, a reduction over the particles (see Execution policies).
|
| std::expected< Scalar, WeightError > | ess () const |
|
template<ExecutionPolicy P> |
| std::expected< Scalar, WeightError > | ess (P &&policy) const |
| | ess() under policy, reductions over the particles (see Execution policies).
|
| Eigen::Index | mostProbable () const |
| decltype(auto) | conditional (Eigen::Index i) const |
| auto | modes () const |
| Moments< RestSpace, Scalar_ >::MatrixType const & | sharedCovariance () const |
| std::expected< void, NumericError > | factorize () const |
| | Checks the weights and factorizes each particle's Gaussian, the one they share once, or checks each particle's hybrid, so that the density's collapse reads a distribution.
|
| std::expected< DensityType, NumericError > | toDensity () const & |
| | Checks the state (factorize()) and views it.
|
|
void | toDensity () const &&=delete |
| | A density of a temporary would outlive it.
|
template<std::uniform_random_bit_generator G, typename R = resamplers::Systematic>
requires Resampler<R, Scalar, G> |
| std::expected< void, WeightError > | resample (G &rng, Eigen::Index newSize, R const &resampler={}) |
| | Resamples the particles to newSize in proportion to their weights with resampler, as ParticleSet::resample() does, each new particle taking its ancestor's Gaussian.
|
template<std::uniform_random_bit_generator G, typename R = resamplers::Systematic>
requires Resampler<R, Scalar, G> |
| std::expected< void, WeightError > | resample (G &rng, R const &resampler={}) |
| | Resamples to the current size().
|
template<ExecutionPolicy P, std::uniform_random_bit_generator G, typename R = resamplers::Systematic>
requires Resampler<R, Scalar, G> |
| std::expected< void, WeightError > | resample (P &&policy, G &rng, Eigen::Index newSize, R const &resampler={}) |
| | resample() under policy, as ParticleSet::resample() runs under one, with the ancestors' Gaussians gathered as a for-each (see Execution policies).
|
template<ExecutionPolicy P, std::uniform_random_bit_generator G, typename R = resamplers::Systematic>
requires Resampler<R, Scalar, G> |
| std::expected< void, WeightError > | resample (P &&policy, G &rng, R const &resampler={}) |
| | resample() to the current size() under policy.
|
| std::expected< Scalar, WeightError > | pruneBelow (Scalar logThreshold) |
| | Removes every particle whose normalized log-weight is below logThreshold, with its Gaussian, as ParticleSet::pruneBelow() does, and normalizes the weights of the rest.
|
| std::expected< Scalar, WeightError > | pruneTail (Scalar logFraction) |
| | Removes the lightest particles, with their Gaussians, as many as can be while their combined normalized weight stays below \( e^{\mathrm{logFraction}} \), as ParticleSet::pruneTail() does, and normalizes the weights of the rest.
|
| std::expected< Scalar, WeightError > | pruneToSize (Eigen::Index maxSize) |
| | Removes the lightest particles, with their Gaussians, until at most maxSize, at least one, remain, as ParticleSet::pruneToSize() does, and normalizes the weights of the rest.
|
|
template<typename Derived> |
| void | setParticleStates (Eigen::MatrixBase< Derived > const &states) |
| | Replaces the particles' values of the sampled block with the columns of states, one per particle, keeping their weights and Gaussians, as Roughen does.
|
template<Space Space_, typename Path_, typename Covariance_ = SharedCovariance, RealScalar Scalar_ = double, typename Allocator_ = DefaultAllocator, typename Component_ = Gaussian<typename internal::BlockSplit<Space_, Path_>::RestSpace, Scalar_>>
class Emrys::ParticleGaussianParams< Space_, Path_, Covariance_, Scalar_, Allocator_, Component_ >
The parameters of a Rao-Blackwellized particle filter's state: weighted particles for one block of the state, each carrying a Gaussian, or a hybrid of Gaussians, over the rest.
The marginalized particle representation of Doucet et al. (2000) and Schön, Gustafsson, and Nordlund (2005). The density is \( p(x) = \sum_i w_i \, \delta(x_p - p_i) \,
\mathcal{N}(x_r; \mu_i, \Sigma_i) \): the block \( x_p \) named by the path Path_ is sampled, and the rest \(x_r \) is Gaussian given each particle. With Covariance_ SharedCovariance, every particle's Gaussian has the same covariance; with PerPointCovariance, each has its own (see RbParticleFilter).
With Component_ a HybridGaussian over the rest, each particle holds an IMM's state instead, \( p(x) = \sum_i w_i \, \delta(x_p - p_i) \sum_m P(m \mid i) \, \mathcal{N}(x_r; \mu_{im}, \Sigma_{im}) \), whose modes() sums the particles' mode probabilities. Such a state has PerPointCovariance, since mixing a particle's modes gives each particle covariances of its own.
The particles are a ParticleSet over the block, read through particles(). Upkeep (see Upkeep) applies to the state as it does to a ParticleSet: resample() copies each particle's Gaussian along with it, so upkeep::whenEss(std::less{}, 0.5, upkeep::resample(rng)) works unchanged, and Roughen moves the particles while leaving their Gaussians alone.
Build one with particleGaussian() from particles and a Gaussian over the rest, or draw one from a Gaussian over the whole state with drawParticleGaussian(). Its collapse is its density's, the ParticleGaussian from toDensity(), which checks the weights and the Gaussians first.
The particles and their Gaussians come from the allocator (see Allocation). A state given a capacity with setCapacity() reserves room for that many particles, Gaussians, and scratch, so resampling and updating at a steady size allocate nothing.
- Template Parameters
-
- See also
- class ParticleGaussian, RbParticleFilter, GridGaussianParams