|
EmrysFilter 0.1.0
State estimation utilities in C++23 using Eigen
|
Gaussian kernel density estimate over a ParticleSet. More...
#include <EmrysFilter/Distributions/KernelDensity.h>
Public Types | |
| using | SpaceType = Space_ |
| the particles' space | |
| using | ParamsType = ParticleSet<Space_, Scalar_, Allocator_> |
| the particles it reads | |
| using | allocator_type = Allocator_ |
| the particles' allocator | |
| using | KernelType |
| The zero-mean kernel, in the linear tangent space of Space_. | |
| using | MomentsType = typename ParamsType::MomentsType |
| a 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 a state | |
| using | DifferenceVectorType = typename ParamsType::DifferenceVectorType |
| a difference | |
| using | MatrixType = typename ParamsType::MatrixType |
| a matrix over differences | |
| using | SampleSetType = typename ParamsType::SampleSetType |
| states as columns | |
Public Member Functions | |
| Index | size () const |
| Index | valueDimension () const |
| Index | differenceDimension () const |
| Space_ const & | space () const |
| ParamsType const & | particles () const |
| Scalar | logTotalWeight () const |
| MatrixType const & | bandwidth () const |
| KernelType::DensityType | kernel () const |
| MomentsType | moments () const |
| template<ExecutionPolicy P> | |
| MomentsType | moments (P &&policy) const |
| moments() under policy: the particles' moments are reductions over them (see Execution policies). | |
| template<typename Derived> | |
| Scalar | logDensity (Eigen::MatrixBase< Derived > const &x) const |
| template<ExecutionPolicy P, typename Derived> | |
| Scalar | logDensity (P &&policy, Eigen::MatrixBase< Derived > const &x) const |
| logDensity() under policy: a log-sum-exp over the particles, reduced over chunks of them (see Execution policies). | |
| template<typename Derived> | |
| Scalar | density (Eigen::MatrixBase< Derived > const &x) const |
Static Public Attributes | |
| static constexpr int | ValueDimensionAtCompileTime = ParamsType::ValueDimensionAtCompileTime |
| the length of a state, or Eigen::Dynamic | |
| static constexpr int | MaxValueDimensionAtCompileTime = ParamsType::MaxValueDimensionAtCompileTime |
| a bound on the length of a state, or Eigen::Dynamic | |
| static constexpr int | DifferenceDimensionAtCompileTime = ParamsType::DifferenceDimensionAtCompileTime |
| the length of a difference and the rows of the bandwidth, or Eigen::Dynamic | |
| static constexpr int | MaxDifferenceDimensionAtCompileTime = ParamsType::MaxDifferenceDimensionAtCompileTime |
| a bound on the length of a difference, or Eigen::Dynamic | |
Gaussian kernel density estimate over a ParticleSet.
Represents the density
\[ \hat p(x) = \sum_i \hat w_i \, \mathcal{N}(x; x_i, H), \]
where \( x_i \) are the particles, \( \hat w_i \) their normalized weights, and \( H \) the bandwidth (kernel covariance), which is factorized once and shared by every kernel: a weighted kernel density estimate with a multivariate Gaussian kernel (Silverman (1986), as given in Multivariate KDE).
Created by ParticleSet::toDensity(). It checks the source set for changes, as its copies do: reading it after the set has changed is a programmer error (decisions.md [view-stamp]). A KernelDensity must not outlive its source.
| using Emrys::KernelDensity< Space_, Scalar_, Allocator_ >::KernelType |
The zero-mean kernel, in the linear tangent space of Space_.
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
Costs one triangular solve per particle, each into a vector sized by the space, so it allocates nothing for a bounded space. It writes nothing, so it may be evaluated at several points at once.
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |