The parameters of a Rao-Blackwellized point-mass filter's state: the cells of a grid still alive, their probabilities, and for each a Gaussian, or a hybrid of Gaussians, over the rest of the state.
More...
|
|
using | GridType = Grid_ |
| | The grid.
|
|
using | Scalar = typename Grid_::Scalar |
| | The scalar type.
|
|
using | SpaceType = typename Grid_::SpaceType |
| | The whole state space.
|
|
using | CellsType = typename Grid_::CellsType |
| | The discrete space of cells.
|
|
using | RestSpace = typename Grid_::RestSpace |
| | The rest's space, in order.
|
|
using | PinnedSpace = typename Grid_::PinnedSpace |
| | The fixed block's space.
|
|
using | CovarianceType = Covariance_ |
| | SharedCovariance or PerPointCovariance.
|
|
using | ConditionalType = Params<Component_> |
| | A cell's distribution over the rest: a Gaussian, or a hybrid of Gaussians.
|
|
using | WeightArrayType = Eigen::Array<Scalar, Eigen::Dynamic, 1> |
| | One entry per live cell.
|
|
using | LogWeightsType = Eigen::Map<WeightArrayType const> |
| | The live cells' log-probabilities.
|
|
using | allocator_type = typename Grid_::allocator_type |
| | The grid's allocator.
|
|
using | DensityType = GridGaussian<Grid_, Covariance_, Component_> |
| | The view toDensity() returns.
|
|
|
| GridGaussianParams (Grid_ grid, ConditionalType const &conditional, Covariance_={}) |
| | Every cell of grid alive and equally probable, each with conditional as its Gaussian over the rest of the state.
|
| allocator_type | get_allocator () const |
| Grid_ const & | grid () const |
| Eigen::Index | size () const |
| Eigen::Index | cell (Eigen::Index i) const |
| std::span< Eigen::Index const > | cells () const |
| std::optional< Eigen::Index > | find (Eigen::Index cell) const |
| auto | center (Eigen::Index i) const |
| LogWeightsType | logWeights () const |
| Scalar | logWeight (Eigen::Index i) const |
| Eigen::Index | mostProbable () const |
| CategoricalParams< CellsType, Scalar > | toCategorical () const |
| template<typename P> |
| auto | marginal () const |
| std::expected< void, WeightError > | setWeights (CategoricalParams< CellsType, Scalar > const &weights) |
| | Replaces the live cells' weights with those of weights, normalized over the live cells, as for a prior that isn't uniform.
|
| decltype(auto) | conditional (Eigen::Index i) const |
| auto | modes () const |
| Moments< RestSpace, Scalar >::MatrixType const & | sharedCovariance () const |
| std::expected< void, NumericError > | factorize () const |
| | Factorizes each live cell's Gaussian, the one they share once, or checks each cell's hybrid, so that the density's collapse reads a distribution; the cells' weights always define one.
|
| std::expected< DensityType, NumericError > | toDensity () const & |
| | Checks the cells (factorize()) and views the state.
|
|
void | toDensity () const &&=delete |
| | A density of a temporary would outlive it.
|
| Scalar | pruneBelow (Scalar logThreshold) |
| | Removes every live cell whose log-probability is below logThreshold, and renormalizes; the most probable cell is always kept, the first of them if several are.
|
| Scalar | pruneTail (Scalar logFraction) |
| | Removes the least probable live cells, as many as can be while their combined probability stays below \( e^{\mathrm{logFraction}} \), and renormalizes.
|
| Scalar | pruneToSize (Eigen::Index maxSize) |
| | Removes the least probable live cells until at most maxSize, at least one, remain, and renormalizes.
|
| void | subdivide (Eigen::Index factor) |
| | Splits every live cell into factor cells along each axis (see PointGrid::subdivided()), each with an equal share of its probability and a copy of its Gaussian.
|
template<typename Grid_, typename Covariance_ = SharedCovariance, typename Component_ = Gaussian<typename Grid_::RestSpace, typename Grid_::Scalar>>
class Emrys::GridGaussianParams< Grid_, Covariance_, Component_ >
The parameters of a Rao-Blackwellized point-mass filter's state: the cells of a grid still alive, their probabilities, and for each a Gaussian, or a hybrid of Gaussians, over the rest of the state.
The density is \( p(x) = \sum_c P(c) \, \delta(x_p - p_c) \, \mathcal{N}(x_r; \mu_c, \Sigma_c) \) over the live cells \( c \), where \( p_c \) is the cell's center (widened by its covariance about the center, if the grid has one). With Component_ a HybridGaussian over the rest, each cell holds an IMM's state instead, \( p(x) = \sum_c P(c) \, \delta(x_p - p_c) \sum_m P(m \mid c) \, \mathcal{N}(x_r; \mu_{cm}, \Sigma_{cm}) \), whose modes() sums the cells' mode probabilities. Only cells of nonzero probability are stored, in increasing order of their flat index, so a cell is addressed two ways: by its position i among the live cells (conditional(i), center(i), logWeight(i)), and by its flat index in the grid's cells (cell(i), find()). A cell whose probability becomes zero, by a gate, by pruning, or by setWeights(), is removed for good, since nothing moves probability between cells.
With Covariance_ SharedCovariance, every cell has the same covariance; with PerPointCovariance, each has its own (see RbPointMassFilter). A cell that holds a hybrid has PerPointCovariance, since mixing its modes gives each cell covariances of its own.
Upkeep (see Upkeep) keeps the number of live cells in bounds: pruneBelow(), pruneTail(), and pruneToSize() remove the improbable cells, and on a regular grid with at most one cell covariance, subdivide() splits every live cell.
The live cells, their probabilities, and their Gaussians come from the grid's allocator (see Allocation), and removing cells reuses that storage.
filter.state().size();
filter.state().toDensity()->collapsed();
constexpr Subdivide subdivide(std::ptrdiff_t factor=2)
Definition Upkeep.h:1071
constexpr PruneBelow< internal::DeducedScalar< Value > > pruneBelow(Value probability)
Definition Upkeep.h:954
WhenSize< Compare, Actions... > whenSize(Compare compare, std::ptrdiff_t limit, Actions... actions)
Definition Upkeep.h:852
The axis of a regular grid of points (see regularGrid()) along coordinate I of the block Block: a run...
Definition GridGaussian.h:68
- Template Parameters
-
template<typename Grid_, typename Covariance_ = SharedCovariance, typename Component_ = Gaussian<typename Grid_::RestSpace, typename Grid_::Scalar>>
Splits every live cell into factor cells along each axis (see PointGrid::subdivided()), each with an equal share of its probability and a copy of its Gaussian.
The grid is replaced by the subdivided one, so flat cell indices change.
With the cell covariance \( \mathrm{diag}(s^2 / 12) \) of a cell of width \( s \), the collapsed mean and covariance don't change. Without a cell covariance the cells are point masses, and the children spread over their parent's cell: the mean doesn't change, and the variance along each axis grows by \( \tfrac{s^2}{12} (1 - 1 / k^2) \), \( k \) the factor. For a grid that samples a density at its centers, this brings it closer to that density; where the points mean exactly what they say, don't subdivide.