The third layer (decisions.md [layered-headers]): the distributions, each stored as parameters and evaluated through a density, and what is computed from them.
More...
|
| class | Emrys::CategoricalParams< Space_, Scalar_ > |
| | The parameters of a probability distribution over a discrete space: one weight per value. More...
|
| class | Emrys::Categorical< Space_, Scalar_ > |
| | The probabilities of a CategoricalParams whose weights define a distribution: a read-only view. More...
|
| class | Emrys::MarkovChain< Space_, Scalar_ > |
| | A Markov chain on a discrete space: the probability of moving from each value to each value in one step. More...
|
| struct | Emrys::ComponentTraits< C > |
| | What a container does with a component beyond the component's own members (decisions.md [component-first]): logDensity(component, x), the log-density read from the component's factorization without a check of its own, for a container's density view that already holds one [execution-policies]; collapse(count, componentAt, logWeightAt), the collapse of several components into one by moment matching; moments(component), its mean and covariance, read without a check, for a container's density view that has checked it, as a hybrid's needs no member for them; and MarginalType, the view of a subset of one component's coordinates that a marginal of the container gives per component [element-marginals]. More...
|
| struct | Emrys::SharedCovariance |
| | One covariance for every point. More...
|
| struct | Emrys::PerPointCovariance |
| | A covariance per point. More...
|
| class | Emrys::ContinuousTimeMarkovChain< Space_, Scalar_ > |
| | A continuous-time Markov chain on a discrete space: the rate of moving from each value to each other value. More...
|
| struct | Emrys::FitOptions< Scalar > |
| | Options for fitMixture(). More...
|
| struct | Emrys::MixtureFit< Space, Scalar, Allocator > |
| | Result of fitMixture(), in Space, with the source's allocator. More...
|
| class | Emrys::Gamma< Space_, Scalar_ > |
| | Independent Gamma distributions on the coordinates, for positive quantities such as ranges, speeds, and rates. More...
|
| struct | Emrys::GaussianConditional< Space_, Scalar_ > |
| | The result of GaussianParams::conditionalWithEvidence(): the conditional distribution and the log-evidence of the given values. More...
|
| class | Emrys::GaussianParams< Space_, Scalar_ > |
| | A Gaussian distribution: a mean and covariance in a space. More...
|
| class | Emrys::Gaussian< Space_, Scalar_ > |
| | The density of a Gaussian whose covariance has been factorized: a read-only view. More...
|
| class | Emrys::GaussianMarginal< Source, Selection, SubSpace > |
| | Read-only view of a subset of the entries of a GaussianParams or Gaussian. More...
|
| class | Emrys::FormGaussian< Params_ > |
| | The density of a Gaussian in a square-root or information form: a read-only view. More...
|
| struct | Emrys::GridAxis< Block, I > |
| | The axis of a regular grid of points (see regularGrid()) along coordinate I of the block Block: a run-time number of cells. More...
|
| struct | Emrys::GridCells< Path > |
| | The cells of a regular grid over the block named by the path Path: the DiscreteProduct of its GridAxis axes, the last varying fastest, under a tag of its own. More...
|
| struct | Emrys::PointCells< Path > |
| | The cells of a grid of given points (see pointGrid()) for the block named by the path Path: one value per point, under a tag of its own. More...
|
| class | Emrys::PointGrid< Space_, Path_, Cells_, CellCovariance_, Scalar_, Allocator_ > |
| | Fixed points for the block named by the path Path_ of a state in Space_, one per value of the discrete space Cells_, such as the cells of a grid of positions. More...
|
| 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. More...
|
| class | Emrys::GridGaussian< Grid_, Covariance_, Component_ > |
| | The density of a Rao-Blackwellized point-mass filter's state, a checked view of its GridGaussianParams (decisions.md [params-and-density], [view-stamp]): \( p(x) = \sum_c P(c) \, \delta(x_p - p_c) \, \mathcal{N}(x_r; \mu_c, \Sigma_c) \) over the live cells, or the hybrid of Gaussians in each cell. More...
|
| class | Emrys::HybridParams< Component_, ModeSpace_, Allocator_ > |
| | The parameters of a hybrid state: a discrete mode, and a component conditioned on each mode. More...
|
| class | Emrys::Hybrid< Component_, ModeSpace_, Allocator_ > |
| | The density of a hybrid state, a checked view of its HybridParams (decisions.md [params-and-density], [view-stamp]): \( p(x, m) = P(m) \, p_m(x) \), with \( P(m) = w_m / \sum_n w_n \). More...
|
| class | Emrys::InfoGaussianParams< Space_, Scalar_ > |
| | A Gaussian kept as its precision and information vector, about a reference value. More...
|
| class | Emrys::KernelDensity< Space_, Scalar_, Allocator_ > |
| | Gaussian kernel density estimate over a ParticleSet. More...
|
| struct | Emrys::ComponentError |
| | A mixture component that could not be factorized. More...
|
| class | Emrys::MixtureLineage< Scalar_, Allocator_ > |
| | How each component of a Mixture descends from the components it had at its last startLineage(): each component's share from each of those parents. More...
|
| class | Emrys::MixtureParams< Component_, Allocator_ > |
| | A weighted sum of components of one type, all in one space. More...
|
| class | Emrys::Mixture< Component_, Allocator_ > |
| | The density of a Mixture whose components have been factorized: a read-only view. More...
|
| class | Emrys::MixtureMarginal< Source, Selection, SubSpace > |
| | Read-only view of a subset of the coordinates of every component of a mixture or a hybrid, which iterates the components and gives each one's marginal in turn (decisions.md [element-marginals]). More...
|
| class | Emrys::Moments< Space_, Scalar_ > |
| | First and second moments (mean and covariance) of a distribution. More...
|
| struct | Emrys::ParamsOf< D > |
| | The parameters of the density D, as its member ParamsType: the type it borrows from, or what a marginal's copy() returns. More...
|
| struct | Emrys::DensityOf< P > |
| | The density of the parameters P, as its member DensityType: what its toDensity() returns. More...
|
| 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. More...
|
| class | Emrys::ParticleGaussian< Space_, Path_, Covariance_, Scalar_, Allocator_, Component_ > |
| | The density of a Rao-Blackwellized particle filter's state, a checked view of its ParticleGaussianParams (decisions.md [params-and-density], [view-stamp]): \( p(x) = \sum_i w_i \, \delta(x_p - p_i) \, \mathcal{N}(x_r; \mu_i, \Sigma_i) \), or with a hybrid per particle, a mixture over its modes in place of each Gaussian. More...
|
| class | Emrys::ParticleSet< Space_, Scalar_, Allocator_ > |
| | A set of weighted samples: the empirical distribution. More...
|
| class | Emrys::ParticleSetMarginal< Source, Selection, SubSpace > |
| | Read-only view of a subset of the state entries of a ParticleSet. More...
|
| class | Emrys::EachRepetition< F, BlockSpace > |
| | One factor on every repetition of a repeated block: the product of independent copies of a density, one per repetition, as a density over the whole block (decisions.md [product-factors]). More...
|
| class | Emrys::Factors< Placed > |
| | The factors of a product, each placed by tag path with on() or onEach(), in no space yet: a Product once placed in one (decisions.md [product-factors]). More...
|
| class | Emrys::Product< Space_, Scalar_, Factors_ > |
| | The product of independent densities, each on its own coordinates of a space. More...
|
| struct | Emrys::roots::NoReport |
| | The report of axes or a repair with nothing to say, as Cholesky's: it either took the root or failed. More...
|
| struct | Emrys::roots::ClampReport |
| | The report of Pivoted, Principal, and Symmetric: how many pivots or eigenvalues were below zero and taken as zero, which only rounding should give a covariance. More...
|
| struct | Emrys::roots::RidgeReport< Scalar > |
| | The report of a Ridge: the ridge \( \delta \) it added to the diagonal. More...
|
| struct | Emrys::roots::Cholesky |
| | Cholesky axes: the lower Cholesky factor \( L \), \( L L^T = P \), by Eigen's LLT, which fails on a covariance that is not positive definite. More...
|
| struct | Emrys::roots::Pivoted |
| | Pivoted axes: \( \Pi^T L D^{1/2} \) from Eigen's pivoted LDL decomposition \( P = \Pi^T L D L^T \Pi \), with a negative pivot, which rounding can give a singular matrix, taken as zero. More...
|
| struct | Emrys::roots::Principal |
| | Principal axes: \( U \Lambda^{1/2} \), the eigenvectors of \( P = U \Lambda U^T \) scaled by the roots of their eigenvalues, largest first, with a negative eigenvalue taken as zero, so that it never fails. More...
|
| struct | Emrys::roots::Symmetric |
| | Symmetric axes: the principal square root \( P^{1/2} = U \Lambda^{1/2} U^T \), the one symmetric positive semidefinite root, with a negative eigenvalue taken as zero, so that it never fails. More...
|
| struct | Emrys::roots::Along< Vector > |
| | Axes along a direction: a root whose first column is parallel to \( d \), so that a sigma-point rule puts its first pair of points on the line through the mean along \( d \), as a split or a probe of the nonlinearity along \( d \) needs (decisions.md [splitting-hooks]). More...
|
| struct | Emrys::roots::Ridge< Relative, Absolute > |
| | The ridge repair: the Gershgorin ridge of decisions.md [covariance-repair], added to the diagonal of a covariance whose root failed so that the root can be retried. More...
|
| struct | Emrys::roots::WithFallbacks< Head, Fallbacks > |
| | Axes that can fail, followed by their fallbacks, tried in order (decisions.md [sigma-point-axes]): a repair, which retries Head on the covariance it repairs, or other axes, which take the root themselves. More...
|
| struct | Emrys::roots::RootWithReport< Matrix, Report > |
| | A root and the report of the axes that took it, from squareRootWithReport(). More...
|
| struct | Emrys::roots::RootFailure< Report > |
| | Why squareRootWithReport() failed, and what each entry tried did. More...
|
| struct | Emrys::SamplesWithLogDensity< Space, Scalar > |
| | Samples in Space together with the log of the density they were drawn from, evaluated at each. More...
|
| struct | Emrys::SampleWithLogDensity< Space, Scalar > |
| | One sample in Space, in a vector sized by the space, together with the log of the density it was drawn from, evaluated at it: what drawSampleWithLogDensity() returns, so that a bounded space allocates nothing [allocation]. More...
|
| class | Emrys::SqrtGaussianParams< Space_, Scalar_ > |
| | A Gaussian kept as a mean and a lower-triangular root of its covariance. More...
|
| class | Emrys::SqrtInfoGaussianParams< Space_, Scalar_ > |
| | A Gaussian kept as an upper-triangular root of its precision and a whitened offset, about a reference value. More...
|
| class | Emrys::StudentT< Space_, Scalar_ > |
| | The multivariate Student-t distribution: a Gaussian with heavier tails. More...
|
| class | Emrys::Uniform< Space_, Scalar_ > |
| | The uniform distribution over a box in a space. More...
|
| class | Emrys::UniformGrid< Space_, Scalar_ > |
| | The equal-weight components of a grid over some coordinates of a space, made one at a time when read: what uniformComponents() returns. More...
|
|
| template<typename Scalar, typename Space> |
| CategoricalParams< Space, Scalar > | Emrys::predict (CategoricalParams< Space, Scalar > const &prior, MarkovChain< Space, Scalar > const &chain) |
| template<typename Scalar, typename Space> |
| std::expected< CategoricalParams< Space, Scalar >, ChainError > | Emrys::stationary (MarkovChain< Space, Scalar > const &chain) |
| template<typename Scalar, typename Space, std::uniform_random_bit_generator G> |
| std::vector< Eigen::Index > | Emrys::drawSamples (Categorical< Space, Scalar > const &distribution, Eigen::Index n, G &rng) |
| template<typename Scalar, typename Space, std::uniform_random_bit_generator G> |
| Eigen::Index | Emrys::drawSample (Categorical< Space, Scalar > const &distribution, G &rng) |
| template<typename Scalar, typename Space> |
| CategoricalParams< Space, Scalar > | Emrys::predict (CategoricalParams< Space, Scalar > const &prior, ContinuousTimeMarkovChain< Space, Scalar > const &chain, TimeStep< Scalar > auto const &dt) |
| template<typename Scalar, typename Space> |
| std::expected< CategoricalParams< Space, Scalar >, ChainError > | Emrys::stationary (ContinuousTimeMarkovChain< Space, Scalar > const &chain) |
| template<typename Scalar, typename Space, typename Allocator, std::uniform_random_bit_generator G> |
| std::expected< MixtureFit< Space, Scalar, Allocator >, FitError > | Emrys::fitMixture (ParticleSet< Space, Scalar, Allocator > const &particles, Eigen::Index k, G &rng, FitOptions< Scalar > const &options={}) |
| template<typename Scalar, typename Space, typename Allocator, std::uniform_random_bit_generator G> |
| std::expected< MixtureFit< Space, Scalar, Allocator >, FitError > | Emrys::fitMixture (GaussianMixture< Space, Scalar, Allocator > const &mixture, Eigen::Index k, G &rng, FitOptions< Scalar > const &options={}) |
| template<typename Scalar, typename Space, typename Allocator, typename SeedAllocator, std::uniform_random_bit_generator G> |
| std::expected< MixtureFit< Space, Scalar, Allocator >, FitError > | Emrys::fitMixture (ParticleSet< Space, Scalar, Allocator > const &particles, GaussianMixture< Space, Scalar, SeedAllocator > const &seedsFrom, Eigen::Index k, G &rng, FitOptions< Scalar > const &options={}) |
| template<ExecutionPolicy P, typename Scalar, typename Space, typename Allocator, std::uniform_random_bit_generator G> |
| std::expected< MixtureFit< Space, Scalar, Allocator >, FitError > | Emrys::fitMixture (P &&policy, ParticleSet< Space, Scalar, Allocator > const &particles, Eigen::Index k, G &rng, FitOptions< Scalar > const &options={}) |
| | fitMixture() of particles under policy: each E-step is a for-each over the particles, and each M-step's moments are reductions over them, which match Sequential's to rounding (see Execution policies).
|
|
template<ExecutionPolicy P, typename Scalar, typename Space, typename Allocator, std::uniform_random_bit_generator G> |
| std::expected< MixtureFit< Space, Scalar, Allocator >, FitError > | Emrys::fitMixture (P &&policy, GaussianMixture< Space, Scalar, Allocator > const &mixture, Eigen::Index k, G &rng, FitOptions< Scalar > const &options={}) |
| | fitMixture() of mixture under policy, a for-each and reductions over its components as fitMixture(P &&, ParticleSet const &, Eigen::Index, G &, FitOptions const &) runs over particles.
|
|
template<ExecutionPolicy P, typename Scalar, typename Space, typename Allocator, typename SeedAllocator, std::uniform_random_bit_generator G> |
| std::expected< MixtureFit< Space, Scalar, Allocator >, FitError > | Emrys::fitMixture (P &&policy, ParticleSet< Space, Scalar, Allocator > const &particles, GaussianMixture< Space, Scalar, SeedAllocator > const &seedsFrom, Eigen::Index k, G &rng, FitOptions< Scalar > const &options={}) |
| | fitMixture() of particles seeded from seedsFrom, under policy, as fitMixture(P &&, ParticleSet const &, Eigen::Index, G &, FitOptions const &) runs.
|
| template<typename Scalar, typename Space, std::uniform_random_bit_generator G> |
| SampleSet< Space, Scalar > | Emrys::drawSamples (Gamma< Space, Scalar > const &gamma, Eigen::Index n, G &rng) |
| template<typename Scalar, typename Space, std::uniform_random_bit_generator G> |
| Moments< Space, Scalar >::VectorType | Emrys::drawSample (Gamma< Space, Scalar > const &gamma, G &rng) |
| template<typename Scalar, typename Space, std::uniform_random_bit_generator G> |
| SamplesWithLogDensity< Space, Scalar > | Emrys::drawSamplesWithLogDensity (Gamma< Space, Scalar > const &gamma, Eigen::Index n, G &rng) |
| template<typename Scalar, typename Space, std::uniform_random_bit_generator G> |
| SampleWithLogDensity< Space, Scalar > | Emrys::drawSampleWithLogDensity (Gamma< Space, Scalar > const &gamma, G &rng) |
| template<GaussianForm G> |
| std::expected< GaussianParams< typename G::SpaceType, typename G::Scalar >, GaussianError > | Emrys::toGaussian (G const &form) |
| template<typename Params_, std::uniform_random_bit_generator G> |
| SampleSet< typename Params_::SpaceType, typename Params_::Scalar > | Emrys::drawSamples (FormGaussian< Params_ > const &gaussian, Eigen::Index n, G &rng) |
| template<typename Params_, std::uniform_random_bit_generator G> |
| Moments< typenameParams_::SpaceType, typenameParams_::Scalar >::VectorType | Emrys::drawSample (FormGaussian< Params_ > const &gaussian, G &rng) |
| template<typename Params_, std::uniform_random_bit_generator G> |
| SamplesWithLogDensity< typename Params_::SpaceType, typename Params_::Scalar > | Emrys::drawSamplesWithLogDensity (FormGaussian< Params_ > const &gaussian, Eigen::Index n, G &rng) |
| template<typename Params_, std::uniform_random_bit_generator G> |
| SampleWithLogDensity< typename Params_::SpaceType, typename Params_::Scalar > | Emrys::drawSampleWithLogDensity (FormGaussian< Params_ > const &gaussian, G &rng) |
| template<typename P, Space S, typename Derived, typename Allocator = DefaultAllocator> |
| auto | Emrys::pointGrid (S space, Eigen::MatrixBase< Derived > const ¢ers, std::optional< typename Moments< internal::PathTag< P >, typename Derived::Scalar >::MatrixType > cellCovariance={}, Allocator const &allocator={}) |
| template<typename P, Space S, typename Derived, typename Allocator = DefaultAllocator> |
| auto | Emrys::pointGrid (S space, Eigen::MatrixBase< Derived > const ¢ers, std::span< typename Moments< internal::PathTag< P >, typename Derived::Scalar >::MatrixType const > cellCovariances, Allocator const &allocator={}) |
|
template<FixedSizeSpace S, typename P, typename Derived, typename Allocator = DefaultAllocator> |
| auto | Emrys::pointGrid (Eigen::MatrixBase< Derived > const ¢ers, std::optional< typename Moments< internal::PathTag< P >, typename Derived::Scalar >::MatrixType > cellCovariance={}, Allocator const &allocator={}) |
| | pointGrid(space, centers, ...) in the FixedSizeSpace S, named as the first template argument: pointGrid<State, Position>(centers) (decisions.md [space-storage]).
|
|
template<FixedSizeSpace S, typename P, typename Derived, typename Allocator = DefaultAllocator> |
| auto | Emrys::pointGrid (Eigen::MatrixBase< Derived > const ¢ers, std::span< typename Moments< internal::PathTag< P >, typename Derived::Scalar >::MatrixType const > cellCovariances, Allocator const &allocator={}) |
| | pointGrid(space, centers, cellCovariances, ...) in the FixedSizeSpace S, named as the first template argument.
|
| template<typename P, Space S, typename FirstDerived, typename SpacingDerived, typename Allocator = DefaultAllocator> |
| auto | Emrys::regularGrid (S space, Eigen::MatrixBase< FirstDerived > const &first, Eigen::MatrixBase< SpacingDerived > const &spacing, std::array< Eigen::Index, std::size_t(internal::PathTag< P >::FixedValueDimension)> const &counts, std::optional< typename Moments< internal::PathTag< P >, typename FirstDerived::Scalar >::MatrixType > cellCovariance={}, Allocator const &allocator={}) |
| template<typename P, Space S, typename FirstDerived, typename SpacingDerived, typename Allocator = DefaultAllocator> |
| auto | Emrys::regularGrid (S space, Eigen::MatrixBase< FirstDerived > const &first, Eigen::MatrixBase< SpacingDerived > const &spacing, std::array< Eigen::Index, std::size_t(internal::PathTag< P >::FixedValueDimension)> const &counts, std::span< typename Moments< internal::PathTag< P >, typename FirstDerived::Scalar >::MatrixType const > cellCovariances, Allocator const &allocator={}) |
| | regularGrid() with cellCovariances, each cell's covariance about its center in flat-index order, as on a latitude-longitude grid whose cells narrow toward the poles.
|
|
template<FixedSizeSpace S, typename P, typename FirstDerived, typename SpacingDerived, typename Allocator = DefaultAllocator> |
| auto | Emrys::regularGrid (Eigen::MatrixBase< FirstDerived > const &first, Eigen::MatrixBase< SpacingDerived > const &spacing, std::array< Eigen::Index, std::size_t(internal::PathTag< P >::FixedValueDimension)> const &counts, std::optional< typename Moments< internal::PathTag< P >, typename FirstDerived::Scalar >::MatrixType > cellCovariance={}, Allocator const &allocator={}) |
| | regularGrid(space, first, spacing, counts, ...) in the FixedSizeSpace S, named as the first template argument: regularGrid<State, Position>(first, spacing, {200, 200}) (decisions.md [space-storage]).
|
|
template<FixedSizeSpace S, typename P, typename FirstDerived, typename SpacingDerived, typename Allocator = DefaultAllocator> |
| auto | Emrys::regularGrid (Eigen::MatrixBase< FirstDerived > const &first, Eigen::MatrixBase< SpacingDerived > const &spacing, std::array< Eigen::Index, std::size_t(internal::PathTag< P >::FixedValueDimension)> const &counts, std::span< typename Moments< internal::PathTag< P >, typename FirstDerived::Scalar >::MatrixType const > cellCovariances, Allocator const &allocator={}) |
| | regularGrid(space, first, spacing, counts, cellCovariances, ...) in the FixedSizeSpace S, named as the first template argument.
|
| template<Space Space_, RealScalar Scalar_> |
| InfoGaussianParams< Space_, Scalar_ > | Emrys::multiply (InfoGaussianParams< Space_, Scalar_ > const &first, InfoGaussianParams< Space_, Scalar_ > const &second) |
| template<GaussianForm G> |
| std::expected< InfoGaussianParams< typename G::SpaceType, typename G::Scalar >, GaussianError > | Emrys::toInfo (G const &form) |
template<typename Scalar, typename Space, typename Allocator, std::uniform_random_bit_generator G, typename R = resamplers::Multinomial>
requires Resampler<R, Scalar, G> |
| SampleSet< Space, Scalar > | Emrys::drawSamples (KernelDensity< Space, Scalar, Allocator > const &kde, Eigen::Index n, G &rng, R const &resampler={}) |
| template<typename Scalar, typename Space, typename Allocator, std::uniform_random_bit_generator G> |
| Moments< Space, Scalar >::VectorType | Emrys::drawSample (KernelDensity< Space, Scalar, Allocator > const &kde, G &rng) |
template<typename Scalar, typename Space, typename Allocator, std::uniform_random_bit_generator G, typename R = resamplers::Multinomial>
requires Resampler<R, Scalar, G> |
| SamplesWithLogDensity< Space, Scalar > | Emrys::drawSamplesWithLogDensity (KernelDensity< Space, Scalar, Allocator > const &kde, Eigen::Index n, G &rng, R const &resampler={}) |
template<ExecutionPolicy P, typename Scalar, typename Space, typename Allocator, std::uniform_random_bit_generator G, typename R = resamplers::Multinomial>
requires Resampler<R, Scalar, G> |
| SamplesWithLogDensity< Space, Scalar > | Emrys::drawSamplesWithLogDensity (P &&policy, KernelDensity< Space, Scalar, Allocator > const &kde, Eigen::Index n, G &rng, R const &resampler={}) |
| | drawSamplesWithLogDensity() under policy: the draws are taken as the sequential form takes them, and their log-densities are a for-each over the draws (see Execution policies), so the result is Sequential's.
|
| template<typename Scalar, typename Space, typename Allocator, std::uniform_random_bit_generator G> |
| SampleWithLogDensity< Space, Scalar > | Emrys::drawSampleWithLogDensity (KernelDensity< Space, Scalar, Allocator > const &kde, G &rng) |
template<typename Scalar, typename Space, typename Allocator, std::uniform_random_bit_generator G, typename R = resamplers::Multinomial>
requires Resampler<R, Scalar, G> |
| SampleSet< Space, Scalar > | Emrys::drawSamples (Mixture< Gaussian< Space, Scalar >, Allocator > const &mixture, Eigen::Index n, G &rng, R const &resampler={}) |
| template<typename Scalar, typename Space, typename Allocator, std::uniform_random_bit_generator G> |
| Moments< Space, Scalar >::VectorType | Emrys::drawSample (Mixture< Gaussian< Space, Scalar >, Allocator > const &mixture, G &rng) |
template<typename Scalar, typename Space, typename Allocator, std::uniform_random_bit_generator G, typename R = resamplers::Multinomial>
requires Resampler<R, Scalar, G> |
| SamplesWithLogDensity< Space, Scalar > | Emrys::drawSamplesWithLogDensity (Mixture< Gaussian< Space, Scalar >, Allocator > const &mixture, Eigen::Index n, G &rng, R const &resampler={}) |
template<ExecutionPolicy P, typename Scalar, typename Space, typename Allocator, std::uniform_random_bit_generator G, typename R = resamplers::Multinomial>
requires Resampler<R, Scalar, G> |
| SamplesWithLogDensity< Space, Scalar > | Emrys::drawSamplesWithLogDensity (P &&policy, Mixture< Gaussian< Space, Scalar >, Allocator > const &mixture, Eigen::Index n, G &rng, R const &resampler={}) |
| | drawSamplesWithLogDensity() under policy: the draws are taken as the sequential form takes them, and their log-densities are a for-each over the draws (see Execution policies), so the result is Sequential's.
|
| template<typename Scalar, typename Space, typename Allocator, std::uniform_random_bit_generator G> |
| SampleWithLogDensity< Space, Scalar > | Emrys::drawSampleWithLogDensity (Mixture< Gaussian< Space, Scalar >, Allocator > const &mixture, G &rng) |
| template<typename P, Space S, typename Scalar, typename Allocator, typename Covariance = SharedCovariance> |
| auto | Emrys::particleGaussian (S space, ParticleSet< typename internal::BlockSplit< S, P >::PinnedSpace, Scalar, Allocator > particles, GaussianParams< typename internal::BlockSplit< S, P >::RestSpace, Scalar > const &conditional, Covariance covariance={}) |
| template<typename P, Space S, typename Scalar, typename Allocator, typename Component, typename ModeSpace, typename HybridAllocator> |
| auto | Emrys::particleGaussian (S space, ParticleSet< typename internal::BlockSplit< S, P >::PinnedSpace, Scalar, Allocator > particles, HybridParams< Component, ModeSpace, HybridAllocator > const &conditional) |
| template<typename P, typename Covariance = SharedCovariance, typename S, typename Scalar, std::uniform_random_bit_generator G, typename Allocator = DefaultAllocator> |
| auto | Emrys::drawParticleGaussian (GaussianParams< S, Scalar > const &joint, Eigen::Index count, G &rng, Covariance={}, Allocator const &allocator={}) |
| template<typename Scalar, typename Space, typename Allocator> |
| std::expected< typename ParticleSet< Space, Scalar, Allocator >::MatrixType, WeightError > | Emrys::silvermanBandwidth (ParticleSet< Space, Scalar, Allocator > const &particles) |
|
template<ExecutionPolicy P, typename Scalar, typename Space, typename Allocator> |
| std::expected< typename ParticleSet< Space, Scalar, Allocator >::MatrixType, WeightError > | Emrys::silvermanBandwidth (P &&policy, ParticleSet< Space, Scalar, Allocator > const &particles) |
| | silvermanBandwidth() under policy: the total weight, effective sample size, and covariance are reductions over the particles (see Execution policies).
|
| template<typename F, typename BlockSpace, std::uniform_random_bit_generator G> |
| SampleSet< BlockSpace, typename F::Scalar > | Emrys::drawSamples (EachRepetition< F, BlockSpace > const &each, Eigen::Index n, G &rng) |
| template<typename F, typename BlockSpace, std::uniform_random_bit_generator G> |
| Moments< BlockSpace, typenameF::Scalar >::VectorType | Emrys::drawSample (EachRepetition< F, BlockSpace > const &each, G &rng) |
| template<typename F, typename BlockSpace, std::uniform_random_bit_generator G> |
| SamplesWithLogDensity< BlockSpace, typename F::Scalar > | Emrys::drawSamplesWithLogDensity (EachRepetition< F, BlockSpace > const &each, Eigen::Index n, G &rng) |
| template<typename F, typename BlockSpace, std::uniform_random_bit_generator G> |
| SampleWithLogDensity< BlockSpace, typename F::Scalar > | Emrys::drawSampleWithLogDensity (EachRepetition< F, BlockSpace > const &each, G &rng) |
| template<typename Scalar, typename Space, typename... Factors_, std::uniform_random_bit_generator G> |
| SampleSet< Space, Scalar > | Emrys::drawSamples (Product< Space, Scalar, Factors_... > const &product, Eigen::Index n, G &rng) |
| template<typename Scalar, typename Space, typename... Factors_, std::uniform_random_bit_generator G> |
| Moments< Space, Scalar >::VectorType | Emrys::drawSample (Product< Space, Scalar, Factors_... > const &product, G &rng) |
| template<typename Scalar, typename Space, typename... Factors_, std::uniform_random_bit_generator G> |
| SamplesWithLogDensity< Space, Scalar > | Emrys::drawSamplesWithLogDensity (Product< Space, Scalar, Factors_... > const &product, Eigen::Index n, G &rng) |
| template<typename Scalar, typename Space, typename... Factors_, std::uniform_random_bit_generator G> |
| SampleWithLogDensity< Space, Scalar > | Emrys::drawSampleWithLogDensity (Product< Space, Scalar, Factors_... > const &product, G &rng) |
| template<typename... Fallbacks> |
| constexpr auto | Emrys::roots::cholesky (Fallbacks... fallbacks) |
| template<typename... Fallbacks> |
| constexpr auto | Emrys::roots::pivoted (Fallbacks... fallbacks) |
| template<typename... Fallbacks> |
| constexpr auto | Emrys::roots::principal (Fallbacks... fallbacks) |
| template<typename... Fallbacks> |
| constexpr auto | Emrys::roots::symmetric (Fallbacks... fallbacks) |
| template<typename Derived, typename... Fallbacks> |
| auto | Emrys::roots::along (Eigen::MatrixBase< Derived > const &direction, Fallbacks... fallbacks) |
| template<double Relative = 1.0, double Absolute = 0.0> |
| constexpr Ridge< Relative, Absolute > | Emrys::roots::ridge () |
| template<typename Head, typename First, typename... Rest> |
| constexpr WithFallbacks< Head, First, Rest... > | Emrys::roots::withFallbacks (Head axes, First first, Rest... rest) |
| template<Axes A, typename Derived> |
| auto | Emrys::roots::squareRoot (A const &axes, Eigen::MatrixBase< Derived > const &cov) |
| template<Axes A, typename Derived> |
| auto | Emrys::roots::squareRootWithReport (A const &axes, Eigen::MatrixBase< Derived > const &cov) |
| template<typename Scalar, typename Space, std::uniform_random_bit_generator G> |
| SampleSet< Space, Scalar > | Emrys::drawSamples (Gaussian< Space, Scalar > const &gaussian, Eigen::Index n, G &rng) |
| template<typename Scalar, typename Space, std::uniform_random_bit_generator G> |
| Moments< Space, Scalar >::VectorType | Emrys::drawSample (Gaussian< Space, Scalar > const &gaussian, G &rng) |
| template<typename Scalar, typename Space, std::uniform_random_bit_generator G> |
| SamplesWithLogDensity< Space, Scalar > | Emrys::drawSamplesWithLogDensity (Gaussian< Space, Scalar > const &gaussian, Eigen::Index n, G &rng) |
| template<typename Scalar, typename Space, std::uniform_random_bit_generator G> |
| SampleWithLogDensity< Space, Scalar > | Emrys::drawSampleWithLogDensity (Gaussian< Space, Scalar > const &gaussian, G &rng) |
| template<GaussianForm G> |
| std::expected< SqrtGaussianParams< typename G::SpaceType, typename G::Scalar >, GaussianError > | Emrys::toSqrt (G const &form) |
| template<Space Space_, RealScalar Scalar_> |
| SqrtInfoGaussianParams< Space_, Scalar_ > | Emrys::multiply (SqrtInfoGaussianParams< Space_, Scalar_ > const &first, SqrtInfoGaussianParams< Space_, Scalar_ > const &second) |
| template<GaussianForm G> |
| std::expected< SqrtInfoGaussianParams< typename G::SpaceType, typename G::Scalar >, GaussianError > | Emrys::toSqrtInfo (G const &form) |
| template<typename Scalar, typename Space, std::uniform_random_bit_generator G> |
| SampleSet< Space, Scalar > | Emrys::drawSamples (StudentT< Space, Scalar > const &t, Eigen::Index n, G &rng) |
| template<typename Scalar, typename Space, std::uniform_random_bit_generator G> |
| Moments< Space, Scalar >::VectorType | Emrys::drawSample (StudentT< Space, Scalar > const &t, G &rng) |
| template<typename Scalar, typename Space, std::uniform_random_bit_generator G> |
| SamplesWithLogDensity< Space, Scalar > | Emrys::drawSamplesWithLogDensity (StudentT< Space, Scalar > const &t, Eigen::Index n, G &rng) |
| template<typename Scalar, typename Space, std::uniform_random_bit_generator G> |
| SampleWithLogDensity< Space, Scalar > | Emrys::drawSampleWithLogDensity (StudentT< Space, Scalar > const &t, G &rng) |
| template<typename Scalar, typename Space, std::uniform_random_bit_generator G> |
| SampleSet< Space, Scalar > | Emrys::drawSamples (Uniform< Space, Scalar > const &uniform, Eigen::Index n, G &rng) |
| template<typename Scalar, typename Space, std::uniform_random_bit_generator G> |
| Moments< Space, Scalar >::VectorType | Emrys::drawSample (Uniform< Space, Scalar > const &uniform, G &rng) |
| template<typename Scalar, typename Space, std::uniform_random_bit_generator G> |
| SamplesWithLogDensity< Space, Scalar > | Emrys::drawSamplesWithLogDensity (Uniform< Space, Scalar > const &uniform, Eigen::Index n, G &rng) |
| template<typename Scalar, typename Space, std::uniform_random_bit_generator G> |
| SampleWithLogDensity< Space, Scalar > | Emrys::drawSampleWithLogDensity (Uniform< Space, Scalar > const &uniform, G &rng) |
template<Space S, RealScalar Scalar, typename CountsDerived>
requires std::integral<typename CountsDerived::Scalar> |
| UniformGrid< S, Scalar > | Emrys::uniformComponents (Uniform< S, Scalar > const &uniform, Eigen::DenseBase< CountsDerived > const &counts, std::type_identity_t< Scalar > relativeWidth=Scalar(0.6)) |
|
template<Space S, RealScalar Scalar> |
| UniformGrid< S, Scalar > | Emrys::uniformComponents (Uniform< S, Scalar > const &uniform, Eigen::Index count, std::type_identity_t< Scalar > relativeWidth=Scalar(0.6)) |
| | uniformComponents() with count components along every coordinate.
|
template<Space S, RealScalar Scalar, typename... Factors, typename CountsDerived>
requires std::integral<typename CountsDerived::Scalar> |
| UniformGrid< S, Scalar > | Emrys::uniformComponents (Product< S, Scalar, Factors... > const &product, Eigen::DenseBase< CountsDerived > const &counts, std::type_identity_t< Scalar > relativeWidth=Scalar(0.6)) |
|
template<Space S, RealScalar Scalar, typename... Factors> |
| UniformGrid< S, Scalar > | Emrys::uniformComponents (Product< S, Scalar, Factors... > const &product, Eigen::Index count, std::type_identity_t< Scalar > relativeWidth=Scalar(0.6)) |
| | uniformComponents() of a Product with count components along every coordinate of its Uniform factors.
|
The third layer (decisions.md [layered-headers]): the distributions, each stored as parameters and evaluated through a density, and what is computed from them.
Parameters and densities. A distribution whose values can fail to define it, such as a Gaussian whose covariance is not positive definite, has two types [params-and-density]: its parameters, which hold the values and change step by step, and its density, which evaluates it. The split exists so that the expensive work is done once and the cheap work many times. Evaluating a Gaussian's density needs a Cholesky factorization of its covariance, whose cost is cubic in the dimension, while each evaluation after that is a triangular solve, whose cost is quadratic. A filter changes a covariance once in a step but may evaluate it many times in that step: a particle filter's update evaluates one measurement noise at the residual of every particle, and a Gaussian mixture evaluates each of its components at every value. So GaussianParams holds the mean and covariance and caches their factorization; toDensity() factorizes only if the covariance has changed since the last factorization, and returns a Gaussian, which borrows that factorization and copies nothing:
auto const cov = Eigen::Matrix2d{{1.0, 0.2}, {0.2, 0.8}};
auto noise = GaussianParams<Linear<2>>{Eigen::Vector2d::Zero(), cov};
auto const density = noise.toDensity();
if (!density)
{
return;
}
for (Eigen::Index j = 0; j < residuals.cols(); ++j)
{
}
noise.setCovariance(widened);
Eigen::Array< typename Derived::Scalar, Eigen::Dynamic, 1 > logLikelihoods(M const &measurement, Space const &space, Eigen::MatrixBase< Derived > const &states)
Definition Likelihood.h:408
The split also puts the check of the values in one place. Parameters that fail to define a distribution fail in toDensity(), once, as a std::expected, so logDensity() returns a plain scalar and a loop over particles or components has no error to check. A density writes nothing, so any number of threads may evaluate one at once (see below). In exchange, a density must not outlive its parameters, and reading it after they have changed is a programmer error that EMRYS_FILTER_ASSERT catches [view-stamp].
Two cases the check can't see, since the stamp it reads is gone. Hold a density by value: the std::expected that toDensity() returns is a temporary, and a reference into it dangles at the end of the statement. And a density of a component inside a container, a mixture's or a hybrid's, must not be read after the container grows, which may move the component it borrows; only AddressSanitizer catches either.
auto const density = noise.toDensity().value();
auto const & dangling = noise.toDensity().value();
auto const first = mixture[0].component.toDensity().value();
mixture.add(0.0, moments);
The split also lets values be written one at a time where the check is of all of them together. A categorical distribution's weights must not all be zero, and no single write makes or breaks that: filling a histogram, setting a weight by name, or ruling a value out passes through states that would fail. CategoricalParams takes those writes unchecked, and its toDensity() checks the weights once and returns the Categorical that reads the probabilities.
A distribution whose values are always valid, such as Uniform, Gamma, StudentT, or Product, has nothing to cache, so it is one type: it checks its values when it is built, as StudentT::create() does, and is its own parameters and its own density. Params<D> and Density
(Params.h) map each type to the other, and a type of the first kind to itself. Filters, mixtures, and hybrids are named by the density and store its parameters: KalmanFilter<Gaussian<State>, Model> holds a GaussianParams, which each step changes in place, and its state's toDensity() gives the Gaussian. Generic code is written against the density, since every distribution has one, and the HasLogDensity concept (Product.h) says what a continuous density can do.
A statistic that reads the components is the density's: a mixture's or a hybrid's moments and collapse, and a Rao-Blackwellized state's collapse. It needs no factorization to compute, but only the factorization checks that each component is a distribution, so on the parameters it could describe none. One that reads only the weights, such as MixtureParams::ess(), is on the parameters too, a std::expected of the weights' error (decisions.md [params-and-density]).
The headers. Params.h pairs parameters with their densities. Moments.h holds the mean and covariance that every distribution is matched to, SampleSet.h a matrix of samples, and Roots.h the square roots of a covariance by the axes and repairs of Emrys::roots. The Gaussian (Gaussian.h) comes first, with its draws (Sampling.h) and its square-root and information forms SqrtGaussian, InfoGaussian, and SqrtInfoGaussian, which GaussianForm.h ties together [gaussian-forms]. The distributions that are their own parameters are Uniform, Gamma, StudentT, and Product. CategoricalParams and Categorical are the distribution over a discrete space [discrete-spaces], and ContinuousTimeMarkovChain.h moves one over an interval [emissions]. The containers of weighted elements share the statistics in Statistics.h and, where the elements are Gaussians, the Component concept (Component.h, [component-first]): GaussianMixture (Mixture.h), with uniformComponents() giving, one at a time, the components that approximate a Uniform, or the Uniform factors of a Product, to fill one (UniformMixture.h, [uniform-mixtures]), HybridGaussian (Hybrid.h, [imm]), and ParticleSet with its KernelDensity. Fitting.h fits a mixture by expectation-maximization; Upkeep.h holds the actions a caller applies to a state between steps [upkeep]; Divergence.h compares two distributions [divergences]; and Conditionals.h, GridGaussian.h, and ParticleGaussian.h are the Rao-Blackwellized states [rao-blackwellized-core], [rb-particle-filter]. Read Params.h first, and Models next.
Sharing between threads. Parameters are for changing step by step, not for sharing. Their const members fill the cache that evaluation needs, so const does not make them safe to read from several threads at once [execution-policies]: factorize(), toDensity(), and the accessors that need a factorization, such as GaussianParams::precision(), write the cache the first time after a change, and the square-root and information forms' toDensity() writes it each time. What threads should share is what toDensity() returns: a density writes nothing, so any number of threads may evaluate one at once, while its parameters stay alive and unchanged and nothing calls their const members that write the cache. Code that needs only the mean and covariance shares a copy of the Moments instead, which owns its values and needs neither.
What a view's check catches. A view's check of its parameters detects a change after the fact and prevents nothing: it blocks no mutator and makes nothing wait. It records the parameters' modification stamp when the view is made, and reading the view after the parameters have changed is a programmer error that EMRYS_FILTER_ASSERT catches. The stamp is a plain counter, so changing parameters on one thread while another reads a view of them is a data race that no check catches.
The views differ in what they tolerate. Parameters keep two counters: every mutator advances the first, and a change of size or structure (a resize, an insertion or removal, a resample, an assignment, a move from) advances the second too. A density reads the cached factorization or bandwidth, so it checks the first and fails after any change. A marginal of parameters reads their values by indices resolved when it was made, so it checks only the second: it sees new values, and fails after a change of size or structure. A marginal of a view holds a copy of the view and fails as the view would. An element of a mixture's or a hybrid's marginal reads its component through the range's indices, so it must not outlive the range. A copy of the parameters is new parameters, and changing it leaves the views of the original alone.
Marginals and conditionals. Every continuous distribution has marginal<Path>() and conditional<GivenPath>(values) by tag path [tag-addressing]. A marginal reads its source wherever it can without computing, and copy() gives parameters [element-marginals]: the Gaussian's is a GaussianMarginal view, and a mixture's, a hybrid's, or a particle set's a range over the elements' marginals. A marginal that must compute is a value: the square-root and information forms', a categorical's over an axis, and those of the distributions that are their own parameters. A conditional is always a value. One whose type has weights (a mixture's, a particle set's, a categorical's) leaves them unnormalized, so its total weight is the source's times the density of the given values; a single Gaussian returns that evidence from conditionalWithEvidence() [conditional-evidence]. A KernelDensity only evaluates: condition the ParticleSet, whose conditional stores the exact conditional bandwidth.
Random draws. A density draws, and parameters don't: drawSamples() and drawSample(), with their WithLogDensity forms, take the density and the caller's generator [random-draws]. The draws go through std::normal_distribution and its siblings, whose algorithms the standard leaves to the implementation, so a seed gives the same draws under one standard library and other draws under another. drawSample() takes its own draws from the generator at each call, so a stream of single draws is not the sequence drawSamples() gives from the same seed.