|
EmrysFilter 0.1.0
State estimation utilities in C++23 using Eigen
|
The multivariate Student-t distribution: a Gaussian with heavier tails. More...
#include <EmrysFilter/Distributions/StudentT.h>
Public Types | |
| using | ScaleGaussianType = GaussianParams<Space_, Scalar_> |
| \( \mathcal{N}(\mu, \Sigma) \), which holds the parameters | |
| using | MomentsType = typename ScaleGaussianType::MomentsType |
| a mean and covariance together | |
| using | Scalar = Scalar_ |
| the scalar type | |
| using | Index = Eigen::Index |
| Eigen's index type. | |
| using | SpaceType = Space_ |
| the space the values live in | |
| using | VectorType = typename MomentsType::VectorType |
| a value | |
| using | MatrixType = typename MomentsType::MatrixType |
| a matrix over differences | |
Public Member Functions | |
| Index | valueDimension () const |
| Index | differenceDimension () const |
| Space_ const & | space () const |
| VectorType const & | location () const |
| MatrixType const & | scale () const |
| Scalar | dof () const |
| ScaleGaussianType::DensityType | scaleDensity () const |
| template<typename Derived> | |
| Scalar | logDensity (Eigen::MatrixBase< Derived > const &x) const |
| template<typename Derived> | |
| Scalar | density (Eigen::MatrixBase< Derived > const &x) const |
| std::expected< MomentsType, MomentsError > | moments () const |
| Scalar | logDensityAtSquaredDistance (Scalar squaredDistance) const |
| template<typename Path> | |
| auto | marginal () const |
| marginal() of the subspace named by the tag path Path (see idx()), in that subspace. | |
| 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 |
Static Public Member Functions | |
| template<MatrixExpression Location, typename ScaleDerived> | |
| static std::expected< StudentT, StudentTError > | create (Space_ space, Location &&location, Eigen::MatrixBase< ScaleDerived > const &scale, Scalar dof) |
| template<MatrixExpression Location, typename ScaleDerived> | |
| static std::expected< StudentT, StudentTError > | create (Location &&location, Eigen::MatrixBase< ScaleDerived > const &scale, Scalar dof) |
| create() in the default space. | |
| static std::expected< StudentT, StudentTError > | create (ScaleGaussianType const &gaussian, Scalar dof) |
| create() from the location and scale of gaussian, which keeps its space. | |
The multivariate Student-t distribution: a Gaussian with heavier tails.
The multivariate t-distribution. With location \( \mu \), scale matrix \( \Sigma \), and \( \nu \) degrees of freedom in \( d \) dimensions,
\[ p(x) = \frac{\Gamma\left(\frac{\nu + d}{2}\right)}{\Gamma\left(\frac{\nu}{2}\right) (\nu\pi)^{d/2} |\Sigma|^{1/2}} \left(1 + \frac{\delta^2}{\nu}\right)^{-\frac{\nu + d}{2}}, \]
where \( \delta^2 = (x \boxminus \mu)^T \Sigma^{-1} (x \boxminus \mu) \). It is a scale mixture of Gaussians: \( x = \mu + L z / \sqrt{u / \nu} \) with \( z \sim \mathcal{N}(0, I) \), \( u \sim \chi^2_\nu \), and \( \Sigma = L L^T \). As \( \nu \to \infty \) it approaches \( \mathcal{N}(\mu, \Sigma) \); \( \nu = 1 \) is the Cauchy distribution.
The scale matrix is not the covariance: the covariance is \( \frac{\nu}{\nu - 2} \Sigma \), and only exists for \( \nu > 2 \) (see moments()). Densities use the nearest image, as a Gaussian's do.
Created by create(), which checks the degrees of freedom and factorizes the scale matrix, and returns a StudentTError if either fails; it has no public constructor [checked-factories]. A StudentT is an immutable value that owns its parameters.
| Space_ | space of the coordinates (see Spaces) |
| Scalar_ | scalar type |
|
inlinenodiscard |
With \( d_b \) given difference coordinates at squared Mahalanobis distance \( \delta_b^2 \) from their location, the conditional has \( \nu + d_b \) degrees of freedom, the Gaussian conditional's location \( \mu_a \boxplus K (v \boxminus \mu_b) \), and the Gaussian conditional's scale \( \Sigma_{aa} - K \Sigma_{ba} \) times \( (\nu + \delta_b^2) / (\nu + d_b) \), with \( K = \Sigma_{ab} \Sigma_{bb}^{-1} \). So values far from the location widen it. The result is Ding (2016), Theorem 1.
|
inlinestaticnodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |