← Tutorials

Tutorial Series · Part 20 of 27

Kalman Filter Intuition for Navigation

Explain Kalman gain, covariance and GNSS/INS prediction-correction intuition.

Series Context

Navigation from First Principles

This article is part of an ordered course. Use the previous and next links to stay in sequence.

A Kalman filter is often taught as equations first. For navigation, it is better to start with behaviour: an INS prediction is smooth but drifts; GNSS measurements are absolute but noisy and sometimes wrong. The filter combines a motion model, sensor measurements and uncertainty. Welch and Bishop provide a practical introduction to the discrete Kalman filter and EKF.1

The navigation tradeoff

A vehicle receives GNSS fixes once per second. Its IMU provides high-rate prediction. The GNSS points jump around; the IMU-only path drifts. The fused result should be smoother than GNSS alone and less drifting than INS alone.

Prediction and correction

Prediction:

xk=f(xk1,uk)\mathbf{x}^{-}_k=f(\mathbf{x}_{k-1},\mathbf{u}_k) Pk=FkPk1FkT+Qk\mathbf{P}^{-}_k=\mathbf{F}_k\mathbf{P}_{k-1}\mathbf{F}_k^T+\mathbf{Q}_k

Update:

yk=zkh(xk)\mathbf{y}_k=\mathbf{z}_k-h(\mathbf{x}^{-}_k) Sk=HkPkHkT+Rk\mathbf{S}_k=\mathbf{H}_k\mathbf{P}^{-}_k\mathbf{H}_k^T+\mathbf{R}_k Kk=PkHkTSk1\mathbf{K}_k=\mathbf{P}^{-}_k\mathbf{H}_k^T\mathbf{S}_k^{-1} xk=xk+Kkyk\mathbf{x}_k=\mathbf{x}^{-}_k+\mathbf{K}_k\mathbf{y}_k

The Kalman gain K\mathbf{K} controls how much the correction moves the estimate. MathWorks’ insEKF documentation is useful as a practical reference for inertial prediction with discrete sensor corrections.2

Interactive demo: GNSS/INS Kalman playground

The playground below uses a compact constant-velocity filter rather than a full INS EKF, but it still shows the behaviour that matters.

Interactive Demo

GNSS/INS Kalman Playground

The prediction drifts smoothly, GNSS fixes jump around, and the fused estimate shifts according to how much trust the filter gives each source.

GNSS dots, INS drift path, and fused Kalman estimate Current Kalman gain magnitude

Controls

Run the default case first. Then raise GNSS noise, IMU bias, or outliers and watch how the gain and fused error respond.

Readouts

Fused error0.0 m
INS error0.0 m
Gain0.00
Confidencebalanced

What to watch

  • Increasing GNSS noise makes the filter rely more on prediction.
  • Increasing process noise loosens the prediction and makes the filter move toward the measurements.
  • Outliers pull the estimate unless rejection is enabled.
  • The gain bar changes as uncertainty changes, making “trust” visible rather than abstract.

Try this

Set measurement noise low in the UI but inject large GNSS noise. The filter should over-trust bad measurements. This teaches that covariance is not decoration; it is a statement about trust.

Limits of this toy filter

A real GNSS/INS EKF usually estimates attitude, velocity, position, IMU biases, and sometimes clock states. This first example stays small enough to inspect, while the later posts add the missing states and complications.

Footnotes

  1. Greg Welch and Gary Bishop, “An Introduction to the Kalman Filter”, TR 95-041. https://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/WELCH/kalman.html - Practical introduction to the discrete Kalman filter and EKF. Accessed 2026-06-11.

  2. MathWorks, “insEKF - Inertial Navigation Using Extended Kalman Filter”. https://www.mathworks.com/help/nav/ref/insekf.html - Continuous-discrete EKF object using inertial sensors for prediction and discrete measurements for correction. Accessed 2026-06-11.