Search

Search papers and lessons

Linear Dynamical System

Level 3 · 14 min read

A linear dynamical system describes a hidden state that evolves by a linear rule plus noise and is seen only through noisy linear measurements, and with Gaussian noise its mean and covariance can be tracked exactly.

On this page

  • Colour = topic mix
  • Probability
  • Linear algebra
  • Calculus
  • Control systems
  • Discrete math
  • Sign in to see your progress

TL;DR

A linear dynamical system has a hidden state vector that changes from one time step to the next by a linear rule, with some random push added each step. You never see the state directly. You see a noisy linear readout of it. When the noise is Gaussian, the state's uncertainty stays Gaussian forever, so you can track its mean and covariance with simple matrix arithmetic.

Where you'll see it: in tracking a moving object from noisy sensors, in the Kalman filter that navigation systems run, and in control design, where the state is what a controller needs to know.

Intuition

A hidden state and a noisy window

Imagine a cart rolling on a track. Its true position and velocity are the state. Each second, the cart keeps about the same velocity, but friction and small bumps change it a little. You cannot read the state directly. You have a radar that reports the position with some error.

The linear dynamical system is the model of that situation. The state is the cart's position and velocity. The dynamics say how the state moves forward, and the measurement says what the radar reports. Both are linear, which means they are built from multiplying by fixed matrices and adding. Linearity is what keeps the mathematics tractable: a linear map of a bell curve is still a bell curve.

The picture of the whole model is a loop. The hidden state moves, the output is read off it, and the only things you can use to infer the state are the outputs.

flowchart LR
  U[known input u] --> P[state update: x next = A x + B u + noise]
  P --> X[hidden state x]
  X --> M[readout: y = C x + noise]
  M --> Y[observed output y]

Why this model exists: most real systems are close to linear around the operating point, and a linear model with Gaussian noise is the simplest one that still admits exact inference. Once you know the rules, the question "what is the state now, given the outputs so far?" has a closed-form answer.

The math

Definition

A discrete-time linear Gaussian state-space model has a state xt∈Rn\mathbf{x}_t \in \mathbb{R}^n and an output yt∈Rm\mathbf{y}_t \in \mathbb{R}^m at each step tt:

xt+1=Axt+But+wt,yt=Cxt+vt.\mathbf{x}_{t+1} = A\mathbf{x}_t + B\mathbf{u}_t + \mathbf{w}_t, \qquad \mathbf{y}_t = C\mathbf{x}_t + \mathbf{v}_t.

Here AA is the n×nn \times n dynamics matrix, BB maps the known input ut\mathbf{u}_t into the state, and CC is the m×nm \times n output matrix. The process noise wt\mathbf{w}_t and the measurement noise vt\mathbf{v}_t are independent Gaussians with zero mean, wt∼N(0,Q)\mathbf{w}_t \sim \mathcal{N}(\mathbf{0}, Q) and vt∼N(0,R)\mathbf{v}_t \sim \mathcal{N}(\mathbf{0}, R), where QQ and RR are covariance matrices. Noise at different time steps is independent of each other.

Gaussians stay Gaussian under linear maps

The key fact is that if x∼N(μ,Σ)\mathbf{x} \sim \mathcal{N}(\boldsymbol{\mu}, \Sigma) and z=Mx+c\mathbf{z} = M\mathbf{x} + \mathbf{c} for a fixed matrix MM and vector c\mathbf{c}, then

z∼N(Mμ+c,  MΣM⊤).\mathbf{z} \sim \mathcal{N}(M\boldsymbol{\mu} + \mathbf{c},\; M \Sigma M^\top).

The mean transforms by the map, and the covariance transforms by sandwiching it between MM and M⊤M^\top. This is the rule that moves the uncertainty forward through the dynamics. Adding independent Gaussian noise QQ adds QQ to the covariance.

The prediction step

Suppose at time tt you know the state is N(μt,Σt)\mathcal{N}(\boldsymbol{\mu}_t, \Sigma_t). Ignoring the input for the moment, the state at time t+1t+1 is

μt+1=Aμt,Σt+1=AΣtA⊤+Q.\boldsymbol{\mu}_{t+1} = A\boldsymbol{\mu}_t, \qquad \Sigma_{t+1} = A\Sigma_t A^\top + Q.

The mean follows the deterministic dynamics. The covariance is stretched by AA and then grows by the noise QQ. Repeating this rule gives the uncertainty for any horizon.

Stationary behaviour and stability

If the dynamics are stable, the uncertainty settles to a fixed point Σ∞\Sigma_\infty that satisfies

Σ∞=AΣ∞A⊤+Q.\Sigma_\infty = A \Sigma_\infty A^\top + Q.

This is a discrete Lyapunov equation. Whether the process settles depends on the eigenvalues of AA. The system is stable, in the sense that the mean decays to zero when the input is zero, when every eigenvalue λ\lambda of AA satisfies ∣λ∣<1|\lambda| \lt 1. A zero-input system with an eigenvalue at magnitude one drifts without damping, and one with an eigenvalue above one blows up. For continuous-time systems x˙=Ax\dot{\mathbf{x}} = A\mathbf{x}, the condition is instead that every eigenvalue has negative real part.

Estimating the state from outputs

Given the outputs y1,…,yt\mathbf{y}_1, \dots, \mathbf{y}_t, the best estimate of the state is its conditional distribution. For this model that distribution is Gaussian, and its mean and covariance are updated by the Kalman filter. Each new measurement corrects the prediction by an amount weighted by the Kalman gain, which balances how uncertain the prediction is against how noisy the measurement is. The derivation is a direct application of the rule for conditioning Gaussians, and it is the reason the model is so widely used.

Worked examples

Example
A scalar system that settles

Take the scalar system xt+1=0.9 xt+wtx_{t+1} = 0.9\,x_t + w_t with process noise variance Q=1Q = 1, starting from a known state x0=0x_0 = 0.

  1. The dynamics coefficient is a=0.9a = 0.9, and ∣a∣<1|a| \lt 1, so the system is stable.
  2. The variance recursion is σt+12=a2σt2+Q=0.81 σt2+1\sigma^2_{t+1} = a^2 \sigma^2_t + Q = 0.81\,\sigma^2_t + 1.
  3. Starting from σ02=0\sigma^2_0 = 0, the first few values are σ12=1\sigma^2_1 = 1, σ22=1.81\sigma^2_2 = 1.81, σ32=2.4661\sigma^2_3 = 2.4661.
  4. The fixed point satisfies σ2=0.81 σ2+1\sigma^2 = 0.81\,\sigma^2 + 1, so σ2(1−0.81)=1\sigma^2 (1 - 0.81) = 1 and σ2=1/0.19≈5.263\sigma^2 = 1 / 0.19 \approx 5.263.

Interpretation: the uncertainty about the state grows from zero and levels off near 5.26. The state keeps being pushed by fresh noise, but the decay factor 0.810.81 removes part of the old uncertainty each step, and the two effects balance.

Example
A two-dimensional prediction step, by hand

Let the state be x=(position,velocity)\mathbf{x} = (\text{position}, \text{velocity}) and let the dynamics be A=(0.90.100.8)A = \begin{pmatrix} 0.9 & 0.1 \\ 0 & 0.8 \end{pmatrix}. Start from mean μ0=(1,0)\boldsymbol{\mu}_0 = (1, 0), covariance Σ0=I\Sigma_0 = I, and process noise Q=0.01 IQ = 0.01\,I.

  1. Predict the mean: Aμ0=(0.9⋅1+0.1⋅0,  0⋅1+0.8⋅0)=(0.9,0)A\boldsymbol{\mu}_0 = (0.9 \cdot 1 + 0.1 \cdot 0,\; 0 \cdot 1 + 0.8 \cdot 0) = (0.9, 0).
  2. Compute AA⊤A A^\top. The first row of AA is (0.9,0.1)(0.9, 0.1) and the second is (0,0.8)(0, 0.8). So AA⊤=(0.92+0.120.1⋅0.80.1⋅0.80.82)=(0.820.080.080.64)AA^\top = \begin{pmatrix} 0.9^2 + 0.1^2 & 0.1 \cdot 0.8 \\ 0.1 \cdot 0.8 & 0.8^2 \end{pmatrix} = \begin{pmatrix} 0.82 & 0.08 \\ 0.08 & 0.64 \end{pmatrix}.
  3. Add the noise: Σ1=AA⊤+Q=(0.830.080.080.65)\Sigma_1 = AA^\top + Q = \begin{pmatrix} 0.83 & 0.08 \\ 0.08 & 0.65 \end{pmatrix}.
  4. Check stability. AA is upper triangular, so its eigenvalues are its diagonal entries, 0.90.9 and 0.80.8. Both have magnitude below one.

Interpretation: the mean moved from (1,0)(1, 0) to (0.9,0)(0.9, 0), so the position shrank toward zero as the dynamics predict. The variances shrank from 1 to 0.83 and 0.65, because the stable dynamics contract the state faster than the small noise QQ adds uncertainty. The off-diagonal entry of 0.080.08 shows that position and velocity uncertainties are now mildly correlated.

Example
Watching the variance approach its limit

Using the scalar system from the first example, the variance after tt steps from zero is σt2=1−0.81t0.19\sigma^2_t = \frac{1 - 0.81^t}{0.19}, which comes from summing the geometric series of the noise contributions. At t=1t = 1 this gives (1−0.81)/0.19=1(1 - 0.81) / 0.19 = 1. At t=10t = 10, 0.8110≈0.12160.81^{10} \approx 0.1216, so σ102=(1−0.1216)/0.19≈4.62\sigma^2_{10} = (1 - 0.1216) / 0.19 \approx 4.62. The curve in the plot is this function, and it approaches the limit 1/0.191/0.19 from below.

0510152025300123456time step tstate variance
  • variance after t steps
The variance of x_t when the system starts at zero and has a = 0.9 and Q = 1. It rises from 1 at t = 1 and levels off near 5.26. The marked points are the values in the example.

Tradeoffs and failure modes

The linear Gaussian model is powerful, but it is easy to apply where it does not fit.

SituationWhat goes wrongBetter choice
The true dynamics are curved, as with a pendulum at large swingsA linear model misses the state's true motionExtended or unscented Kalman filter, or a nonlinear state-space model
Noise is clearly non-Gaussian, such as occasional large outliersThe Gaussian update overreacts to outliersRobust filters, or a particle filter that represents any distribution
The model parameters AA, QQ, RR are guessedThe filter can be overconfident or lag, even though its maths is rightEstimate the noise covariances from data, or tune QQ and RR against held-out errors
The system is unstable and the filter runs open loop for longUncertainty grows without bound and estimates driftFeed back measurements every step, so the filter keeps correcting
The state is huge, such as a full imageCovariance matrices become too large to store or invertReduced-rank or ensemble methods

A common mistake is treating the Kalman filter as a smoother that always gives accurate answers. It gives the best estimate under the assumed model. If the model is wrong, the answer can look precise and still be off.

History

The state-space view of linear systems came from control engineering in the middle of the 20th century, where engineers described systems by first-order equations in a state vector rather than by transfer functions. Rudolf Kalman's 1960 paper "A New Approach to Linear Filtering and Prediction Problems" combined this view with the statistics of noise. It gave a recursive filter that estimates the state from noisy measurements, and its equations are the prediction and update steps above.

The filter caught on quickly because it could run on limited computers. Navigation work in the 1960s used it for spacecraft guidance, and it became standard in aerospace, then in radar tracking, and later in robotics and consumer devices. The model remains the default starting point for tracking problems, even as nonlinear and learned versions have grown more popular.

Check yourself

QuestionWhy does the linear Gaussian model make exact inference possible, and what property of Gaussians makes the prediction step closed form?Show answer

A linear map of a Gaussian is Gaussian, and independent Gaussian noise added to a Gaussian is again Gaussian. So if the state is Gaussian at one step, it is Gaussian after the linear dynamics and noise. Its mean and covariance are all that is needed to describe it, and they update by the closed-form rules μt+1=Aμt\boldsymbol{\mu}_{t+1} = A\boldsymbol{\mu}_t and Σt+1=AΣtA⊤+Q\Sigma_{t+1} = A\Sigma_t A^\top + Q. Nothing else has to be tracked.

QuestionFor the scalar system xt+1=0.5 xt+wtx_{t+1} = 0.5\,x_t + w_t with Q=1Q = 1, what is the stationary variance?Show answer

The stationary variance satisfies σ2=0.25 σ2+1\sigma^2 = 0.25\,\sigma^2 + 1. Then σ2(1−0.25)=1\sigma^2 (1 - 0.25) = 1, so σ2=1/0.75≈1.333\sigma^2 = 1/0.75 \approx 1.333. The stationary variance is 4/34/3.

QuestionWhy does the eigenvalue condition on A decide whether the state settles, and what happens with an eigenvalue of exactly one?Show answer

With no input, the state evolves as a repeated application of AA, so each eigen-direction is multiplied by its eigenvalue at each step. When every eigenvalue has magnitude below one, those multiplications shrink the state and the uncertainty reaches a fixed point. An eigenvalue of exactly one leaves that direction undamped: the state does not decay, and uncertainty accumulates in it without a limit set by the dynamics. Eigenvalues above one make the state grow.

QuestionA tracker models an object moving at constant velocity, so the next position is the old position plus the velocity times a time step of 1, and the velocity stays the same, so A has ones on the diagonal and a one in the position-from-velocity entry. Why would you be cautious about relying on this filter for long open-loop predictions?Show answer

That AA is upper triangular with both eigenvalues equal to one, so neither direction is damped. Without measurements to correct them, the position and velocity uncertainties keep growing with every process noise term, and the estimate drifts. The fix is to keep feeding measurements into the filter so its update step pulls the estimate back, rather than predicting open loop for long stretches.

Sources