A Gaussian kept as its precision and information vector, about a reference value.
More...
|
|
| InfoGaussianParams () |
| | Constructs an InfoGaussianParams in a default space, with a zero reference and no information.
|
|
| InfoGaussianParams (Space_ space) |
| | Constructs an InfoGaussianParams in space, with a zero reference and no information.
|
template<MatrixExpression Reference, MatrixExpression Matrix, MatrixExpression Vector>
requires internal::SizedByLength<Space_> |
| | InfoGaussianParams (Reference &&reference, Matrix &&infoMatrix, Vector &&infoVector) |
| | Constructs an InfoGaussianParams about reference, with the lower triangle of infoMatrix as the precision and infoVector as \( \eta \), moving any passed as an rvalue of the stored type, in a default space resized to fit them.
|
|
template<MatrixExpression Reference, MatrixExpression Matrix, MatrixExpression Vector> |
| | InfoGaussianParams (Space_ space, Reference &&reference, Matrix &&infoMatrix, Vector &&infoVector) |
| | InfoGaussianParams(reference, infoMatrix, infoVector) in space, which is resized to fit them if it has one resizable block.
|
| | InfoGaussianParams (InfoGaussianParams const &other) |
| | Copies the data and any valid factorization.
|
|
| InfoGaussianParams (InfoGaussianParams &&other) noexcept |
| | Moves the data and any valid factorization; a view of other may not be read afterward.
|
|
InfoGaussianParams & | operator= (InfoGaussianParams const &other) |
| | Copies the data and any valid factorization; a view of this object may not be read afterward.
|
|
InfoGaussianParams & | operator= (InfoGaussianParams &&other) noexcept |
| | Moves the data and any valid factorization; a view of either object may not be read afterward.
|
| Index | valueDimension () const |
| Index | differenceDimension () const |
| Space_ const & | space () const |
| VectorType const & | reference () const |
| MatrixType const & | infoMatrix () const |
| DifferenceVectorType const & | 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 information about it.
|
|
template<MatrixExpression Matrix, MatrixExpression Vector> |
| void | setInfo (Matrix &&infoMatrix, Vector &&infoVector) |
| | Sets the precision to the lower triangle of infoMatrix and the information vector to infoVector, about the current reference, moving either one passed as an rvalue of the stored type, and invalidates the factorization.
|
| template<typename MatrixDerived, typename VectorDerived> |
| void | addInfo (Eigen::MatrixBase< MatrixDerived > const &infoMatrix, Eigen::MatrixBase< VectorDerived > const &infoVector) |
| | Adds infoMatrix (its lower triangle) to the precision and infoVector to the information vector, both about the current reference: independent information, such as \( H^T R^{-1} H \) and \( H^T R^{-1} (z - h(x_0)) \) from a measurement linearized at the reference.
|
| 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< void, GaussianError > | factorize () const |
| | Factorizes the precision if it has changed since the last factorization.
|
| std::expected< DensityType, GaussianError > | toDensity () const & |
| | Factorizes the precision if needed (see factorize()) and solves for the mean, writing both to the cache, 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::InfoGaussianParams< Space_, Scalar_ >
A Gaussian kept as its precision and information vector, about a reference value.
The multivariate normal distribution in canonical (information) form: the precision \( \Lambda = \Sigma^{-1} \) and the information vector \( \eta = \Lambda \delta \), where the mean is \( \mu = x_0 \boxplus \delta \) for the stored reference value \( x_0 \). On a linear space the reference is only an origin; on a space with \( \boxplus \) the information lives in the differences at it, as a covariance lives in the differences at a mean, and moving the reference carries it by the reset Jacobian of decisions.md [covariance-reset] (setReference()).
The form's free operation is the one the covariance form pays for: combining independent information about the same state, from a measurement or another factor, adds precisions and information vectors (addInfo(), multiply()). Its cost is the mean, a solve with \( \Lambda \). And it states what the covariance form cannot: a prior with no information at all, \( \Lambda = 0 \), which is well defined here until something asks for the mean, the covariance, or the density, each of which returns GaussianError::Singular while \( \Lambda \) is not positive definite [gaussian-forms].
Only the lower triangle of the precision is read, as only that of a Gaussian's covariance is. The Cholesky factorization of the precision is cached, as Gaussian caches its covariance's, and survives changes to the information vector. The matrices the accessors give, the precision, the covariance, and their factors, 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 an InfoGaussian, which checks this object for changes as Gaussian checks a GaussianParams. marginal<Path>() and conditional<Path>() return parameters, since their matrices are computed rather than selected. The density's marginal<Path>() cannot fail, as this one's can (decisions.md [form-densities]).
- Template Parameters
-
| Space_ | space of the coordinates (see Spaces) |
| Scalar_ | scalar type, double by default |
- See also
- toInfo(), multiply(), class GaussianParams, GaussianForm
template<Space Space_, RealScalar Scalar_ = double>
template<typename Derived>
Moves the reference to reference, normalized by the space, and re-expresses the information 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()),
\[ \Lambda' = G^{-T} \Lambda G^{-1}, \qquad \eta' = G^{-T} (\eta - \Lambda d), \]
which is the quadratic form of the density written in the differences at the new reference, where an error \( \epsilon \) at \( x_0 \) is \( G (\epsilon - d) \). On a space with an identity reset \( G \) is the identity, the distribution is unchanged exactly, and the factorization survives; elsewhere it is the first-order transport of [covariance-reset] and the factorization is invalidated.