How a Kalman filter works, in pictures (2015)
bzarg.com
bzarg.com
http://htmlpreview.github.io/?https://github.com/aguaviva/Ka...
https://news.ycombinator.com/item?id=16575679
HN comments were quite informative too.
That finally made me understand it better, and it's much shorter than most explanations without losing necessary details.
Also even though I took both ML and probability and statistics courses saying "it's just Bayesian inference to update the posterior" makes it more confusing for me.
I do not know the jargon, but perhaps that is because this sentence does not give you any context for what "the posterior" is referring to?
https://www.youtube.com/watch?v=LXJ5jrvDuEk
https://www.youtube.com/watch?v=HTL5-0DDqE4
https://news.ycombinator.com/item?id=13449229 (213 points, Jan 21 2017, 32 comments)
Instead, if you assume that the priors are Gaussian, then you can store that information as just two numbers: the mean and the variance (or a matrix of numbers for higher dimensional state spaces). And Guassian's have the remarkable property that if you start with Gaussians and perform a Bayesian update, then you end up with a Gaussian that can also be represented with this same amount of data. Assuming that the system is linear means that you can also represent it's update from one time to the next as a matrix. Moreover, both of these approximations are pretty good for a large class of real-world problems.
There are other sophisticated ways to get around the downsides of the general approach. Namely, there's particle filters which discretize your distributions by a sample of points, but unlike the grid discretization above, the points aren't at specific fixed locations. They're allowed to move around and are constantly being resampled from the distribution you have. This allows lots of the points to get very close together and accurately represent the most interesting (most likely) parts of the state space without wasting tons of memory on extremely unlikely points in the state space. It's very clever and fun to watch in practice!
For example, for a stationary linear Gaussian model, you have a transition model of the form: z_t = Az_{t-1} + Bu_t + e where e ~ Gaussian(0,Q) and an observation model of the form: x_t = Cz_{t} + Du_t + d, where, d ~ Gaussian (0,R)
Since, z_t and x_t are both multivariate gaussians in this model, you can compute the posterior distribution on z_t's, which will also be a Gaussian. That is basically the Kalman filter.
As the writeup mentions, you might choose a non-Gaussian noise model, in which case the posterior distribution is not a Gaussian and then you employ something like a unscented Kalman filter or extended Kalman filter.
Though the KF and it's variants are one of the simplest, well-performing estimation methods out there, so it wouldn't suprise me if it's used for everything, appropriate or not.
^ A very simple Python implementation of a Kalman Filter with Matplotlib for visualisation.
With autogenerated block diagram and description here: https://google.github.io/detectorgraph/docs/html/robotlocali...
But in industry Worse Is Better and Kalman Filters is ofent just the optimal way to remove noise you yourself added in your simulation.
I've never seen any implementation use of Kalman filters where the covariance matrix is actually sound ... and I usually go with just lowpassfilters or moving averages.
As soVeryTired wrote "In general I find Kalman filters a little suspect where the underlying dynamics of the system can change over time, and when the physical process that gives rise to the dynamics isn't known."
This maybe applies in a less degree to radars etc?
In general we use only one sensor source at a time for eg. rpm rather then fusing them. If one is obvously off just select another. Maybe it's rather about how exact you need the estimate to be.
EDIT: I forgot but I've seen them used more recently by CERN for particle trajectory prediction as part of their hit tracking system. I only know this since they wrote about it in some of their supporting documentation for their latest kaggle comp [0].
[0]: https://www.kaggle.com/c/trackml-particle-identification