Path: blob/master/notebooks/book2/08/gaussian_transforms.ipynb
1193 views
#Demo of EKF vs UKF vs GHKF
This demonstrates the sigma point methods' capacity to approximate the target distribution that results from a non-linear transformation with greater accuracy than the EKF. This is because the EKF approximates the distribution locally at the mean. Furthermore, while the UKF is limited to sigma points, the GHKF can be tuned to arbitrary accuracy as it uses sigma points where is the order of the Gauss-Hermite approximation that the user can set as a hyperparameter.
Example adapted from Figures 5.3, 5.4, 5.5, and 6.1 of Simo Särkkä (2013), “Bayesian Filtering and Smoothing."
Simo Särkkä (2013), “Bayesian Filtering and Smoothing,” Cambridge University Press. Available: https://users.aalto.fi/~ssarkka/pub/cup_book_online_20131111.pdf
Demo by Peter G. Chang (@petergchang)
##0. Imports
##1. Helper Functions
First, some functions to help generate and plot data.
Next, a wrapper for extended transform.
Finally, wrappers for the sigma point transforms.
##2. Demonstration
First, we generate a 2d Gaussian dataset comprising of 1,000 random samples around (0, 0). This replicates Figure 5.3(a) of Särkkä.
Next, we define some non-linear transformation to be applied to the points. This is a variation on Figure 5.3(b) of Särkkä.
We can examine the mean and covariance of the Gaussian random samples, as in Figure 5.4(a) of Särkkä.
We compare the EKF approximation to the transformation (solid line) to the true distribution (dashed line), as in Figure 5.4(b) of Särkkä.
Next, we turn our attention to UKF.
The sigma points on the source and target are shown as the following (similar to Figures 5.5(a), 5.5(b) of Särkkä).
Finally, we examine how a fifth order Gauss-Hermite cubature approximates the target distribution.