I recently updated the homepage of my Kalman Filter tutorial with a new example based on a simple radar tracking problem. The goal was to make the Kalman Filter understandable to anyone with basic knowledge of statistics and linear algebra, without requiring advanced mathematics.
The example starts with a radar measuring the distance to a moving object and gradually builds intuition around noisy measurements, prediction using a motion model, and how the Kalman Filter combines both. I also tried to keep the math minimal while still showing where the equations come from.
I would really appreciate feedback on clarity. Which parts are intuitive? Which parts are confusing? Is the math level appropriate?
If you have used Kalman Filters in practice, I would also be interested to hear whether this explanation aligns with your intuition.
I just glossed through for now so might have missed it, but it seemed you pulled the process noise matrix Q out of a hat. I guess it's explained properly in the book but would be nice with some justification for why the entries are what they are.
To keep the example focused and reasonably short, I treated Q matrix as given and concentrated on building intuition around prediction and update. But you're right that this can feel like it appears out of nowhere.
The derivation of the Q matrix is a separate topic and requires additional assumptions about the motion model and noise characteristics, which would have made the example significantly longer. I cover this topic in detail in the book.
I'll consider adding a brief explanation or reference to make that step clearer. Thanks for pointing this out.
Yeah I understand. I do think a brief explanation would help a lot though. As it sits it's not even entirely clear if the presented matrix is general or highly specific. I can easily see someone just use that as their Q matrix because that's what the Q matrix is, says so right there.
I think that this was a great intro into Kalman filtering.
The one important point that I think warrants a small paragraph near the end is that the example you gave is a way of doing forecasting (estimating the future state) and nowcasting (estimating the current state), but Kalman filters can also be used retrospectively to do retrocasting (using the present data to get a better estimate of the past).
Nowcasting and retrocasting are concepts that a lot of people have trouble with. That trouble is the crux of the Kalman filter ... combining (noisy) measurements with (noisy) dead reckoning gives us (better) knowledge. For complete symmetry, it is important to point out that we can't just use old measurements to describe the past any more than we should only use current and past measurements to define our estimate of the present.
Firstly I think the clarity in general is good. The one piece I think you could do with explaining early on is which pieces of what you are describing are the model of the system and which pieces are the Kalman filter. I was following along as you built the markov model of the state matrix etc and then you called those equations the Kalman filter, but I didn't think we had built a Kalman filter yet.
Your early explanation of the filter (as a method for estimating the state of a system under uncertainty) was great but (unless I missed it) when you introduced the equations I wasn't clear that was the filter. I hope that makes sense.
You’re pointing out a real conceptual issue: where the system model ends and where the Kalman filter begins.
In Kalman filter theory there are two different components:
- The system model
- The Kalman filter (the algorithm)
The state transition and measurement equations belong to the system model. They describe the physics of the system and can vary from one application to another.
The Kalman filter is the algorithm that uses this model to estimate the current state and predict the future state.
I'll consider making that distinction more explicit when introducing the equations. Thanks for pointing this out.
The tutorial actually predates ChatGPT by quite a few years (first published in 2017). Today, I do sometimes use ChatGPT to fix grammar, but I am responsible for the content and it is always mine.
You lead with "Moreover, it is an optimal algorithm that minimizes state estimation uncertainty." By the end of the tutorial I understood what this meant, but "optimal algorithm" is a vague term I am unfamiliar with (despite using Kalman Filters in my work). It might help to expand on the term briefly before diving into the math, since IIUC it's the key characteristic of the method.
That's a good point. "Optimal" in this context means that, under the standard assumptions (linear system, Gaussian noise, correct model), the Kalman Filter minimizes the estimation error covariance. In other words, it provides the minimum-variance estimate among all linear unbiased estimators.
You're right that the term can feel vague without that context. I’ll consider adding a short clarification earlier in the introduction to make this clearer before diving into the math. Thanks for the suggestion.
That's an interesting idea. The Kalman filter is definitely used in finance, often together with time-series models like ARMA. I've been thinking about writing something, although it's a bit outside my usual engineering focus.
The challenge would be to keep it intuitive and accessible without oversimplifying. Still, it could be an interesting direction to explore.
I recently (~6 mo ago) made it a goal to understand and implement a useful Kalman filter, but I realized that they are very tightly coupled to their domain and application. I got about half as far as I wanted, and took a pause. I expect your work here will get me to the finish line, so I am psyched! Thank you!
Thanks for your feedback! Actually the KF concept is generic, but as mentioned above:
"The state transition and measurement equations belong to the system model. They describe the physics of the system and can vary from one application to another."
So it is right to say that the implementation of the KF is tightly coupled to the system. Getting that part right is usually the hardest step.
I read and enjoyed your book a few months ago when a friend recommened it to me. I've been interested in control theory for a few years, but I'm still definitely a beginner when it comes to designing good control systems and have never done it professionally.
I've been in the process of writing a tutorial on how PID filters work for a much younger audience. As a result, I've been looking back at the original tutorials that made stuff click for me. I had several engineers try to explain PID control to me over the course of about a year, but I don't think I really got it until I ended up watching Terry Davis (yeah, the TempleOS guy) show off how to use PID control in SimStructure using a hovering rocket as an example.
The way he built the concept up was to take each component and build on the control system until he had something that worked. He started off with a simple proportional controller that ended up having a steady state error with the rocket hovering beneath the target height. Once he had that and pointed out the steady state error, he implemented the integral term showed off how it resulted in overshoot. Once that was working, he implemented the derivative control to back the overshoot off until he had something that settled pretty quickly.
I'm not sure how you could do something similar for a Kalman Filter, but I did find it genuinely constructive to see the thought process behind adding each component of the equation.
I recently updated the homepage of my Kalman Filter tutorial with a new example based on a simple radar tracking problem. The goal was to make the Kalman Filter understandable to anyone with basic knowledge of statistics and linear algebra, without requiring advanced mathematics.
The example starts with a radar measuring the distance to a moving object and gradually builds intuition around noisy measurements, prediction using a motion model, and how the Kalman Filter combines both. I also tried to keep the math minimal while still showing where the equations come from.
I would really appreciate feedback on clarity. Which parts are intuitive? Which parts are confusing? Is the math level appropriate?
If you have used Kalman Filters in practice, I would also be interested to hear whether this explanation aligns with your intuition.