Kalman Filters, Demystified
Understand how Kalman filters estimate hidden states through prediction and measurement updates, balance uncertainty with the Kalman gain, and depend on specific assumptions.
Kalman Filters, Demystified: a hidden state is estimated by blending a model with noisy measurements. By the end, you'll know: why filtering matters, the prediction-update loop, and the core ingredients. A Kalman filter matters when the thing you care about is hidden, but you still get measurements every cycle. You are not trying to store raw data. You are trying to estimate the current state in real time, even when each reading is noisy. So the system takes two inputs at once: a model of how the state should evolve, and an observation that only partially reflects that state. True or false: the filter replaces the measurement. False. It uses the measurement to refine an estimate that already came from the model. Now we need the three pieces that make the loop work. First is the state, the quantity you want to track. Second is the model, which tells you how that state moves from one step to the next. Third is noise, which captures what can go wrong in both the motion and the sensor. If you leave out the state, there is nothing to estimate. If you leave out the model, you have no prediction step. If you leave out noise, you are pretending every reading is exact, and that breaks the update logic. Identify the components: state, transition model, process noise, measurement noise. Those four pieces define the estimation problem. This is the key shift. The filter is not guessing blindly from data. It is carrying a state estimate forward, attaching uncertainty to it, and then comparing that estimate to the next measurement. The whole setup is about how information moves through the system, not just about the final number. One practical question to keep in mind is this: what is actually observable, and what is only inferred? In many systems, the sensor gives you a signal that is related to the hidden state, but not the state itself. The model bridges that gap, and the uncertainty terms tell you how hard to trust each side. So when you build the filter, you are really specifying a pipeline: state in, model propagation, uncertainty growth, measurement in, correction out. That structure is what lets the estimator stay operational instead of static. Once the ingredients are set, the cycle is simple. First you predict the next state using the model and the previous estimate. Then you bring in the newest measurement and correct that prediction. The filter alternates between those two steps every time a sample arrives. That alternation is important because prediction alone drifts, and correction alone has no memory. The prediction carries the state forward through time. The correction pulls it back toward reality. You can think of the loop as a controlled handoff of information from model to data and back again. Apply it to a new situation: if a sensor drops a little, the prediction still gives you a usable estimate for that time step. When the next observation arrives, the correction step absorbs it and re-centers the state. That is why the filter stays responsive without becoming jumpy. The question now is not whether to predict or correct. It is how much each one should count. That is the job of the Kalman gain. It is the weight that decides how strongly the update leans toward the model estimate versus the new measurement. If the prediction is very uncertain, the gain shifts more weight to the measurement. If the measurement is noisy, the gain leans harder on the prediction. True or false: the gain is fixed once the filter starts. False. It changes as the uncertainty in the state estimate and the sensor data changes over time. So the gain is not an extra decoration on the algorithm. It is the control point where uncertainty becomes action. The filter does not average prediction and measurement with a constant rule. It computes a state-dependent weight from the current covariance, and that is what keeps the update adaptive. You can read the update directly from the information flow. Prediction produces a prior estimate. Measurement supplies new evidence. Gain converts the relative trust in those two sources into a correction size. Small gain means the state barely moves. Large gain means the measurement pulls the estimate more strongly. That is why two systems with the same sensor can behave differently. Change the assumed process noise, and the gain changes. Change the measurement noise, and the gain changes again. The weighting follows the uncertainty bookkeeping, not a hand-tuned fixed blend. Now we move to why the update is mathematically justified. The Kalman filter is optimal under a specific set of assumptions: linear dynamics, Gaussian noise, and a correct model structure. Under those conditions, the equations propagate the mean and covariance exactly through the predict-correct loop. That matters because the filter is not searching over all possible estimates. It is producing the best linear unbiased estimate for that model class. If the dynamics are linear, the noise is Gaussian, and the model matches the system, then the computed gain and covariance give you the minimum-error linear update. This is the point where a common misconception shows up. People sometimes treat Kalman filtering as a generic cure for noise. It is not. If the model is wrong or the noise is strongly non-Gaussian, the guarantees weaken. The machinery still runs, but the optimality claim no longer holds in the same way. So the assumptions are not footnotes. They are part of the mechanism. Linear structure lets the state update stay closed-form. Gaussian noise lets uncertainty be represented by mean and covariance alone. Correct model structure lets the prediction and correction steps line up with the actual data-generating process. The practical takeaway is to check the assumptions before you trust the result. If they are approximately true, the filter is often very effective. If they are badly violated, you need a different estimator or a modified model, not just more tuning. So the main thing to remember is this: a Kalman filter is a principled loop for combining prediction and measurement under uncertainty, and it works best when you model the state carefully and let the uncertainty drive the update. So, here’s what you now know about Kalman filters. You’ve learned: hidden state from noisy data, prediction plus correction, and uncertainty sets the balance. Next time a sensor looks messy, you’ll see that quiet tug-of-war between model and measurement. Take this with you — it'll come in handy.