|
EmrysFilter 0.1.0
State estimation utilities in C++23 using Eigen
|
The density of a Gaussian whose covariance has been factorized: a read-only view. More...
#include <EmrysFilter/Distributions/Gaussian.h>
Public Types | |
| using | ParamsType = GaussianParams<Space_, Scalar_> |
| the parameters it reads | |
| using | SpaceType = Space_ |
| the space the values live in | |
| using | MomentsType = typename ParamsType::MomentsType |
| the mean and covariance together | |
| using | Scalar = typename ParamsType::Scalar |
| the scalar type | |
| using | Index = typename ParamsType::Index |
| Eigen's index type. | |
| using | VectorType = typename ParamsType::VectorType |
| a value, such as the mean | |
| using | DifferenceVectorType = typename ParamsType::DifferenceVectorType |
| a difference, such as a residual | |
| using | MatrixType = typename ParamsType::MatrixType |
| a matrix over differences | |
| using | LltType = Eigen::LLT<MatrixType> |
| the Cholesky factorization | |
Public Member Functions | |
| Index | valueDimension () const |
| Index | differenceDimension () const |
| Space_ const & | space () const |
| MomentsType const & | moments () const |
| VectorType const & | mean () const |
| MatrixType const & | covarianceLower () const |
| template<typename Path> | |
| auto | mean () const |
| template<typename Path> | |
| auto | mean (Index element) const |
| mean<Path>() of one repetition; see GaussianParams::mean<Path>(element). | |
| template<typename Path> | |
| auto | covariance () const |
| template<typename Path> | |
| auto | covariance (Index element) const |
| covariance<Path>() of one repetition; see GaussianParams::covariance<Path>(element). | |
| template<typename RowPath, typename ColPath> | |
| auto | covariance () const |
| LltType const & | llt () const |
| Scalar | logDeterminant () const |
| Scalar | logPeak () const |
| template<typename Derived> | |
| Scalar | squaredMahalanobisDistance (Eigen::MatrixBase< Derived > const &x) const |
| template<typename Derived> | |
| Scalar | confidence (Eigen::MatrixBase< Derived > const &x) const |
| template<typename Derived> | |
| bool | contains (Eigen::MatrixBase< Derived > const &x, Scalar probability) const |
| template<typename Derived> | |
| Scalar | logDensity (Eigen::MatrixBase< Derived > const &x) const |
| template<typename Derived> | |
| Scalar | density (Eigen::MatrixBase< Derived > const &x) const |
| template<typename Path> | |
| auto | marginal () const |
| marginal() of the subspace named by the path Path; see GaussianParams::marginal(). | |
| template<typename Path> | |
| auto | marginal (Index element) const |
| marginal() of one repetition of a repeated block; see GaussianParams::marginal(element). | |
| template<typename GivenPath, typename Derived> | |
| auto | conditional (Eigen::MatrixBase< Derived > const &values) const |
| template<typename GivenPath, typename Derived> | |
| auto | conditionalWithEvidence (Eigen::MatrixBase< Derived > const &values) const |
Static Public Attributes | |
| static constexpr int | ValueDimensionAtCompileTime = ParamsType::ValueDimensionAtCompileTime |
| the length of a value, or Eigen::Dynamic | |
| static constexpr int | MaxValueDimensionAtCompileTime = ParamsType::MaxValueDimensionAtCompileTime |
| a bound on the length of a value, or Eigen::Dynamic | |
| static constexpr int | DifferenceDimensionAtCompileTime = ParamsType::DifferenceDimensionAtCompileTime |
| the length of a difference and the rows of the covariance, or Eigen::Dynamic | |
| static constexpr int | MaxDifferenceDimensionAtCompileTime = ParamsType::MaxDifferenceDimensionAtCompileTime |
| a bound on the length of a difference, or Eigen::Dynamic | |
| static constexpr bool | IsParams = false |
| a view: it checks its parameters | |
The density of a Gaussian whose covariance has been factorized: a read-only view.
Represents the density
\[ p(x) = (2\pi)^{-n/2} |\Sigma|^{-1/2} \exp\left(-\tfrac{1}{2}(x-\mu)^T \Sigma^{-1} (x-\mu)\right). \]
Obtained from GaussianParams::toDensity(). It checks its parameters for changes, as its copies do: reading it after they have changed is a programmer error (decisions.md [view-stamp]). A Gaussian must not outlive its source.
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
The density falls as squaredMahalanobisDistance() grows, and the squaredMahalanobisDistance() of a draw is chi-squared with \( k \) degrees of freedom, so this is also the probability that a draw is denser than x. The confidence of a draw is uniform on \( [0, 1] \). The mean has confidence 0, as does every value in dimension zero.
|
inlinenodiscard |
Agrees with confidence(x) <= probability, but compares squaredMahalanobisDistance() with the quantile instead of evaluating the chi-squared CDF. The region is the one-standard-deviation ellipsoid of the Gaussian that GaussianParams::scaleToConfidence() makes. In dimension zero every value is inside.
| x | a value |
| probability | the confidence, in \( (0, 1) \) |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
On a space that is not linear this is the density in the tangent space at the mean, with the residual \( x \boxminus \mu \); the wrapped normal is not computed [tangent-gaussians].
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
marginal() of the subspace named by the path Path; see GaussianParams::marginal().
It holds a copy of this view, and so of its check of the parameters.
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
The NIS is this for a measurement under its predicted density, and the NEES (nees()) for the true state under an estimate.
|
inlinenodiscard |