|
|
using | Scalar = typename Source::Scalar |
| | the scalar type
|
|
using | Index = Eigen::Index |
| | Eigen's index type.
|
|
using | SpaceType = SubSpace |
| | the selected block's space
|
|
using | allocator_type = typename Source::allocator_type |
| | the source's allocator
|
|
using | ParamsType = ParticleSet<SubSpace, Scalar, allocator_type> |
| | what copy() returns
|
|
using | MatrixType = typename ParamsType::MatrixType |
| | a matrix over the marginal's differences
|
|
using | WeightArrayType = typename ParamsType::WeightArrayType |
| | one entry per particle
|
|
using | LogWeightsType = typename Source::LogWeightsType |
| | the source's log-weights map
|
| using | IndexVectorType |
| | The selected state entries' indices.
|
| using | DifferenceIndexVectorType |
| | The selected bandwidth rows' indices.
|
|
using | StateType = decltype(std::declval<Source const &>().state(Index{})(std::declval<IndexVectorType const &>())) |
| | The selected entries of one particle's state, a lazy expression that reads the source.
|
|
using | value_type = Element |
| | an element, made when read
|
|
using | const_iterator = internal::ElementIterator<ParticleSetMarginal> |
| | iterates the particles
|
|
using | iterator = const_iterator |
| | iterates the particles; they are read-only
|
template<typename Source, typename Selection, typename SubSpace>
class Emrys::ParticleSetMarginal< Source, Selection, SubSpace >
Read-only view of a subset of the state entries of a ParticleSet.
Obtained from marginal(), and held by auto: its Selection is internal, so its type is never spelled, and a function that takes one takes it as a template parameter. It checks the source's shape. Weights are those of the source. A stored bandwidth is marginalized too, which keeps the kernel density estimate exact: the marginal of a KDE is the KDE of the marginal particles with bandwidth \( H_{aa} \).
It is a random-access range over the particles, as the marginal of a mixture is over the components (decisions.md [element-marginals]): each element, made when read, holds a particle's log-weight and the selected entries of its state, read in place, so iterating copies nothing.
for (
auto const & [
logWeight, position] : particles.marginal<Position>())
{
position.norm();
}
Scalar logWeight(Index i) const
Definition ParticleSet.h:1966
- Template Parameters
-
| Source | ParticleSet |
| Selection | an internal::Coordinates of the index sets of the selected block, from idx() for the states and diffIdx() for the bandwidth |
| SubSpace | space of the selected block |