OpenKalman
Classes | Public Member Functions | List of all members
OpenKalman::MonteCarloTransform Struct Reference

A Monte Carlo transform from one Gaussian distribution to another. More...

#include <MonteCarloTransform.hpp>

Inheritance diagram for OpenKalman::MonteCarloTransform:
Inheritance graph
[legend]
Collaboration diagram for OpenKalman::MonteCarloTransform:
Collaboration graph
[legend]

Public Member Functions

 MonteCarloTransform (const std::size_t samples=100000)
 Constructor. More...
 
template<typename InputDist , typename Trans , typename ... NoiseDists, std::enable_if_t<(gaussian_distribution< InputDist > and ... and gaussian_distribution< NoiseDists >) and linearized_function< Trans, 1 > and std::is_invocable_v< Trans, typename DistributionTraits< InputDist >::Mean, typename DistributionTraits< NoiseDists >::Mean... >, int > = 0>
auto operator() (const InputDist &x, const Trans &transformation, const NoiseDists &...n) const
 Perform a Monte Carlo transform from one statistical distribution to another. More...
 
template<typename InputDist , typename Trans , typename ... NoiseDists, std::enable_if_t<(gaussian_distribution< InputDist > and ... and gaussian_distribution< NoiseDists >) and linearized_function< Trans, 1 > and std::is_invocable_v< Trans, typename DistributionTraits< InputDist >::Mean, typename DistributionTraits< NoiseDists >::Mean... >, int > = 0>
auto transform_with_cross_covariance (const InputDist &x, const Trans &transformation, const NoiseDists &...n) const
 Perform a Monte Carlo transform, also returning the cross-covariance. More...
 
- Public Member Functions inherited from OpenKalman::internal::TransformBase< MonteCarloTransform >
auto operator() (const InputDist &x, const T &t, const Ts &...ts) const
 Perform one or more consecutive transforms. More...
 
auto transform_with_cross_covariance (const InputDist &x, const T &t, const Ts &...ts) const
 Perform one or more consecutive transforms, also returning the cross-covariance. More...
 

Detailed Description

A Monte Carlo transform from one Gaussian distribution to another.

Uses ideas from Chan, Tony F.; Golub, Gene H.; LeVeque, Randall J. (1979), "Updating Formulae and a Pairwise Algorithm for Computing Sample Variances." Technical Report STAN-CS-79-773, Department of Computer Science, Stanford University. http://i.stanford.edu/pub/cstr/reports/cs/tr/79/773/CS-TR-79-773.pdf

Constructor & Destructor Documentation

◆ MonteCarloTransform()

OpenKalman::MonteCarloTransform::MonteCarloTransform ( const std::size_t  samples = 100000)
inlineexplicit

Constructor.

Parameters
samplesThe number of random samples taken from the prior distribution.

Member Function Documentation

◆ operator()()

template<typename InputDist , typename Trans , typename ... NoiseDists, std::enable_if_t<(gaussian_distribution< InputDist > and ... and gaussian_distribution< NoiseDists >) and linearized_function< Trans, 1 > and std::is_invocable_v< Trans, typename DistributionTraits< InputDist >::Mean, typename DistributionTraits< NoiseDists >::Mean... >, int > = 0>
auto OpenKalman::MonteCarloTransform::operator() ( const InputDist &  x,
const Trans &  transformation,
const NoiseDists &...  n 
) const
inline

Perform a Monte Carlo transform from one statistical distribution to another.

Template Parameters
InputDistThe prior distribution.
TransThe tests on which the transform is based.
NoiseDistsZero or more noise distributions.
Returns
The posterior distribution.

◆ transform_with_cross_covariance()

template<typename InputDist , typename Trans , typename ... NoiseDists, std::enable_if_t<(gaussian_distribution< InputDist > and ... and gaussian_distribution< NoiseDists >) and linearized_function< Trans, 1 > and std::is_invocable_v< Trans, typename DistributionTraits< InputDist >::Mean, typename DistributionTraits< NoiseDists >::Mean... >, int > = 0>
auto OpenKalman::MonteCarloTransform::transform_with_cross_covariance ( const InputDist &  x,
const Trans &  transformation,
const NoiseDists &...  n 
) const
inline

Perform a Monte Carlo transform, also returning the cross-covariance.

Template Parameters
InputDistThe prior distribution.
TransThe tests on which the transform is based.
NoiseDistsZero or more noise distributions.
Returns
A tuple comprising the posterior distribution and the cross-covariance.

The documentation for this struct was generated from the following file: