EmrysFilter 0.1.0
State estimation utilities in C++23 using Eigen
Loading...
Searching...
No Matches
Emrys::OutputWithCross< InputSpace, OutputSpace, Form, Scalar > Class Template Reference

The result of transform() with an input marked by withCross(): the output's Gaussian and its linearization in that input, in the Form the method computes it, JacobianForm or RootForm (decisions.md [linearization-forms]). More...

#include <EmrysFilter/Models/Linearization.h>

Public Types

using FormType = Form
 JacobianForm or RootForm.
using OutputType = GaussianParams<OutputSpace, Scalar>
 The output's distribution.
using OutputVector = typename OutputType::VectorType
 An output value.
using OutputMatrix = typename OutputType::MatrixType
 A covariance over the output's differences.
using CrossMatrix = internal::CrossMatrixOf<InputSpace, OutputSpace, Scalar>
 The cross-covariance's type, and \( \Psi \)'s: input differences by output differences.
using JacobianMatrix
 The Jacobian's type: output differences by input differences.
using RootMatrix
 The root's type: over the input's differences.
using FactorMatrix = std::conditional_t<IsRoot, RootMatrix, JacobianMatrix>
 What the form holds beside its cross-covariance: \( H \) in the Jacobian form, \( S \) in the root form.

Public Member Functions

template<MatrixExpression Mean, MatrixExpression Factor, MatrixExpression Cross, MatrixExpression Explained, MatrixExpression Inputs, MatrixExpression Unexplained>
 OutputWithCross (OutputSpace space, Mean &&mean, Factor &&factor, Cross &&cross, Explained &&explained, Inputs &&inputs, Unexplained &&unexplained)
 The prediction in space with mean mean, normalized, and the parts of its linearization: factor, \( H \) or \( S \) as the form says, cross, \( \Sigma_{xy} \) or \( \Psi \), and the symmetric explained, inputs, and unexplained, whose sum is the output covariance.
OutputType const & output () const &
OutputType output () &&
OutputMatrix const & explainedCovariance () const
OutputMatrix const & inputsCovariance () const
OutputMatrix const & unexplainedCovariance () const
CrossMatrix const & crossCovariance () const
CrossMatrix crossCovariance () const
JacobianMatrix const & jacobian () const
JacobianMatrix jacobian () const
RootMatrix const & root () const
CrossMatrix const & whitenedCross () const

Detailed Description

template<typename InputSpace, typename OutputSpace, typename Form, typename Scalar = double>
class Emrys::OutputWithCross< InputSpace, OutputSpace, Form, Scalar >

The result of transform() with an input marked by withCross(): the output's Gaussian and its linearization in that input, in the Form the method computes it, JacobianForm or RootForm (decisions.md [linearization-forms]).

condition() conditions the input on an observation of the output.

The output covariance is the sum of three parts, each computed as a product of quantities of its own size, so that none is recovered by subtraction: \( S_y = H P H^T + N + \Omega \), the part the marked input explains (explainedCovariance()), the part the other uncertain inputs explain (inputsCovariance()), such as noise passed to the function, and the part neither explains (unexplainedCovariance()), the function's curvature over the input's spread as the method sees it, which is zero for the Jacobian form. Uncertain inputs are independent, so the joint root is block-diagonal and the root form's \( \Psi \) splits by input: \( H P H^T = \Psi^T \Psi \) over the marked input's rows, and \( N \) the same sum over the other inputs' rows.

Each form holds what its method computes and derives the rest, as the table below says: the Jacobian form holds \( H \) and \( \Sigma_{xy} \), and the root form \( S \) and \( \Psi \), from which \( \Sigma_{xy} = S \Psi \) is a product and \( H = \Psi^T S^{-1} \) a solve.

Asked for Jacobian form Root form
\( H P H^T \), \( N \), \( \Omega \), and their sum held held
\( \Sigma_{xy} \), for updates::Standard and updates::Symmetric held \( S \Psi \), a product
a full state's \( P_{xS} H_S^T \) from the blocks read a product \( P_{xS} S^{-T} \Psi \), a solve
\( H \): information forms, iterated updates, part-state Joseph held \( \Psi^T S^{-1} \), a solve

updates::Joseph over the whole input is \( (I - KH) P (I - KH)^T + K R K^T \) in the Jacobian form and, since \( H S = \Psi^T \), \( (S - K \Psi^T)(S - K \Psi^T)^T + K R K^T \) in the root form: one product of the input's size cubed and no solve, still a sum of two positive semidefinite terms.

Template Parameters
InputSpacespace of the marked input
OutputSpacespace of the output
FormJacobianForm or RootForm

Member Typedef Documentation

◆ JacobianMatrix

template<typename InputSpace, typename OutputSpace, typename Form, typename Scalar = double>
using Emrys::OutputWithCross< InputSpace, OutputSpace, Form, Scalar >::JacobianMatrix
Initial value:
internal::MatrixOf<
Scalar,
constexpr int valueDimensionAtCompileTime
The value dimension of Space at compile time, or Eigen::Dynamic if it is resizable.
Definition Space.h:251
constexpr int maxValueDimensionAtCompileTime
The largest valid value dimension of Space, or Eigen::Dynamic if it is unbounded.
Definition Space.h:258

The Jacobian's type: output differences by input differences.

◆ RootMatrix

template<typename InputSpace, typename OutputSpace, typename Form, typename Scalar = double>
using Emrys::OutputWithCross< InputSpace, OutputSpace, Form, Scalar >::RootMatrix

Constructor & Destructor Documentation

◆ OutputWithCross()

template<typename InputSpace, typename OutputSpace, typename Form, typename Scalar = double>
template<MatrixExpression Mean, MatrixExpression Factor, MatrixExpression Cross, MatrixExpression Explained, MatrixExpression Inputs, MatrixExpression Unexplained>
Emrys::OutputWithCross< InputSpace, OutputSpace, Form, Scalar >::OutputWithCross ( OutputSpace space,
Mean && mean,
Factor && factor,
Cross && cross,
Explained && explained,
Inputs && inputs,
Unexplained && unexplained )
inline

The prediction in space with mean mean, normalized, and the parts of its linearization: factor, \( H \) or \( S \) as the form says, cross, \( \Sigma_{xy} \) or \( \Psi \), and the symmetric explained, inputs, and unexplained, whose sum is the output covariance.

Each matrix passed as an rvalue of its stored type is moved. For the library's transforms, which every prediction comes from.

Member Function Documentation

◆ crossCovariance() [1/2]

template<typename InputSpace, typename OutputSpace, typename Form, typename Scalar = double>
CrossMatrix Emrys::OutputWithCross< InputSpace, OutputSpace, Form, Scalar >::crossCovariance ( ) const
inlinenodiscard
Returns
\( \Sigma_{xy} = S \Psi \), formed: a row per difference coordinate of the input, a column per difference coordinate of the output

◆ crossCovariance() [2/2]

template<typename InputSpace, typename OutputSpace, typename Form, typename Scalar = double>
CrossMatrix const & Emrys::OutputWithCross< InputSpace, OutputSpace, Form, Scalar >::crossCovariance ( ) const
inlinenodiscard
Returns
\( \Sigma_{xy} \): a row per difference coordinate of the input, a column per difference coordinate of the output

◆ explainedCovariance()

template<typename InputSpace, typename OutputSpace, typename Form, typename Scalar = double>
OutputMatrix const & Emrys::OutputWithCross< InputSpace, OutputSpace, Form, Scalar >::explainedCovariance ( ) const
inlinenodiscard
Returns
\( H P H^T \), the part of the output covariance that the marked input explains

◆ inputsCovariance()

template<typename InputSpace, typename OutputSpace, typename Form, typename Scalar = double>
OutputMatrix const & Emrys::OutputWithCross< InputSpace, OutputSpace, Form, Scalar >::inputsCovariance ( ) const
inlinenodiscard
Returns
\( N \), the part of the output covariance that the other uncertain inputs explain

◆ jacobian() [1/2]

template<typename InputSpace, typename OutputSpace, typename Form, typename Scalar = double>
JacobianMatrix Emrys::OutputWithCross< InputSpace, OutputSpace, Form, Scalar >::jacobian ( ) const
inlinenodiscard
Returns
\( H = \Psi^T S^{-1} \), the statistical linearization's Jacobian, by a solve with the root

◆ jacobian() [2/2]

template<typename InputSpace, typename OutputSpace, typename Form, typename Scalar = double>
JacobianMatrix const & Emrys::OutputWithCross< InputSpace, OutputSpace, Form, Scalar >::jacobian ( ) const
inlinenodiscard
Returns
\( H \), the Jacobian at the input's mean

◆ output() [1/2]

template<typename InputSpace, typename OutputSpace, typename Form, typename Scalar = double>
OutputType Emrys::OutputWithCross< InputSpace, OutputSpace, Form, Scalar >::output ( ) &&
inlinenodiscard
Returns
the distribution of the output, moved out

◆ output() [2/2]

template<typename InputSpace, typename OutputSpace, typename Form, typename Scalar = double>
OutputType const & Emrys::OutputWithCross< InputSpace, OutputSpace, Form, Scalar >::output ( ) const &
inlinenodiscard
Returns
the distribution of the output, with covariance \( S_y = H P H^T + N + \Omega \)

◆ root()

template<typename InputSpace, typename OutputSpace, typename Form, typename Scalar = double>
RootMatrix const & Emrys::OutputWithCross< InputSpace, OutputSpace, Form, Scalar >::root ( ) const
inlinenodiscard
Returns
\( S \), the root of the marked input's covariance that spread the points

◆ unexplainedCovariance()

template<typename InputSpace, typename OutputSpace, typename Form, typename Scalar = double>
OutputMatrix const & Emrys::OutputWithCross< InputSpace, OutputSpace, Form, Scalar >::unexplainedCovariance ( ) const
inlinenodiscard
Returns
\( \Omega \), the part of the output covariance that no input explains: the function's curvature over the inputs' spread as the method sees it, from the residuals of the fit at the points, and zero for the Jacobian form. With a negative sigma-point weight it can be indefinite.

◆ whitenedCross()

template<typename InputSpace, typename OutputSpace, typename Form, typename Scalar = double>
CrossMatrix const & Emrys::OutputWithCross< InputSpace, OutputSpace, Form, Scalar >::whitenedCross ( ) const
inlinenodiscard
Returns
\( \Psi = S^{-1} \Sigma_{xy} = (H S)^T \), the whitened cross-covariance

The documentation for this class was generated from the following file: