Module 3 — Linear Prediction and State-Space Recursions

Derive best linear predictors from partitioned covariance matrices, quantify error with Schur complements, and introduce Kalman recursions.

Module 3 — Linear Prediction and State-Space Recursions

Core question

Given a covariance structure and a vector of observations, which linear combination predicts an unobserved value with minimum mean-squared error?

Learning outcomes

You will be able to:

  • derive the normal equations for a best linear predictor;
  • compute prediction-error variance from a Schur complement;
  • explain when a linear predictor equals a conditional expectation;
  • obtain multi-step AR predictions from powers of a companion matrix;
  • derive the Kalman prediction and correction equations;
  • distinguish filtering, prediction, and smoothing.

1. Prediction is a projection problem

Let YY be a centred target and let

X=(X1,,Xm),Γ=Var(X),g=Cov(X,Y).\mathbf X=(X_1,\ldots,X_m)^\top,\qquad \Gamma=\operatorname{Var}(\mathbf X),\qquad \mathbf g=\operatorname{Cov}(\mathbf X,Y).

For a linear predictor Y^=aX\widehat Y=\mathbf a^\top\mathbf X,

E[(YaX)2]=Var(Y)2ag+aΓa.E[(Y-\mathbf a^\top\mathbf X)^2] =\operatorname{Var}(Y)-2\mathbf a^\top\mathbf g+\mathbf a^\top\Gamma\mathbf a.

Differentiation gives the normal equations

Γa=g.\boxed{\Gamma\mathbf a=\mathbf g}.

When Γ\Gamma is positive definite,

a=Γ1g,MSPE=Var(Y)gΓ1g.\mathbf a=\Gamma^{-1}\mathbf g,\qquad \operatorname{MSPE}=\operatorname{Var}(Y)-\mathbf g^\top\Gamma^{-1}\mathbf g.

In computation, use solve(Gamma, g). The inverse notation explains the mathematics; explicitly forming an inverse is usually unnecessary.

2. Orthogonality is the defining check

At the optimum,

Cov(X,YY^)=gΓa=0.\operatorname{Cov}(\mathbf X,Y-\widehat Y) =\mathbf g-\Gamma\mathbf a=\mathbf 0.

The error is therefore orthogonal to every predictor. This statement needs finite second moments, not Gaussianity.

If (Y,X)(Y,\mathbf X^\top)^\top is jointly Gaussian, the conditional mean is linear:

E(YX)=gΓ1X.E(Y\mid\mathbf X)=\mathbf g^\top\Gamma^{-1}\mathbf X.

Without joint Gaussianity, this remains the best linear predictor but need not be the best among all nonlinear functions.

3. Worked AR(1) projection

For a stationary AR(1) with variance γ(0)\gamma(0) and correlation ρ(h)=ϕh\rho(h)=\phi^{|h|}, predict Xt+1X_{t+1} from

X=(Xt1,Xt).\mathbf X=(X_{t-1},X_t)^\top.

Then

Γ=γ(0)[1ϕϕ1],g=γ(0)[ϕ2ϕ].\Gamma=\gamma(0) \begin{bmatrix} 1&\phi\\ \phi&1 \end{bmatrix}, \qquad \mathbf g=\gamma(0) \begin{bmatrix} \phi^2\\ \phi \end{bmatrix}.

Solving gives a=(0,ϕ)\mathbf a=(0,\phi)^\top. Once XtX_t is known, Xt1X_{t-1} receives zero extra weight. The matrix calculation recovers the Markov property rather than assuming it.

The error variance is

γ(0)gΓ1g=γ(0)(1ϕ2)=σε2.\gamma(0)-\mathbf g^\top\Gamma^{-1}\mathbf g =\gamma(0)(1-\phi^2)=\sigma_\varepsilon^2.

4. Partitioned covariance and the Schur complement

The joint covariance is

Var(XY)=[ΓggγY].\operatorname{Var} \begin{pmatrix} \mathbf X\\Y \end{pmatrix} = \begin{bmatrix} \Gamma&\mathbf g\\ \mathbf g^\top&\gamma_Y \end{bmatrix}.

Conditioning removes the part of YY explained linearly by X\mathbf X. The remaining variance,

γYgΓ1g,\gamma_Y-\mathbf g^\top\Gamma^{-1}\mathbf g,

is the Schur complement of Γ\Gamma. It is non-negative because the joint covariance matrix is positive semidefinite.

R: solve the projection and verify orthogonality

The following cell uses an AR(2). Because the true process uses only two lags, the coefficient on Xt2X_{t-2} should be numerically zero when predicting from (Xt,Xt1,Xt2)(X_t,X_{t-1},X_{t-2})^\top.

R

Best linear prediction from an AR(2) covariance matrix

Idle

The first two weights reproduce (ϕ1,ϕ2)(\phi_1,\phi_2) and the third is zero up to rounding. The MSPE reproduces the innovation variance.

5. Multi-step prediction uses matrix powers

Write an AR(pp) in state form:

st=[XtXt1Xtp+1],st=Fst1+Gεt.\mathbf s_t= \begin{bmatrix} X_t\\X_{t-1}\\ \vdots\\X_{t-p+1} \end{bmatrix}, \qquad \mathbf s_t=F\mathbf s_{t-1}+G\varepsilon_t.

With e1=(1,0,,0)\mathbf e_1=(1,0,\ldots,0)^\top,

X^t+ht=e1Fhst.\widehat X_{t+h\mid t}=\mathbf e_1^\top F^h\mathbf s_t.

If Var(εt)=σ2\operatorname{Var}(\varepsilon_t)=\sigma^2 and Q=σ2GGQ=\sigma^2GG^\top, then

Var(st+hs^t+ht)=j=0h1FjQ(F)j.\operatorname{Var}(\mathbf s_{t+h}-\widehat{\mathbf s}_{t+h\mid t}) =\sum_{j=0}^{h-1}F^jQ(F^\top)^j.

The point prediction propagates the state; the uncertainty accumulates every future innovation.

6. Innovations reveal information one observation at a time

Suppose X^tt1\widehat X_{t\mid t-1} is the projection on the past. Define the innovation

vt=XtX^tt1,Ft=Var(vt).v_t=X_t-\widehat X_{t\mid t-1}, \qquad F_t=\operatorname{Var}(v_t).

Innovations are mutually orthogonal. For Gaussian processes they are independent. A joint Gaussian likelihood can therefore be written as a sum of one-step terms:

=12t=1n[log(2π)+logFt+vt2Ft].\ell=-\frac12\sum_{t=1}^n \left[\log(2\pi)+\log F_t+\frac{v_t^2}{F_t}\right].

This is the sequential counterpart of the covariance-matrix likelihood in Module 4.

7. State space avoids a growing covariance inverse

Use the linear Gaussian model

αt=Tαt1+Rηt,Yt=Zαt+εt,\boldsymbol\alpha_t=T\boldsymbol\alpha_{t-1}+R\boldsymbol\eta_t, \qquad Y_t=Z\boldsymbol\alpha_t+\varepsilon_t,

with

Var(ηt)=Q,Var(εt)=H.\operatorname{Var}(\boldsymbol\eta_t)=Q,\qquad \operatorname{Var}(\varepsilon_t)=H.

If (at1,Pt1)(\mathbf a_{t-1},P_{t-1}) summarises the filtered state, prediction is

att1=Tat1,Ptt1=TPt1T+RQR.\mathbf a_{t\mid t-1}=T\mathbf a_{t-1},\qquad P_{t\mid t-1}=TP_{t-1}T^\top+RQR^\top.

The observation innovation and its covariance are

vt=YtZatt1,Ft=ZPtt1Z+H.\mathbf v_t=Y_t-Z\mathbf a_{t\mid t-1},\qquad F_t=ZP_{t\mid t-1}Z^\top+H.

Correction is

Kt=Ptt1ZFt1,K_t=P_{t\mid t-1}Z^\top F_t^{-1},at=att1+Ktvt,Pt=Ptt1KtFtKt.\mathbf a_t=\mathbf a_{t\mid t-1}+K_t\mathbf v_t,\qquad P_t=P_{t\mid t-1}-K_tF_tK_t^\top.
TaskInformation used
predictionobservations through t1t-1
filteringobservations through tt
smoothingthe complete sample, including observations after tt

When YtY_t is missing, keep the prediction and skip correction. No ad hoc imputation is required.

Practice

  1. For AR(1) with ϕ=0.6\phi=0.6 and γ(0)=4\gamma(0)=4, construct Γ\Gamma and g\mathbf g above and solve for a\mathbf a.
  2. Show that adding a predictor cannot increase the minimum MSPE.
  3. For an AR(2), write FF, GG, and QQ explicitly.
  4. Explain why the innovations likelihood and joint covariance likelihood agree for a Gaussian model.
  5. In a local-level model, what happens to Ptt1P_{t\mid t-1} during several consecutive missing observations?
Answers
  1. Γ=4[10.60.61]\Gamma=4\begin{bmatrix}1&0.6\\0.6&1\end{bmatrix}, g=4(0.36,0.6)\mathbf g=4(0.36,0.6)^\top, and a=(0,0.6)\mathbf a=(0,0.6)^\top.
  2. The old predictor remains available in the larger span, so minimisation over the larger set cannot be worse.
  3. The first row of FF is (ϕ1,ϕ2)(\phi_1,\phi_2), the second is (1,0)(1,0), G=(1,0)G=(1,0)^\top, and Q=σ2GGQ=\sigma^2GG^\top.
  4. Orthogonal sequential innovations factor the same multivariate normal density into conditional normal densities.
  5. Prediction uncertainty accumulates process noise because no measurement correction reduces it.

Takeaway

Linear prediction is a covariance problem: solve normal equations, verify orthogonality, and read uncertainty from a Schur complement. State-space recursions perform the same conditioning sequentially. Continue to Estimation and Inference.

Copyright © 2026