The fourth layer (decisions.md [layered-headers]): how a distribution moves through a function and what a filter is given to work with.
More...
|
| struct | Emrys::jacobians::PerColumn |
| | The mark that a batched function writes one Jacobian per column, by block of its input: Y.jacobian<Name>(j), made by perColumn(). More...
|
| struct | Emrys::jacobians::Shared |
| | The mark that a batched function writes one Jacobian for every column, by block of its input: Y.jacobian<Name>(), for a function linear in its input, made by shared(). More...
|
| struct | Emrys::Batched< F, Mark > |
| | A function that takes every point at once, as batched() marks it (decisions.md [batched-functions]): it receives the points as the columns of a matrix X and writes into one output Y, a BatchedOutput the library provides, last. More...
|
| class | Emrys::BatchedOutput< In, Out, Scalar_, Mark > |
| | The output of a batched function (decisions.md [batched-functions]): its values, a column per point, and the Jacobians the library uses, by block of the function's input, in storage the library provides and sizes once before the call. More...
|
| class | Emrys::PosteriorCramerRaoBound< Space_, Scalar_ > |
| | The posterior Cramér-Rao bound along true trajectories: the Fisher information \( J_k \) of the state, whose inverse bounds the mean squared error of any estimator of \( x_k \). More...
|
| struct | Emrys::CategoricalUpdate< Space, Scalar > |
| | The result of updating a CategoricalParams by an emission model: the posterior, whose weights sum to one, and the log-evidence of the measurement. More...
|
| class | Emrys::EmissionTable< Space_, ObservationSpace_, Scalar_ > |
| | An emission table: the probability of each observed value given each value of the state. More...
|
| class | Emrys::DensityEmission< Observation, DistributionOf > |
| | The emission model of an observation drawn from a distribution chosen by the value: the log-density of the observation under the value's distribution. More...
|
| class | Emrys::PoissonEmission< Space, Scalar_ > |
| | The emission model of a count of events over an interval, from a Poisson process whose rate is a function of the value. More...
|
| class | Emrys::ExponentialEmission< Space, Scalar_ > |
| | The emission model of the time from one event to the next, from a Poisson process whose rate is a function of the value. More...
|
| class | Emrys::ArrivalInterval< Space, Scalar_ > |
| | The observation of a Markov-modulated Poisson process over an interval: no event inside it, and an event at its end unless it closes the record. More...
|
| struct | Emrys::GivenBlock< Space, P, Value > |
| | A block of a state given from outside the Gaussian being updated, as given() makes it, for update(prior, measurement, given): the block named by the path P of a state in Space, given as Value. More...
|
| struct | Emrys::CountFrom< Path, MeasurementSpace > |
| | The measurement space function of a model whose measurement has a block of MeasurementSpace per repetition of the state's block Path, given to outputSpace() (decisions.md [measurement-space-functions]). More...
|
| class | Emrys::MeasurementFunction< F, Policies > |
| | A measurement model: a function \( h \) of its input, with the policies that say what it reads, what it writes, and what it is affine in, and its noise (decisions.md [model-policies]). More...
|
| class | Emrys::Columns< Placed > |
| | The matrix \( H \) of a linear measurement model by its columns: a matrix per block of the state read, each placed by tag path with on() or onEach() (decisions.md [linear-sensors]). More...
|
| class | Emrys::Observed< Method, Model, Observation, Args > |
| | An observation of a measurement model: the observed value, the model, the method that pushes the state through it, and the inputs of the call, as observe() makes it (decisions.md [templated-measurements], [method-per-measurement], [model-policies]). More...
|
| struct | Emrys::UpdateBranch< Space, MeasurementSpace, Scalar > |
| | One outcome of an update: a posterior, how probable it is, and its innovation, from which the observation's likelihood under it and its NIS follow (decisions.md [innovation-statistics]). More...
|
| struct | Emrys::MeasurementUpdate< Space, MeasurementSpace, Count, Scalar_, Allocator > |
| | The result of update(): weighted branches, one per noise component, and the observation's log-likelihood. More...
|
| struct | Emrys::FilterBranch< MeasurementSpace, Scalar > |
| | One branch of a filter's update (see FilterUpdate): its weight, its innovation, and its labels, without the posterior, which the filter reduced into its state (decisions.md [innovation-statistics]). More...
|
| struct | Emrys::FilterUpdate< MeasurementSpace, Count, Scalar_, Allocator > |
| | What a filter's update did: the branches of the update before reduction, with their weights and innovations but not their posteriors (decisions.md [innovation-statistics]), and whether the reduction policy accepted the measurement. More...
|
| struct | Emrys::ReusableFilterUpdate< Space, MeasurementSpace, Scalar, Allocator > |
| | A FilterUpdate of a run-time number of branches that keeps the MeasurementUpdate it was last filled from, posteriors included, as the scratch of its next fill. More...
|
| struct | Emrys::Reads< Items > |
| | What a model reads, as reads() declares it: the items, each a path into the state or the tag of an input of the call, under a name (decisions.md [model-policies]). More...
|
| struct | Emrys::Writes< Paths > |
| | What a model writes, as writes() declares it: the blocks its function's result fills (decisions.md [model-policies]). More...
|
| struct | Emrys::AffineIn< Names > |
| | The input names a model's function is affine in, given the rest, as affineIn() declares them (decisions.md [model-policies], [affine-coordinates]): a sigma-point method factors those coordinates out and spreads its points over the others alone. More...
|
| class | Emrys::AdditiveNoise< Parts > |
| | Noise added to a model's output, \( z = h(x) \boxplus v \), as additiveNoise() declares it (decisions.md [additive-noise], [model-policies]): the function is transformed once, and the noise only widens and shifts the result. More...
|
| class | Emrys::ModeNoise< Axis, Part > |
| | Additive mixture noise whose components are the values of a mode axis, as additiveNoise(mixture).byMode<Axis>() declares it (decisions.md [imm]): the Markov outlier model, in which a sensor's outlier state is a mode of the target that persists as the mode chain says. More...
|
| class | Emrys::ContinuousNoise< Parts > |
| | A process model's white-noise spectral density, as continuousNoise() declares it, placed by tag path on blocks of the output and discretized over the step by the model (decisions.md [continuous-time-noise], [model-policies]): \( Q_c \, \Delta t \) on each block's differences. More...
|
| struct | Emrys::LogLikelihood< G > |
| | A measurement model's own \( \log p(z \mid x) \) at a state point, as logLikelihood() declares it, for the filters that weight points (decisions.md [likelihood-measurements], [model-policies]): a function g(in, x, z) of the model's input space instance, its input vector, and the observation. More...
|
| struct | Emrys::Sample< G > |
| | A draw of the observation that a measurement model known by its likelihood alone makes of a state, as sample() declares it, for simulate() (decisions.md [likelihood-measurements], [model-policies]): a function g(in, x, rng) of the model's input space instance, its input vector, and the caller's generator, returning the observation. More...
|
| struct | Emrys::OutputSpace< X > |
| | A model's output space given by its instance, or computed from the state's space, as outputSpace() declares it (decisions.md [measurement-space-functions], [model-policies]): for an output with a resizable block, whose size the type does not fix. More...
|
| struct | Emrys::Sure< S, Vector > |
| | A sure input of predict() or observe(): a known value in the tagged space S, as sure() marks it (decisions.md [prediction-inputs], [tag-addressing]). More...
|
| struct | Emrys::Consider< Paths > |
| | The blocks of the state that a Kalman update considers rather than estimates, as consider() names them (decisions.md [consider-states]): the Schmidt-Kalman update of Schmidt (1966). More...
|
| class | Emrys::ProcessFunction< F, Policies > |
| | A process model: a function \( f \) of its input and the step, with the policies that say what it reads, what it writes, and what it is affine in, and its noise (decisions.md [model-policies], [continuous-time-noise]). More...
|
| class | Emrys::RandomWalk< Path, Scalar_ > |
| | A model driven by white noise alone: \( x' = x \), with noise \( Q_c \, \Delta t \) on its differences. More...
|
| class | Emrys::Kinematic< Scalar_, Paths > |
| | A chain of two or more derivatives whose last one is driven by white noise: constant velocity and constant acceleration. More...
|
| struct | Emrys::TimeConstant< Scalar > |
| | The time constant \( \tau \) of an OrnsteinUhlenbeck model, named so that it cannot be given in the place of its variance. More...
|
| struct | Emrys::StationaryVariance< Scalar > |
| | The stationary variance \( \sigma^2 \) of an OrnsteinUhlenbeck model, named so that it cannot be given in the place of its time constant. More...
|
| class | Emrys::OrnsteinUhlenbeck< Path, Scalar_ > |
| | A zero-mean Ornstein-Uhlenbeck (first-order Gauss-Markov) process on each coordinate of the block named by Path, such as a slowly varying sensor bias. More...
|
| class | Emrys::Constant< Path > |
| | The block named by Path does not change, and has no process noise, such as a fixed calibration parameter. More...
|
| class | Emrys::Composition< Models > |
| | Process models side by side, as compose() puts them (decisions.md [model-policies], [model-placement]): one model whose reads are the union of the parts', gathered once, whose writes are the parts' together, which must write every block of the state once, whose noise is block-diagonal, and whose affine set is the names every part reading them declares affine. More...
|
| struct | Emrys::NoProcessModel |
| | The process model of a state with nothing to move: what a PointMassFilter, whose grid covers the whole state, holds in place of one. More...
|
| struct | Emrys::PredictedJoint< Space_, Scalar_ > |
| | One prediction step as a joint: the Gaussian the step started from, the Gaussian it predicted, and the cross-covariance between them. More...
|
| struct | Emrys::ModelsMethod |
| | What a filter with a fixed-step model takes in place of a prediction method: nothing, since the model carries its own. More...
|
| class | Emrys::UnboundFixedStep< Model_, Method_, Time_ > |
| | A process model taken over one fixed time step, not yet bound to a state space: what fixedStep() returns. More...
|
| class | Emrys::FixedStepModel< Space_, Model_, Method_, Scalar_ > |
| | A process model over one fixed time step, with the work that depends only on the step done once. More...
|
| class | Emrys::ModelWithMethod< Model_, Method_ > |
| | A process model and the prediction method that one mode of a SwitchingModel predicts it by, in place of the filter's [switching-models]. More...
|
| class | Emrys::SwitchingModel< ModeSpace_, Scalar_, Path_, Models > |
| | A process model that switches between modes: a Markov chain on a discrete mode space, and the process model each mode follows [switching-models]. More...
|
| class | Emrys::SwitchingMeasurement< Path_, Measurements > |
| | A measurement that switches between modes: one Measurement per value of a mode axis, so that a filter over a Hybrid updates each mode by the measurement that its value in that axis names [imm]. More...
|
|
| constexpr PerColumn | Emrys::jacobians::perColumn () |
| constexpr Shared | Emrys::jacobians::shared () |
template<typename F>
requires (!internal::isBatched<std::remove_cvref_t<F>> && !MatrixExpression<F>) |
| Batched< std::remove_cvref_t< F > > | Emrys::batched (F &&function) |
template<typename F, JacobianMark Mark>
requires (!internal::isBatched<std::remove_cvref_t<F>> && !MatrixExpression<F>) |
| Batched< std::remove_cvref_t< F >, std::remove_cvref_t< Mark > > | Emrys::batched (F &&function, Mark) |
| template<typename Scalar, typename Space, EmissionModel< Space > E> |
| std::expected< CategoricalUpdate< Space, Scalar >, WeightError > | Emrys::update (CategoricalParams< Space, Scalar > const &prior, E const &emission) |
| template<typename Scalar, typename Space> |
| std::expected< CategoricalUpdate< Space, Scalar >, WeightError > | Emrys::predict (CategoricalParams< Space, Scalar > const &prior, ContinuousTimeMarkovChain< Space, Scalar > const &chain, TimeStep< Scalar > auto const &dt, ArrivalInterval< Space, Scalar > const &interval) |
| template<internal::WeighsPoints M, typename Space, typename Derived> |
| Eigen::Array< typename Derived::Scalar, Eigen::Dynamic, 1 > | Emrys::logLikelihoods (M const &measurement, Space const &space, Eigen::MatrixBase< Derived > const &states) |
| template<ExecutionPolicy P, internal::WeighsPoints M, typename Space, typename Derived> |
| Eigen::Array< typename Derived::Scalar, Eigen::Dynamic, 1 > | Emrys::logLikelihoods (P &&policy, M const &measurement, Space const &space, Eigen::MatrixBase< Derived > const &states) |
| | logLikelihoods() under policy, a for-each over the columns (see Execution policies).
|
| template<internal::WeighsPoints M, typename Space, typename Derived> |
| Derived::Scalar | Emrys::logLikelihood (M const &measurement, Space const &space, Eigen::MatrixBase< Derived > const &x) |
template<FixedSizeSpace S, internal::WeighsPoints M, typename Derived>
requires Space<S> |
| Eigen::Array< typename Derived::Scalar, Eigen::Dynamic, 1 > | Emrys::logLikelihoods (M const &measurement, Eigen::MatrixBase< Derived > const &states) |
| | logLikelihoods() in the fixed-size state space S, given as a template argument: logLikelihoods<State>(measurement, states).
|
template<FixedSizeSpace S, ExecutionPolicy P, internal::WeighsPoints M, typename Derived>
requires Space<S> |
| Eigen::Array< typename Derived::Scalar, Eigen::Dynamic, 1 > | Emrys::logLikelihoods (P &&policy, M const &measurement, Eigen::MatrixBase< Derived > const &states) |
| | logLikelihoods() under policy in the fixed-size state space S, given as a template argument: logLikelihoods<State>(policy, measurement, states).
|
template<FixedSizeSpace S, internal::WeighsPoints M, typename Derived>
requires Space<S> |
| Derived::Scalar | Emrys::logLikelihood (M const &measurement, Eigen::MatrixBase< Derived > const &x) |
| | logLikelihood() in the fixed-size state space S, given as a template argument: logLikelihood<State>(measurement, x).
|
| template<UncertainInput Prior, Measurement M> |
| auto | Emrys::update (Prior const &prior, M const &measurement) |
| template<UncertainInput Prior, Measurement M, typename Reference> |
| auto | Emrys::update (Prior const &prior, M const &measurement, LinearizedAbout< Reference > const &about) |
| template<typename P, typename Space, typename Value> |
| GivenBlock< Space, P, Value > | Emrys::given (Space const &space, Value const &value) |
| template<typename P, typename Space, typename Value> |
| void | Emrys::given (Space const &space, Value const &&value)=delete |
| | given() of a temporary value is deleted: the mark refers to the value, which would be gone at the end of the full expression, so a mark kept in a variable would dangle.
|
| template<UncertainInput Prior, Measurement M, typename Space, typename P, typename Value> |
| auto | Emrys::update (Prior const &prior, M const &measurement, GivenBlock< Space, P, Value > const &pinned) |
template<typename F, typename... Policies>
requires (!MatrixExpression<F> && !internal::ModelPolicy<F> && !internal::isColumns<std::remove_cvref_t<F>>) |
| auto | Emrys::measurementModel (F &&function, Policies &&... policies) |
| template<MatrixExpression Matrix, typename... Policies> |
| auto | Emrys::measurementModel (Matrix &&matrix, Policies &&... policies) |
| template<typename... Placed, typename... Policies> |
| auto | Emrys::measurementModel (Columns< Placed... > columns, Policies &&... policies) |
| template<internal::ModelPolicy... Policies> |
| auto | Emrys::measurementModel (Policies &&... policies) |
template<TransformMethod Method, typename M, MatrixExpression Z, typename... Args>
requires MeasurementModel<std::unwrap_ref_decay_t<M>> |
| auto | Emrys::observe (Method method, M &&model, Z &&observation, Args &&... args) |
template<typename M, MatrixExpression Z, typename... Args>
requires MeasurementModel<std::unwrap_ref_decay_t<M>> |
| auto | Emrys::observe (M &&model, Z &&observation, Args &&... args) |
| template<typename Path, ProcessModel Model, typename... Renames> |
| auto | Emrys::on (Model const &model, Renames const &...) |
| template<typename Path, ProcessModel Model, typename... Renames> |
| auto | Emrys::onEach (Model const &model, Renames const &...) |
template<MeasurementModel... Models>
requires (sizeof...(Models) > 0) |
| auto | Emrys::compose (Models &&... models) |
| template<typename... Items> |
| auto | Emrys::reads (Items const &...) |
| template<PathValue... Paths> |
| auto | Emrys::writes (Paths const &...) |
| template<PathValue... Names> |
| auto | Emrys::affineIn (Names const &...) |
| template<typename... Parts> |
| AdditiveNoise< typename internal::HeldOf< std::unwrap_ref_decay_t< Parts > >::type... > | Emrys::additiveNoise (Parts &&... parts) |
| template<typename... Parts> |
| ContinuousNoise< std::remove_cvref_t< Parts >... > | Emrys::continuousNoise (Parts &&... parts) |
template<typename G>
requires (!MatrixExpression<G> && !Space<std::remove_cvref_t<G>>) |
| LogLikelihood< std::remove_cvref_t< G > > | Emrys::logLikelihood (G &&function) |
template<typename G>
requires (!MatrixExpression<G> && !Space<std::remove_cvref_t<G>>) |
| Sample< std::remove_cvref_t< G > > | Emrys::sample (G &&function) |
template<typename X>
requires (!MatrixExpression<X>) |
| OutputSpace< std::remove_cvref_t< X > > | Emrys::outputSpace (X &&x) |
template<FixedSizeSpace S, MatrixExpression V>
requires Space<S> |
| auto | Emrys::sure (V &&value) |
| template<Space S, MatrixExpression V> |
| auto | Emrys::sure (S space, V &&value) |
| template<PathValue... Paths> |
| constexpr Consider< internal::PathOf< Paths >... > | Emrys::consider (Paths const &...) |
template<typename F, typename... Policies>
requires (!MatrixExpression<F> && !internal::ModelPolicy<F>) |
| auto | Emrys::processModel (F &&function, Policies &&... policies) |
| template<MatrixExpression Matrix, typename... Policies> |
| auto | Emrys::processModel (Matrix &&matrix, Policies &&... policies) |
| template<Space Space_, typename Derived, ProcessModel Model, typename... Args> |
| Moments< Space_, typenameDerived::Scalar >::VectorType | Emrys::propagate (Space_ const &space, Eigen::MatrixBase< Derived > const &x, Model const &model, TimeStep< typename Derived::Scalar > auto const &dt, Args const &... args) |
| template<typename Method, UncertainInput Prior, ProcessModel Model, typename... Args> |
| GaussianParams< typename Prior::SpaceType, typename Prior::Scalar > | Emrys::predict (Method const &method, Prior const &prior, Model const &model, TimeStep< typename Prior::Scalar > auto const &time, Args const &... args) |
| template<typename Method, UncertainInput Prior, ProcessModel Model, typename... Args> |
| PredictedJoint< typename Prior::SpaceType, typename Prior::Scalar > | Emrys::predictJoint (Method const &method, Prior const &prior, Model const &model, TimeStep< typename Prior::Scalar > auto const &time, Args const &... args) |
template<ProcessModel Model, typename Time, typename Method = methods::Linearized>
requires TimeStep<Time, double> |
| UnboundFixedStep< Model, Method, Time > | Emrys::fixedStep (Model model, Time dt, Method method={}) |
| template<UncertainInput Prior, typename Space_, typename Model_, typename Method_, typename Scalar_, typename... Args> |
| GaussianParams< typename Prior::SpaceType, typename Prior::Scalar > | Emrys::predict (Prior const &prior, FixedStepModel< Space_, Model_, Method_, Scalar_ > const &model, Args const &... args) |
| template<UncertainInput Prior, typename Space_, typename Model_, typename Method_, typename Scalar_, typename... Args> |
| PredictedJoint< typename Prior::SpaceType, typename Prior::Scalar > | Emrys::predictJoint (Prior const &prior, FixedStepModel< Space_, Model_, Method_, Scalar_ > const &model, Args const &... args) |
| template<UncertainInput Prior, typename Model_, typename Method_, typename Time_, typename... Args> |
| GaussianParams< typename Prior::SpaceType, typename Prior::Scalar > | Emrys::predict (Prior const &prior, UnboundFixedStep< Model_, Method_, Time_ > const &step, Args const &... args) |
| template<UncertainInput Prior, typename Model_, typename Method_, typename Time_, typename... Args> |
| PredictedJoint< typename Prior::SpaceType, typename Prior::Scalar > | Emrys::predictJoint (Prior const &prior, UnboundFixedStep< Model_, Method_, Time_ > const &step, Args const &... args) |
| template<Space Space_, typename Derived, ProcessModel Model, std::uniform_random_bit_generator G, typename... Args> |
| Moments< Space_, typenameDerived::Scalar >::VectorType | Emrys::simulate (Space_ const &space, Eigen::MatrixBase< Derived > const &x, Model const &model, G &rng, TimeStep< typename Derived::Scalar > auto const &dt, Args const &... args) |
template<Space Space_, typename Derived, typename Model, std::uniform_random_bit_generator G, typename... Args>
requires isFixedStep<Model> |
| Moments< Space_, typenameDerived::Scalar >::VectorType | Emrys::simulate (Space_ const &space, Eigen::MatrixBase< Derived > const &x, Model const &model, G &rng, Args const &... args) |
template<Space Space_, typename Derived, typename Step, std::uniform_random_bit_generator G, typename... Args>
requires isUnboundStep<Step> |
| Moments< Space_, typenameDerived::Scalar >::VectorType | Emrys::simulate (Space_ const &space, Eigen::MatrixBase< Derived > const &x, Step const &step, G &rng, Args const &... args) |
| template<Space Space_, typename Derived, MeasurementModel M, std::uniform_random_bit_generator G, typename... Args> |
| auto | Emrys::simulate (Space_ const &space, Eigen::MatrixBase< Derived > const &x, M const &model, G &rng, Args const &... args) |
template<FixedSizeSpace Space_, typename Derived, typename Model, std::uniform_random_bit_generator G, typename... Inputs>
requires (Space<Space_> && !isFixedStep<Model> && !isUnboundStep<Model>) |
| Moments< Space_, typenameDerived::Scalar >::VectorType | Emrys::simulate (Eigen::MatrixBase< Derived > const &x, Model const &model, G &rng, TimeStep< typename Derived::Scalar > auto const &dt, Inputs const &... inputs) |
template<FixedSizeSpace Space_, typename Derived, typename Model, std::uniform_random_bit_generator G, typename... Inputs>
requires (Space<Space_> && (isFixedStep<Model> || isUnboundStep<Model>)) |
| Moments< Space_, typenameDerived::Scalar >::VectorType | Emrys::simulate (Eigen::MatrixBase< Derived > const &x, Model const &model, G &rng, Inputs const &... inputs) |
template<FixedSizeSpace Space_, typename Derived, MeasurementModel M, std::uniform_random_bit_generator G, typename... Args>
requires Space<Space_> |
| auto | Emrys::simulate (Eigen::MatrixBase< Derived > const &x, M const &model, G &rng, Args const &... args) |
| template<typename Space, typename Scalar, std::uniform_random_bit_generator G> |
| Eigen::Index | Emrys::simulate (Eigen::Index from, MarkovChain< Space, Scalar > const &chain, G &rng) |
| template<typename Space, typename Scalar, std::uniform_random_bit_generator G> |
| Eigen::Index | Emrys::simulate (Eigen::Index from, ContinuousTimeMarkovChain< Space, Scalar > const &chain, G &rng, TimeStep< Scalar > auto const &dt) |
| template<typename Model, TransformMethod Method> |
| ModelWithMethod< Model, Method > | Emrys::withMethod (Model model, Method method) |
| template<typename P, typename ModeSpace, typename Scalar, typename... Models> |
| SwitchingModel< ModeSpace, Scalar, P, Models... > | Emrys::switchingModel (MarkovChain< ModeSpace, Scalar > chain, Models... models) |
| template<typename P, Measurement... Measurements> |
| SwitchingMeasurement< P, Measurements... > | Emrys::switchingMeasurement (Measurements... measurements) |
The fourth layer (decisions.md [layered-headers]): how a distribution moves through a function and what a filter is given to work with.
A model's noise is parameters, which a step reads through their density (Parameters and densities). Transform.h propagates a distribution with the methods of Methods.h, over the arguments of TransformArgs.h, into the results of Linearization.h, which Condition.h conditions on an observation; ProcessModel.h and Measurement.h, with the measurement models of MeasurementModel.h, the policies of Policies.h, and the placements and compositions of Placement.h, are the models [model-policies], [model-placement], [affine-coordinates], [templated-measurements], [method-per-measurement], [additive-noise], [sensors], [continuous-time-noise], [weighted-branches], and [prediction-inputs]; SwitchingModel.h adds a mode chain [switching-models], [imm]; Emission.h measures a discrete state [emissions]; Reduction.h and Consistency.h reduce an update's branches and test them [weighted-branches], [reduction-policies], [composed-features], and Simulation.h draws the true states that Consistency.h's nees() tests a filter against, and CramerRao.h's posterior Cramér-Rao bound bounds its error along them [cramer-rao-bound]; FormSteps.h holds the steps of the square-root and information forms of the Gaussian [gaussian-forms]; and Batched.h marks a function that takes every point at once [batched-functions].
A process model moves the whole state forward in time; a measurement model relates part of the state to an observation. They are separate kinds of object: a filter owns its process model, and a measurement arrives carrying its own model and noise.
Both kinds of model are functions with reads and writes (decisions.md [model-policies]): a function f(in, out, x[, dt]), f(in, x[, dt]), or f(x[, dt]) over Eigen vectors, and policies given as calls in any order. A model without reads() and writes() reads and writes the whole state (decisions.md [whole-state-models]), so the textbook Kalman filter on Linear<4> is processModel(F, additiveNoise(q)) and measurementModel(H, additiveNoise(r)). A process model is processModel(), a built-in model, or compose() of process models; a measurement model is measurementModel(). The built-in process models, RandomWalk, Constant, ConstantVelocity and ConstantAcceleration (Kinematic), and OrnsteinUhlenbeck, take their tags as template arguments and the scalar of their parameters last, double by default:
struct Position : Linear<2> {};
struct Velocity : Linear<2> {};
struct Acceleration : Linear<2> {};
struct Bias : Linear<1> {};
using State = Composite<Position, Velocity, Acceleration, Bias>;
auto const model =
compose(ConstantAcceleration<Position, Velocity, Acceleration>{0.1},
OrnsteinUhlenbeck<Bias>{TimeConstant{60.0}, StationaryVariance{0.25}});
auto const predicted =
predict(methods::linearized(), state, model, dt);
CategoricalParams< Space, Scalar > predict(CategoricalParams< Space, Scalar > const &prior, MarkovChain< Space, Scalar > const &chain)
Definition Categorical.h:1049
auto compose(Models &&... models)
Definition Placement.h:1243
A model of the user's own reads the blocks it names with block<Name>(in, x), writes the blocks it names into a vector in out, and names the inputs of the call it reads by tag; the call gives each as an uncertain input, a Gaussian over the tag's space whose uncertainty goes through the dynamics, or as sure<Tag>(value), a value known exactly:
struct SpecificForce : Linear<2> {};
struct Gravity : Linear<2> {};
[]<typename T>(auto const & in, auto const & out, auto const & x, double dt) {
auto y = zeros<T>(out);
auto const a = block<SpecificForce>(in, x) + block<Gravity>(in, x);
block<Position>(out, y) = block<Position>(in, x) + dt * block<Velocity>(in, x) + (dt * dt / 2) * a;
block<Velocity>(out, y) = block<Velocity>(in, x) + dt * a;
return y;
},
reads(path<Position>, path<Velocity>, path<SpecificForce>, path<Gravity>),
writes(path<Position>, path<Velocity>));
auto const predicted =
predict(methods::unscented(), state,
compose(driven, RandomWalk<Bias>{1e-8}), dt,
accelerometer, sure<Gravity>(g));
auto writes(Paths const &...)
Definition Policies.h:262
auto reads(Items const &...)
Definition Policies.h:196
auto processModel(F &&function, Policies &&... policies)
Definition ProcessModel.h:702
The built-in models take continuous-time parameters and discretize them exactly over the step dt, as Bar-Shalom, Li, and Kirubarajan (2001) discretize the continuous-time kinematic models; a model of the user's own gives continuousNoise(), a spectral density over the blocks it writes that the step discretizes as \( Q_c \, \Delta t \), or additiveNoise(), a fixed \( Q \), or neither where its noise comes through an input. The models of a composition must write every coordinate of the state exactly once, so a coordinate that does not move still needs a Constant or RandomWalk model; the check is at compile time where the space is fixed-size. The composition's noise is block-diagonal.
dt reaches a model's function in the filter's scalar, converted once from whatever TimeStep the caller passed (see Time steps), so a float filter's models compute in float. It is in the unit of the models' continuous-time parameters, seconds when it was a std::chrono duration. The function is generic in the scalar of x, which the Linearized method differentiates automatically, or returns its Jacobian with its value (withJacobian(), [returned-jacobians]), as the built-in models do, so that Linearized predicts them with no differentiation.
A model reads its blocks by name wherever they sit in the state, so one model serves every place that has them: on<Ownship>(vehicle) places a model on a block, prefixing every path into the state it reads and writes, onEach<Fleet>(vehicle) places one copy on every repetition of a repeated block, and compose() of measurement models measures their blocks side by side (Placement.h). A model that names the inputs it is affine in with affineIn() has them carried exactly by every sigma-point method, which spreads its points over the rest [affine-coordinates].
A measurement model takes one of three forms, from the convenient to the general: a model built once, a function with a fixed output space or one computed from the state's, such as CountFrom, or a matrix, or Columns that repeat with a block, which serves every count of the state's blocks; a model built per measurement, its function, space, and noise computed from that measurement's own data, such as the receivers that heard a signal or noise whose variances follow each reading's signal-to-noise ratio; and a model known only by its likelihood, measurementModel(reads(...), logLikelihood(g)), for the filters that weight points [likelihood-measurements]. observe() makes a measurement of it, and update() transforms only the blocks the model reads and corrects the rest of the state through their cross-covariance, which is exact under a Gaussian prior; it returns a branch per component of the additive noise, each with its Innovation [weighted-branches], [innovation-statistics]. The filters that weight points take \( \log p(z \mid x) \) from the same measurement, by logLikelihoods() (Likelihood.h).
A function that costs more per call than per point, such as one that looks up a table, holds a lock, or calls into another runtime or a device, can take every point at once: batched(f) marks it as taking the points as the columns of a matrix X and writing their values into the output Y the library provides, h(in, out, X, Y), or for a process model f(in, out, X, dt, Y), with Y.values() a column per point (Batched.h, [batched-functions]). Column \( j \) of what it writes depends only on column \( j \) of X. The library calls it once per particle set or chunk and once per sigma-point set, and through on(), compose(), and onEach() as through the model itself. A method that needs its Jacobian takes it from the function, marked batched(f, jacobians::perColumn()) or batched(f, jacobians::shared()) and writing Y.jacobian<Name>(j) for the blocks Y.wantsJacobian<Name>() names, or differentiates it in dual numbers, for which the function takes X as auto const &:
auto const elevation = measurementModel(
batched([&terrain](auto const & in, auto const &, auto const & X, auto & Y) {
auto const position = block<Position>(in, X);
for (Eigen::Index j = 0; j < X.cols(); ++j)
Y.values()(0, j) = terrain.height(position.col(j));
}),
reads(path<Position>), additiveNoise(elevationNoise));
The program examples/terrain_lookup.cpp filters such a measurement with a particle filter.
Read Filters next.