Kalman Filter

state-spacekalman-filterfilteringsmoothinglinear-gaussiantime-varying-parameterunobserved-componentsmaximum-likelihood

Definition

The Kalman filter is a recursive algorithm that computes the minimum mean squared error (MMSE) linear estimator of the latent state vector αt\boldsymbol{\alpha}_t in a linear Gaussian state-space model, given all observations up to time tt. At each step it alternates between a prediction step (propagating the state one period forward via the transition equation) and an update step (revising the prediction using the new observation and the Kalman gain). Under Gaussianity the filtered estimates equal the conditional means, and the filter delivers the exact log-likelihood as a by-product via the innovation decomposition.

Key Ideas

How It Works

State-Space Form

yt=Ztαt+εt,εtN(0,Ht)(measurement)\mathbf{y}_t = \mathbf{Z}_t \boldsymbol{\alpha}_t + \boldsymbol{\varepsilon}_t, \qquad \boldsymbol{\varepsilon}_t \sim \mathcal{N}(\mathbf{0}, \mathbf{H}_t) \tag{measurement}

αt=Ttαt1+Rtηt,ηtN(0,Qt)(transition)\boldsymbol{\alpha}_t = \mathbf{T}_t \boldsymbol{\alpha}_{t-1} + \mathbf{R}_t \boldsymbol{\eta}_t, \qquad \boldsymbol{\eta}_t \sim \mathcal{N}(\mathbf{0}, \mathbf{Q}_t) \tag{transition}

where yt\mathbf{y}_t is p×1p \times 1 observed, αt\boldsymbol{\alpha}_t is m×1m \times 1 latent, and (εt,ηt)(\boldsymbol{\varepsilon}_t, \boldsymbol{\eta}_t) are mutually uncorrelated at all leads and lags.

Prediction Step

att1=Ttat1t1,Ptt1=TtPt1t1Tt+RtQtRt\mathbf{a}_{t|t-1} = \mathbf{T}_t \mathbf{a}_{t-1|t-1}, \qquad \mathbf{P}_{t|t-1} = \mathbf{T}_t \mathbf{P}_{t-1|t-1} \mathbf{T}_t' + \mathbf{R}_t \mathbf{Q}_t \mathbf{R}_t'

Update Step

vt=ytZtatt1,Ft=ZtPtt1Zt+Ht\mathbf{v}_t = \mathbf{y}_t - \mathbf{Z}_t \mathbf{a}_{t|t-1}, \qquad \mathbf{F}_t = \mathbf{Z}_t \mathbf{P}_{t|t-1} \mathbf{Z}_t' + \mathbf{H}_t

Kt=Ptt1ZtFt1\mathbf{K}_t = \mathbf{P}_{t|t-1} \mathbf{Z}_t' \mathbf{F}_t^{-1}

att=att1+Ktvt,Ptt=(IKtZt)Ptt1\mathbf{a}_{t|t} = \mathbf{a}_{t|t-1} + \mathbf{K}_t \mathbf{v}_t, \qquad \mathbf{P}_{t|t} = (\mathbf{I} - \mathbf{K}_t \mathbf{Z}_t) \mathbf{P}_{t|t-1}

Kalman Smoother (Rauch-Tung-Striebel)

Run the filter forward; then pass backward for t=T1,,1t = T-1, \ldots, 1:

Lt=PttTt+1Pt+1t1\mathbf{L}_t = \mathbf{P}_{t|t} \mathbf{T}_{t+1}' \mathbf{P}_{t+1|t}^{-1}

atT=att+Lt(at+1Tat+1t),PtT=Ptt+Lt(Pt+1TPt+1t)Lt\mathbf{a}_{t|T} = \mathbf{a}_{t|t} + \mathbf{L}_t (\mathbf{a}_{t+1|T} - \mathbf{a}_{t+1|t}), \qquad \mathbf{P}_{t|T} = \mathbf{P}_{t|t} + \mathbf{L}_t (\mathbf{P}_{t+1|T} - \mathbf{P}_{t+1|t}) \mathbf{L}_t'

Log-Likelihood for MLE

(θ)=Tp2log(2π)12t=1T(logFt+vtFt1vt)\ell(\theta) = -\frac{Tp}{2}\log(2\pi) - \frac{1}{2}\sum_{t=1}^T \left(\log|\mathbf{F}_t| + \mathbf{v}_t'\mathbf{F}_t^{-1}\mathbf{v}_t\right)

Maximised over model parameters θ\theta via quasi-Newton methods (e.g., Broyden-Fletcher-Goldfarb-Shanno (BFGS)).

Why It Matters

Open Questions

Related