State-Space Models and the Kalman Filter
00 · Symbol Glossary
The latent Markov state at date . What you care about but do not observe directly: a local level, a time-varying beta, an ARMA companion vector.
and , the Kalman prediction. After the observation arrives they become the updated , .
is the one-step prediction error of the observation; . The Gaussian likelihood is built from .
. How much to move the predicted state toward the new observation. Small (precise data) or large (uncertain state) means a large gain.
moves the state forward, maps state to observation, is state noise, is observation noise. Many texts call the transition matrix ; this library reserves for the sample length, as in every other chapter.
01 · Why State Space
ARMA, GARCH, and VARs write the observable as a finite lag of itself. Many finance objects are latent: a slowly moving mean, a time-varying regression coefficient, a factor that several yields load on. A state-space model splits the problem in two: a Markov equation for the hidden state, and an observation equation that sees a linear image of that state plus noise.
Every causal ARMA has a state-space form (companion state). The converse is broader: the observation matrix can be time-varying (a regressor ), and the state can be a random walk. The Kalman filter is the recursive MMSE estimator of given data through , when the system is linear and the noises are uncorrelated through time. Under Gaussian noises it is also the conditional mean, and it delivers the Gaussian likelihood as a byproduct.
02 · The Linear Gaussian System
with , , and , uncorrelated with each other and with . Here may be a vector; the scalar case is the one to compute by hand. Time-varying , , are allowed — the filter formulas below still hold with subscripts.
Two conventions circulate and they are not interchangeable. Here the state is dated contemporaneously: is driven by , and observes that same (Harvey’s form). Durbin and Koopman instead write , so their state equation looks one period ahead and their “predicted state” is indexed differently. The filters agree on the same model; the subscripts do not. When you copy a recursion out of a book, copy its timing convention with it, or the prediction step will be off by one period.
So , , , . The series is plus measurement noise — a useful model for a slowly moving mean (or a noisy integrated price). Signal-to-noise is : large makes the extracted level jumpy; recovers a constant mean.
Now (the observable factor or market return). The Kalman filter tracks without a rolling-window OLS. This is the workhorse “dynamic CAPM / rolling beta” story, stated as a model rather than as an ad hoc window.
An AR is already in state-space form with , , (perfect observation of the state). An ARMA uses a companion state of dimension that stacks the current value and its lags so the observation equation picks off the first component; then means the observed series is a noiseless linear readout of that state while the MA part lives in the state noise matrix .
03 · Predict and Update
Initialize with a prior (diffuse if you are agnostic). Then for :
The gain is large when the state is uncertain relative to the observation noise. If and is invertible, the update pins to the observation. If and , the filter is essentially recursive least squares on a constant state.
The update is often written . That is the same line: substituting gives , so the two forms agree.
Under Gaussian noises, the log-likelihood (up to a constant, for scalar ) is
where here is the sample length. Maximum likelihood of is then numerical optimization wrapped around the filter. That is why software estimates a local-level or a time-varying-parameter regression by “running Kalman.”
The filter uses data through . Smoothing runs a backward pass to get — the right object for a historical extracted trend. The formulas (RTS / Durbin–Koopman disturbance smoothing) are a sequel. Use a smoother for ex-post charts; use the filter for real-time tracking and for the likelihood.
A plotted is an MMSE estimate under this , , and linear Gaussian model.
Why it breaks: if jumps, or is heavy-tailed, or is misspecified, is a compromise, not an oracle. in particular is weakly identified in short samples and controls how much the path wiggles.
Consequence: report (or a signal-to-noise ratio), show bands, and do not confuse a smooth extracted path with a discovered law of motion.
04 · What We Skip
Information-form and square-root Kalman filters (numerical stability when is ill-conditioned). Nonlinear filters (EKF, unscented, particle) for models that are not linear in — including stochastic volatility with as state and a nonlinear observation. Those need a stronger computational / filtering course. The linear Gaussian filter above is the one that sits under ARMA likelihoods, local-level trends, and time-varying betas.
05 · Exercises
Match to the local-level equations.
, , , , , . The prediction is , .
Write for the local-level model , . What is in terms of and ?
with and .
. If , : trust the observation completely. If , : trust the predicted state; the observation is ignored.
In the scalar local-level filter, simplify . What happens as ? As ?
The likelihood is a product of densities of the innovations .
Yes — that is the prediction-error decomposition. Once are computed by the filter, Gaussian MLE is a numerical maximization of . No batch Kalman matrix of size is required.
True or false: the Kalman filter computes the Gaussian likelihood of a linear state-space model as it runs. Why does that matter for estimating and ?
06 · Chapter Summary
| Object | Role |
|---|---|
| State | latent Markov factor, |
| Observation | |
| Predict / update | MMSE recursion for , |
| Gain | trust data vs trust the model |
| innovations; Gaussian log-likelihood | |
| Smoothing | , for historical extraction |
This is the last Time Series chapter. The ten-chapter arc is: discrete time and white noise stationarity ARMA unit roots forecasting GARCH VAR cointegration spectra state space. What was left out (long memory, Markov-switching, full Johansen derivations, particle filters) is a sequel, not a hole in the core.