Block 5: Multi-State Kalman Filter for Navigation#
By the end of this block you should be able to:
Explain why navigation problems require multi-state estimation.
Generalize the scalar Kalman filter equations to vector states.
Write the state transition matrix \(\mathbf{F}\) for constant-velocity 2D motion.
Write the measurement matrix \(\mathbf{H}\) for a position-only sensor.
Interpret the off-diagonal terms of the covariance matrix \(\mathbf{P}\) as cross-correlation between states.
Run a 4-state filter that simultaneously estimates 2D position and velocity from noisy 2D position fixes.
Why Multiple States?#
The scalar filter in Block 4 estimated a single quantity. Real navigation systems have to estimate many quantities simultaneously:
3D position and 3D velocity.
3-axis attitude (or its small-angle linearization).
Sensor biases on accelerometers and gyroscopes.
Receiver clock errors when GPS is in the loop.
A modern operational INS/GPS filter typically carries 12 to 20 states. The math does not change: it is still predict-then-update, still inverse-variance fusion. But every scalar becomes a vector, every variance becomes a covariance matrix, and every formula learns to respect matrix order.
Key Concept
The Kalman filter scales from one state to many by replacing scalars with vectors and variances with covariance matrices. The conceptual machinery (predict, fuse with measurement using the optimal weight, repeat) is unchanged.
A 4-State Tracking Problem#
The cleanest non-trivial example: a vehicle moving in 2D with approximately constant velocity, observed by a noisy 2D position sensor. The state vector contains 2D position and 2D velocity:
State transition matrix#
For constant-velocity motion, position evolves as \(p_{k+1} = p_k + v_k\,\Delta t\) and velocity stays the same. Stacked as a matrix:
The off-diagonal \(\Delta t\) entries are what couple velocity into position. They are the structural reason that a velocity measurement can tighten the position estimate through the cross-covariance, and equivalently the reason that a position-only sensor still produces a good velocity estimate after a few cycles. The filter learns velocity from the rate of change of position because that information is built into \(\mathbf{F}\).

Fig. 1.1. The 4-state filter propagates the state with \(\mathbf{F}\) and projects to the measurement space with \(\mathbf{H}\). Both matrices are \(4\times 4\) and \(2\times 4\) respectively for this example.
Process noise#
Real motion is not perfectly constant-velocity. Unknown accelerations along each axis inject uncertainty into all four states (acceleration affects velocity directly and position by integration). The standard model treats the unknown acceleration as zero-mean white noise with variance \(\sigma_a^2\). Working through the integrals:
The off-diagonal \(\Delta t^3 / 2\) terms make the position and velocity errors correlated even before any measurement arrives, which is the kinematic signature of “an unknown acceleration affects both states together”.
Measurement matrix#
A position-only sensor (think GPS giving you 2D coordinates) measures the first two states directly and leaves the velocity states unobserved at this measurement:
\(\mathbf{v}_k\) is the measurement noise with covariance \(\mathbf{R}\). \(\mathbf{R}\) is now a \(2\times 2\) matrix because the measurement is two-dimensional. We will reserve \(\boldsymbol{\nu}\) for the innovation \(\boldsymbol{\nu}_k = \mathbf{z}_k - \mathbf{H}\hat{\mathbf{x}}_k^-\) in the next section.
The Multi-State Kalman Filter Cycle#
Pulling the matrix-form equations together:
Propagate \((k \rightarrow k+1)\):
This is the same predict step as Block 4, in matrix form, and the same \(\mathbf{F}\mathbf{P}\mathbf{F}^{\top} + \mathbf{Q}\) propagation you ran by hand in Block 2.
Update \((- \rightarrow +)\):
Compare term-by-term to the scalar Block 4 cycle. Every quantity has gained dimensions, but the structure is identical: the gain is still inverse-variance weighting, the innovation \(\mathbf{z}_k - \mathbf{H}\hat{\mathbf{x}}_k^-\) is still the new information, and the posterior covariance is still smaller than the prior.
The matrix Kalman gain is now a \(4 \times 2\) object: it maps from the 2D measurement space back into the 4D state space. That is what lets a 2D position measurement update all four state components simultaneously.
The Covariance Matrix and Cross-Correlation#
The single most important thing to internalize about the multi-state filter is the role of the off-diagonal terms in \(\mathbf{P}\):
The diagonal terms are the variances of the individual states. The off-diagonal terms are the cross-covariances. They tell the filter how a correction to one state should be propagated into the others.
In the 4D constant-velocity model, the \(x\) and \(y\) axes are independent (no \(x\)-\(y\) cross-terms), so \(\mathbf{P}\) block-diagonalizes into a \(2\times 2\) for each axis. Within each axis there is a non-zero \(\sigma_{pv}\) term that says “if we learn that position is too high, that probably means velocity is too high also”. When a position measurement arrives and the filter updates \(p_x\), the cross-covariance pulls \(v_x\) along for the ride. The filter learns velocity from position, even though the sensor only measures position.
Any \(2\times 2\) block of \(\mathbf{P}\), such as the position block \([\,p_x,\ p_y\,]\), draws as an error ellipse; the Covariance Ellipse Explorer demo in this block lets you set the two standard deviations and the correlation and watch that ellipse stretch and tilt.
Key Concept
The cross-covariance terms in \(\mathbf{P}\) are how an observation of one state corrects all the others. In an INS/GPS filter they are how a GPS position fix simultaneously estimates and corrects accelerometer bias.
Quick Exercise: Predict in Matrix Form
GPS drops out for two steps, so only the predict step runs. Start from
in m and m/s (so the \(\mathbf{P}^+\) diagonal is in m\(^2\) and (m/s)\(^2\)), with \(\Delta t = 1\) s and \(\sigma_a^2 = 1\) (m/s\(^2\))\(^2\). The axes decouple, so work one \(2\times 2\) block \([\,p_x,\ v_x\,]\) with
Predict \(\hat{\mathbf{x}}^-\) for two steps.
Predict the \(x\)-axis block of \(\mathbf{P}^-\) for two steps. (Hint: \(\mathbf{F}\mathbf{P}\mathbf{F}^{\top}\) has entries \(P_{11} + 2\Delta t\,P_{12} + \Delta t^2 P_{22}\), \(P_{12} + \Delta t\,P_{22}\), and \(P_{22}\).)
How do \(\sigma_p\), \(\sigma_v\), and the position-velocity correlation change?
Solution
(1) Each step adds \(v\,\Delta t\) to each position: \(\hat{\mathbf{x}}_1^- = [\,110,\ 195,\ 10,\ -5\,]^{\top}\) and \(\hat{\mathbf{x}}_2^- = [\,120,\ 190,\ 10,\ -5\,]^{\top}\).
(2) For the \(x\) axis (the \(y\) axis is identical):
(3) \(\sigma_p\) grows \(2 \rightarrow 2.29 \rightarrow 3.24\) m and \(\sigma_v\) grows \(1 \rightarrow 1.41 \rightarrow 1.73\) m/s. The correlation \(\rho_{pv} = P_{12}/\sqrt{P_{11}P_{22}}\) grows \(0 \rightarrow 0.46 \rightarrow 0.71\): \(\mathbf{F}\) feeds velocity error into position, and that builds the off-diagonal terms even though \(\mathbf{P}^+\) started diagonal. That correlation is exactly what lets the next GPS fix correct velocity as well as position.
Where This Goes Next#
A real navigation filter has many more states. A typical 15-state INS/GPS filter looks like
The filter equations are exactly the ones above; only the dimensions change. Position-velocity-attitude states are propagated by the inertial mechanization, biases are propagated as Gauss-Markov processes (recall Block 2), and any aiding measurement (GPS, baro, magnetometer, vision) gets folded in via its own \(\mathbf{H}\) and \(\mathbf{R}\).
Quick Exercise
For the 4-state constant-velocity filter, you observe two consecutive position measurements 10 seconds apart. The position component of the state has converged to \(\sigma_p = 5\) m. What can you say about the velocity uncertainty \(\sigma_v\) of a steady-state filter, given \(\Delta t = 10\) s?
Solution
The filter learns velocity from the differenced position. Two position measurements with \(\sigma_p = 5\) m, spaced \(\Delta t = 10\) s apart, give a differenced-position uncertainty of \(\sqrt{2}\,\sigma_p \approx 7.07\) m, which is the uncertainty on \(v\,\Delta t\). So the velocity uncertainty is roughly
That is the quick “back-of-envelope” answer. A real Kalman filter does better than this because it averages many past measurements, weighted by their uncertainty. The exact steady-state \(\sigma_v\) depends on \(Q\) and the measurement rate. The point of the exercise is to see that the filter automatically derives a velocity estimate even though it never directly measures velocity.
Block 5 Demos#
This block ships three demo walkthroughs in the sidebar.
The Covariance Ellipse Explorer takes a single \(2\times 2\) block of \(\mathbf{P}\) apart: set \(\sigma_x\), \(\sigma_y\), and \(\rho\) and watch the eigenvectors and eigenvalues become the ellipse’s axes, with a seeded Monte Carlo cloud to show what “95%” means. An optional MATLAB companion is in the Code bundle at demos/CovarianceEllipseDemo.m.
The 4-State Kalman Filter demo runs the 4-state constant-velocity filter with position-only updates by default, plus an optional velocity sensor toggle. The live trajectory view above the position and velocity error panels shows the 95% position ellipse following the estimate. It is a circle, because the \(x\) and \(y\) channels are identical and uncoupled, and it breathes between fixes. Cross-covariance shows in the \(p_x\)–\(v_x\) error phase plane beside it: there the prior ellipse is tilted (\(\rho_{pv}^- \approx 0.78\) in steady state), and each position fix collapses it diagonally, moving \(\hat{p}_x\) and \(\hat{v}_x\) together. Two separate \(\sigma_a\) sliders (truth-side process, filter-side model Q) let you explore matched, over-conservative, and dangerously overconfident filter tunings. A MATLAB implementation is also included at demos/KalmanFilter4D.m.
The 6-State Kalman Filter demo extends the 4-state filter with an explicit acceleration channel modeled as a first-order Gauss-Markov process (recall Block 2). Three sensor toggles (position, velocity, acceleration) let you compose any subset and watch the filter behave accordingly. The headline lesson is observability: position fixes everything downhill (velocity, acceleration) through cross-covariance and the integration chain; velocity fixes velocity and acceleration but leaves position to drift; acceleration fixes acceleration and only slows the growth of velocity and position error (it cannot remove their initial values, the constants of integration). The covariance ellipse on the trajectory view balloons visibly when the sensor combination cannot constrain absolute position. The ballooning is a quick visual diagnostic of why operational systems pair an IMU (acceleration / velocity) with an absolute-position aid like GPS. A correlation heatmap shows which position–velocity–acceleration correlations each sensor set relies on. A MATLAB implementation is also included at demos/KalmanFilter6D.m.
Wrap-Up#
The multi-state Kalman filter promotes the scalar machinery of Block 4 to vectors and matrices. State transition becomes \(\mathbf{F}\). Measurement projection becomes \(\mathbf{H}\). The Kalman gain becomes a matrix that maps measurement-space corrections back into state-space updates. The off-diagonal terms of the covariance carry information between states, which is what lets a sensor that only measures position simultaneously refine velocity, and a sensor that measures velocity simultaneously refine acceleration. Every operational navigation filter you will see is a larger version of the same five matrix equations.
The next block looks at GPS, where the measurement model is no longer linear in the state because pseudoranges depend on the user position through a Euclidean norm.