A Gaussian kept as an upper-triangular root of its precision and a whitened offset, about a reference value.
More...
|
|
| SqrtInfoGaussianParams () |
| | Constructs a SqrtInfoGaussianParams in a default space, with a zero reference and no information.
|
|
| SqrtInfoGaussianParams (Space_ space) |
| | Constructs a SqrtInfoGaussianParams in space, with a zero reference and no information.
|
template<MatrixExpression Reference, MatrixExpression Root, MatrixExpression Offset>
requires internal::SizedByLength<Space_> |
| | SqrtInfoGaussianParams (Reference &&reference, Root &&root, Offset &&whitenedOffset) |
| | Constructs a SqrtInfoGaussianParams about reference, with the upper triangle of root as \( R \) and whitenedOffset as \( r \), moving any passed as an rvalue of the stored type, in a default space resized to fit them.
|
|
template<MatrixExpression Reference, MatrixExpression Root, MatrixExpression Offset> |
| | SqrtInfoGaussianParams (Space_ space, Reference &&reference, Root &&root, Offset &&whitenedOffset) |
| | SqrtInfoGaussianParams(reference, root, whitenedOffset) in space, which is resized to fit them if it has one resizable block.
|
| Index | valueDimension () const |
| Index | differenceDimension () const |
| Space_ const & | space () const |
| VectorType const & | reference () const |
| MatrixType const & | infoRoot () const |
| DifferenceVectorType const & | whitenedOffset () const |
| DifferenceVectorType | infoVector () const |
| template<typename Derived> |
| void | setReference (Eigen::MatrixBase< Derived > const &reference) |
| | Moves the reference to reference, normalized by the space, and re-expresses the data array about it.
|
|
template<MatrixExpression Root, MatrixExpression Offset> |
| void | setRoot (Root &&root, Offset &&whitenedOffset) |
| | Sets \( R \) to the upper triangle of root and \( r \) to whitenedOffset, about the current reference, moving either one passed as an rvalue of the stored type.
|
| std::expected< VectorType, GaussianError > | mean () const |
| std::expected< MomentsType, GaussianError > | moments () const |
| std::expected< MatrixType, GaussianError > | covariance () const |
| std::expected< MatrixType, GaussianError > | precision () const |
| std::expected< MatrixType, GaussianError > | covarianceRoot () const |
| std::expected< MatrixType, GaussianError > | precisionRoot () const |
| std::expected< DensityType, GaussianError > | toDensity () const & |
| | Checks the root, solves for the mean, and computes \( \log|\Sigma| = -2 \sum_i \log|R_{ii}| \), writing both to a cache each time, so it is not safe on one object from two threads at once.
|
|
void | toDensity () const &&=delete |
| | A density of a temporary would outlive it.
|
| template<typename Path> |
| auto | marginal () const |
|
template<typename Path> |
| auto | marginal (Index element) const |
| | marginal<Path>() of repetition element of the repeated block Path starts at (see GaussianParams::marginal(element)).
|
| template<typename GivenPath, typename Derived> |
| auto | conditional (Eigen::MatrixBase< Derived > const &values) const |
template<Space Space_, RealScalar Scalar_ = double>
class Emrys::SqrtInfoGaussianParams< Space_, Scalar_ >
A Gaussian kept as an upper-triangular root of its precision and a whitened offset, about a reference value.
The square-root information form of Bierman (1977) (Ke et al. (2024), §II): an upper-triangular \( R \) with \( R^T R = \Lambda \), and \( r = R \delta \), where the mean is \( \mu = x_0 \boxplus \delta \) for the stored reference value \( x_0 \). The pair is the data array \( [\,R \;\; z\,] \), with the state solving \( R x = z \); here \( x \) is the offset from the reference, as in InfoGaussianParams, so that the information lives in the differences at \( x_0 \) on a space with \( \boxplus \), and moving the reference carries it by the reset Jacobian of decisions.md [covariance-reset] (setReference()).
It combines the information form's strengths with the square root's: independent information is combined by stacking whitened rows under \( [\,R \;\; r\,] \) and triangularizing (triangularize(), multiply()), which never fails and never forms \( \Lambda \), and a prior with no information is \( R = 0 \). The mean, the covariance, and the density are triangular solves with \( R \), which return GaussianError::Singular while it has a zero on its diagonal.
Only the upper triangle of a root passed in is kept; the lower is set to zero. The diagonal may have either sign, since flipping a row of \( [\,R \;\; r\,] \) leaves \( R^T R \) and \( \delta \) unchanged. The matrices the accessors give are in the differences at the reference; moments() and the conversions to a covariance form carry the covariance to the differences at the mean [covariance-reset]. toDensity() returns a FormGaussian, which checks this object for changes as Gaussian checks a GaussianParams. marginal<Path>() and conditional<Path>() return parameters, since their roots are computed rather than selected.
- Template Parameters
-
| Space_ | space of the coordinates (see Spaces) |
| Scalar_ | scalar type, double by default |
- See also
- toSqrtInfo(), multiply(), class InfoGaussianParams, GaussianForm
template<Space Space_, RealScalar Scalar_ = double>
template<typename Path>
- Returns
- the marginal of the subspace named by the path Path (a tag or a TagPath), in that subspace, as a SqrtInfoGaussianParams about the matching entries of the reference, or GaussianError::Singular if the rest's root is singular.
The data array's columns are reordered with the rest \( r \) first and the kept block \( k \) after it, and triangularized:
\[ Q^T \begin{bmatrix} R_{:r} & R_{:k} & r \end{bmatrix}
= \begin{bmatrix} R_{rr} & R_{rk} & r_r \\ 0 & R_{kk} & r_k \end{bmatrix}, \]
whose trailing block is the marginal, \( R_{kk}^T R_{kk} \) being the Schur complement of \( \Lambda_{rr} \) in \( \Lambda \) and \( R_{kk}^T r_k \) the matching information vector, when \( R_{rr} \) is nonsingular. This is the orthogonal elimination of variables from a data array of Bierman (1977), as Ke et al. (2024), §III-D, apply it to marginalize states; a time update eliminates the process noise, and here it eliminates the rest of the state. Nothing is inverted, and a bounded space allocates nothing.
template<Space Space_, RealScalar Scalar_ = double>
template<typename Derived>
Moves the reference to reference, normalized by the space, and re-expresses the data array about it.
With \( d = x_0' \boxminus x_0 \) the step and \( G \) the reset Jacobian of the space at \( x_0 \) and \( d \) (decisions.md [covariance-reset], resetJacobian()), the new array is the triangularization of \( [\,R G^{-1} \;\; r - R d\,] \), which is InfoGaussianParams::setReference()'s \( \Lambda' = G^{-T} \Lambda G^{-1} \) and \( \eta' = G^{-T}(\eta - \Lambda d) \) in factored form. On a space with an identity reset \( G \) is the identity and only \( r \) changes, exactly.