advanced 65 min read · October 27, 2026

State-Space Models & Kalman Smoothing

Track 9's two halves turn out to be one object. Every ARMA model is a linear-Gaussian state-space model, and the Kalman filter's innovations are Wold's. Seven full proofs, featuring the Rauch–Tung–Striebel smoother. The exact likelihood is a product of innovation densities, computed in O(n), and missing data and forecasting cost nothing. Structural models become a modeling language, and EM's M-step is regression on smoothed moments. The steady-state Riccati equation explains why the gain settles. The Nile, Mauna Loa CO2 and Yule's sunspots are the data; O(n) Gaussian-process regression, recursive least squares, FFBS and S4 are the ML payoff. Track 9 closes here.

36.1 Motivation: one river, two views

One hundred years of annual Nile flow at Aswan, 1871–1970, in 108 m310^8\,\mathrm{m}^3 (COB1978), is the running example of Durbin and Koopman’s book (DUR2012), and it will be ours. The readings jump around, but something slower lies underneath: the level drops visibly around 1898, when work on the Aswan Low Dam began. Ask the question an ML practitioner would ask of any sensor log. What was the true level in 1913, given the noisy readings before and after it? The later readings carry information about 1913 because the level moves slowly. Using them is smoothing, the title half of this topic.

Topic 34 read a series like this as a hidden state seen through noise; Topic 35 read it through its autocovariance and its prediction errors. The Nile can be read both ways, and the readings agree. This topic explains why.

Example 1 The Nile as a local level

Model the unobserved level μt\mu_t as a random walk and each reading as the level plus noise:

μt=μt−1+Wt,Xt=μt+Vt,Wt∼N(0,q),Vt∼N(0,r),\mu_t = \mu_{t-1} + W_t, \qquad X_t = \mu_t + V_t, \qquad W_t \sim \mathcal{N}(0, q), \quad V_t \sim \mathcal{N}(0, r),

with all noise terms independent: a Gaussian random walk ( formalML: random-walks ) seen through measurement error. Here qq is the variance of the level’s yearly step and rr that of the measurement error (Durbin and Koopman’s ση2\sigma^2_\eta and σε2\sigma^2_\varepsilon). The maximum-likelihood estimates (§36.8) are q^=1463.5474\hat q = 1463.5474 and r^=15108.3145\hat r = 15108.3145, so q^/r^=0.096870\hat q/\hat r = 0.096870, with diffuse log-likelihood ℓ^=−632.537686\hat\ell = -632.537686 (Definition 5). Theorem 5 gives the distribution of each μt\mu_t given all 100 readings; its mean falls from 1038.36 in 1897 to 951.00 in 1899 (Figure 1, left).

Example 2 The same model, read as an ARIMA

Difference the observations: ΔXt=Xt−Xt−1=Wt+Vt−Vt−1\Delta X_t = X_t - X_{t-1} = W_t + V_t - V_{t-1}, which is stationary, with autocovariances

Var(ΔXt)=q+2r,Cov(ΔXt,ΔXt−1)=−r,Cov(ΔXt,ΔXt−h)=0(h≥2).\mathrm{Var}(\Delta X_t) = q + 2r, \qquad \mathrm{Cov}(\Delta X_t, \Delta X_{t-1}) = -r, \qquad \mathrm{Cov}(\Delta X_t, \Delta X_{t-h}) = 0 \quad (h \ge 2).

An autocovariance that cuts off after lag 1 is the signature of an MA(1) (Topic 35 §35.5), with ρ(1)=−r/(q+2r)\rho(1) = -r/(q + 2r). So the hidden-level model is, from the observation-driven side, an ARIMA(0,1,1). At the MLE, ρ(1)=−0.476901\rho(1) = -0.476901; the sample lag-1 autocorrelation of the 99 differences is −0.402043-0.402043, far outside the white-noise band ±0.197\pm 0.197. The MA coefficient is θ=K∞−1=−0.733449\theta = K_\infty - 1 = -0.733449, where K∞=0.266551K_\infty = 0.266551 is the steady-state Kalman gain (§36.9, Example 15); as a check, θ/(1+θ2)=−0.476901\theta/(1 + \theta^2) = -0.476901.

Left: annual Nile flows from 1871 to 1970 with a teal smoothed level and band that drops after 1898. Right: sample autocorrelations of the differenced flows, with an indigo diamond at lag 1 for the local-level model value.

Figure 1. One series, two readings. As a hidden random-walk level seen through noise, the Nile drops after 1898; as an observation-driven model, its differences are an MA(1) with θ = K∞ − 1.

Remark 1 Notation

We write E\mathbb{E}, Var\mathrm{Var} and Cov\mathrm{Cov} for expectation, variance and covariance, and N(x;μ,Σ)\mathcal{N}(x; \mu, \Sigma) for the Normal density with mean μ\mu and covariance Σ\Sigma at xx (not Topic 34’s φ\varphi: ϕ\phi is Topic 35’s AR coefficient). Bold letters stack over time. TT is a state-space sample length and nn an ARMA series length; they coincide in §36.4. Clashes are settled where they arise: the Kalman innovation ete_t versus Wold’s εt\varepsilon_t, the innovation variance StS_t versus Topic 35’s vt−1v_{t-1} (equal, by Theorem 3), the covariance PtP_t versus Topic 35’s projection PnP_n (here Πn\Pi_n), and ϑ\vartheta for the parameter vector, because θ\theta is the MA coefficient.

Remark 2 Two views, one object: the thesis of Track 9

Section 36.4 proves that the hidden-state and autocovariance descriptions coincide for every ARMA model, and §36.3 shows that the Kalman filter computes Topic 35’s prediction errors exactly and fast. Then every tool works on both: the smoother answers the 1913 question (§36.6), the exact likelihood costs O(n)O(n) (§36.3), missing data and forecasts are free (§36.5), and EM learns the parameters (§36.8).

36.2 The linear-Gaussian model, revisited

We work with the linear-Gaussian state-space model of Topic 34 §34.9 (Definition 8 there): a hidden state Zt∈RkZ_t \in \mathbb{R}^k and an observation Xt∈RdX_t \in \mathbb{R}^d with

Zt=FZt−1+Wt,Xt=HZt+Vt,Wt∼N(0,Q),Vt∼N(0,R),Z1∼N(m1,P1),Z_t = FZ_{t-1} + W_t, \qquad X_t = HZ_t + V_t, \qquad W_t \sim \mathcal{N}(0, Q), \quad V_t \sim \mathcal{N}(0, R), \quad Z_1 \sim \mathcal{N}(m_1, P_1),

all mutually independent; xtx_t is the observed value. Topic 34’s Theorem 12 (the Kalman filter) gives Gaussian predicted moments mt−,Pt−m^-_t, P^-_t given x1:t−1x_{1:t-1} and filtered moments mt,Ptm_t, P_t given x1:tx_{1:t}. From m1−=m1m^-_1 = m_1 and P1−=P1P^-_1 = P_1:

mt−=Fmt−1,Pt−=FPt−1F⊤+Q,m^-_t = Fm_{t-1}, \qquad P^-_t = FP_{t-1}F^\top + Q, et=xt−Hmt−,St=HPt−H⊤+R,Kt=Pt−H⊤St−1,mt=mt−+Ktet,Pt=Pt−−KtStKt⊤.e_t = x_t - Hm^-_t, \qquad S_t = HP^-_tH^\top + R, \qquad K_t = P^-_tH^\top S_t^{-1}, \qquad m_t = m^-_t + K_te_t, \qquad P_t = P^-_t - K_tS_tK_t^\top .

Here ete_t is the innovation, StS_t its covariance and KtK_t the gain; we cite the filter rather than re-prove it. Keep a geometric picture in mind: a Gaussian belief about a two-dimensional state is an ellipse, a level set of its density. Each step the dynamics carry it forward, the noise QQ fattens it, and the observation cuts it down.

Definition 1 Predictive, filtering, smoothing and forecast distributions

For data x1:Tx_{1:T} and the state ZtZ_t:

  • the predictive distribution is p(zt∣x1:t−1)=N(mt−,Pt−)p(z_t \mid x_{1:t-1}) = \mathcal{N}(m^-_t, P^-_t);
  • the filtering distribution is p(zt∣x1:t)=N(mt,Pt)p(z_t \mid x_{1:t}) = \mathcal{N}(m_t, P_t);
  • the smoothing distribution is p(zt∣x1:T)=N(mts,Pts)p(z_t \mid x_{1:T}) = \mathcal{N}(m^s_t, P^s_t), for t≤Tt \le T;
  • the hh-step forecast distribution is p(zT+h∣x1:T)p(z_{T+h} \mid x_{1:T}), for h≥1h \ge 1.

Filtering is what we believe now; smoothing is what we believe in hindsight. Gaussianity of the last two is Theorems 4–5.

Example 3 Tracking: one predict/update cycle as ellipses

A constant-velocity tracker with state (position, velocity) observes position, with step Δ=1\Delta = 1:

F=(1101),Q=0.3(1/31/21/21),H=(10),r=0.4.F = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}, \qquad Q = 0.3\begin{pmatrix} 1/3 & 1/2 \\ 1/2 & 1 \end{pmatrix}, \qquad H = \begin{pmatrix} 1 & 0 \end{pmatrix}, \qquad r = 0.4 .

Start from mt−1=(0,1)⊤m_{t-1} = (0, 1)^\top and Pt−1=(0.60.20.20.4)P_{t-1} = \begin{pmatrix} 0.6 & 0.2 \\ 0.2 & 0.4 \end{pmatrix}.

  • Predict. FF shears the ellipse (position picks up velocity), then QQ inflates it: mt−=(1,1)⊤m^-_t = (1, 1)^\top and Pt−=(1.50.750.750.7)P^-_t = \begin{pmatrix} 1.5 & 0.75 \\ 0.75 & 0.7 \end{pmatrix}.
  • Update. We observe position xt=1.8x_t = 1.8. Then St=1.9S_t = 1.9, Kt=(0.789474,0.394737)⊤K_t = (0.789474, 0.394737)^\top, mt=(1.631579,1.315789)⊤m_t = (1.631579, 1.315789)^\top, and Pt=(0.3157890.1578950.1578950.403947)P_t = \begin{pmatrix} 0.315789 & 0.157895 \\ 0.157895 & 0.403947 \end{pmatrix}.
  • Area (∝det⁡P\propto \sqrt{\det P}): 0.4472 → 0.6982 → 0.3204. Correlation: 0.408 → 0.732 → 0.442.

We observe only position, yet velocity’s variance shrinks too, from 0.7 to 0.404: the predict step correlated the coordinates, and the update slices the ellipse along the direction the observation sees, pulling the correlated direction along.

Three position-velocity panels: the previous filtered ellipse; the sheared and then inflated predicted ellipses in violet; and the smaller indigo updated ellipse inside an amber strip for the position observation.

Figure 2. One Kalman step as geometry. The dynamics shear the belief and the noise inflates it; the observation slices it along the direction it sees, and the correlated direction shrinks too.

Step through the cycle, then switch Observe to velocity: the slice turns, and the position uncertainty grows without bound (§36.9).

Observe:Data:
(F, H) observable
t = 0 · prior (m₁, P₁)√det: — → — → —P⁻_t = —corr: — → — → —S_t = —K_t = —P_t = —K∞ = [0.7317; 0.4486]
Example 4 Recursive least squares is a Kalman filter

Take a regression yt=xt⊤β+Vty_t = \mathbf{x}_t^\top\beta + V_t, Vt∼N(0,r)V_t \sim \mathcal{N}(0, r), with examples arriving one at a time. Make the coefficients a state that never moves (F=IF = I, Q=0Q = 0), with time-varying observation row Ht=xt⊤H_t = \mathbf{x}_t^\top (Remark 5) and prior Z1∼N(0,κI)Z_1 \sim \mathcal{N}(0, \kappa I).

The filter mean after tt observations is the Bayesian linear regression posterior mean (Topic 25 §25.9), which is ridge regression with penalty r/κr/\kappa; as κ→∞\kappa \to \infty it becomes ordinary least squares (Topic 21 §21.4). With n=200n = 200 examples, three coefficients, r=0.25r = 0.25 and κ=108\kappa = 10^8, the final filter mean differs from β^OLS\hat\beta_{\text{OLS}} by at most 1.5×10−101.5 \times 10^{-10}, and PT/rP_T/r matches (X⊤X)−1(X^\top X)^{-1} to 3.1×10−123.1 \times 10^{-12}.

This is recursive least squares: online learning with exact uncertainty in O(p2)O(p^2) per example for pp coefficients, and no refit. Setting Q≠0Q \ne 0 lets the coefficients drift, the Kalman answer to concept drift.

Remark 3 What Topic 34 proved, and what is new here

Topic 34 delivered the filter and the predictive likelihood terms; the rest is new. The smoother of §36.6 is the continuous-state twin of §34.5’s forward–backward, and §36.8’s EM is the twin of §34.7’s Baum–Welch.

Remark 4 Numerical form of the covariance update

The proofs use Pt=Pt−−KtStKt⊤P_t = P^-_t - K_tS_tK_t^\top. Code should use the Joseph form (JOS1968),

Pt=(I−KtH)Pt−(I−KtH)⊤+KtRKt⊤.P_t = (I - K_tH)P^-_t(I - K_tH)^\top + K_tRK_t^\top .

The two are algebraically identical (agreement 4.5×10−114.5 \times 10^{-11} on the Nile), but the Joseph form is a sum of positive-semidefinite terms, so rounding cannot destroy that property. Square-root filters propagate a Cholesky factor of PtP_t; information filters propagate Pt−1P_t^{-1}, which suits vague priors; UD filters factor Pt=UDU⊤P_t = UDU^\top (SAR2013, AND1979).

Remark 5 Time-varying systems

Every result below holds verbatim with Ft,Ht,Qt,RtF_t, H_t, Q_t, R_t in place of F,H,Q,RF, H, Q, R, since only §36.9 uses time invariance. Examples 4 and 16 need this.

36.3 Innovations and the exact likelihood

Gram–Schmidt takes vectors in order and keeps from each only the part orthogonal to everything before it. Run it on X1,X2,…X_1, X_2, \dots in time order, with covariance as the inner product ( formalCalculus: hilbert-spaces ): the new part of XtX_t is the innovation, Topic 35’s one-step prediction error (§35.3 Def 5), which Durbin–Levinson computes in O(n2)O(n^2). Orthogonal Gaussian pieces are independent, so the likelihood factors over innovations, which the filter computes in O(T)O(T).

Theorem 1 Prediction-error decomposition

Let et=xt−Hmt−e_t = x_t - Hm^-_t and StS_t be the Kalman innovations and innovation covariances, with every xtx_t observed. Stack x=(x1,…,xT)\mathbf{x} = (x_1, \dots, x_T) and let μX=E[X]\boldsymbol\mu_X = \mathbb{E}[\mathbf{X}] and ΣX=Cov(X)\Sigma_X = \mathrm{Cov}(\mathbf{X}). Then:

(i) The innovations e1,…,eTe_1, \dots, e_T are independent, with et∼N(0,St)e_t \sim \mathcal{N}(0, S_t).

(ii) There is a unit lower block-triangular matrix LL (identity d×dd \times d blocks on the diagonal) with x−μX=Le\mathbf{x} - \boldsymbol\mu_X = L\mathbf{e}. Hence ΣX=LDL⊤\Sigma_X = LDL^\top with D=diag(S1,…,ST)D = \mathrm{diag}(S_1, \dots, S_T).

(iii) The log-likelihood is

log⁡p(x1:T)=−12∑t=1T[dlog⁡2π+log⁡det⁡St+et⊤St−1et],\log p(x_{1:T}) = -\frac12\sum_{t=1}^{T}\Bigl[d\log 2\pi + \log\det S_t + e_t^\top S_t^{-1}e_t\Bigr],

and the filter evaluates it in O(T(k3+d3))O\bigl(T(k^3 + d^3)\bigr) operations.

Proof 1 Proof of Thm 1 (Prediction-error decomposition) [show]

Step 1: the innovations are a triangular affine function of the data. In Topic 34’s Theorem 12 the matrices Pt−P^-_t, StS_t, KtK_t, PtP_t are computed from F,H,Q,R,P1F, H, Q, R, P_1 alone, never from the data. The means obey mt=mt−+Kt(xt−Hmt−)m_t = m^-_t + K_t(x_t - Hm^-_t) and mt+1−=Fmtm^-_{t+1} = Fm_t, each an affine map of the previous mean and of xtx_t. By induction on tt, mt−m^-_t is an affine function of x1:t−1x_{1:t-1}:

mt−=ct+∑s<tBtsxs,m^-_t = c_t + \sum_{s<t}B_{ts}x_s ,

for fixed vectors ctc_t and matrices BtsB_{ts}. Therefore

et=xt−Hct−∑s<tHBts xs.e_t = x_t - Hc_t - \sum_{s<t}HB_{ts}\,x_s .

Stacking over tt, e=Ax−c\mathbf{e} = A\mathbf{x} - \mathbf{c}, where AA has identity blocks on its diagonal and zeros above it. Such a matrix is invertible with det⁡A=1\det A = 1, and its inverse L=A−1L = A^{-1} has the same form. Taking expectations, Step 2’s E[et]=0\mathbb{E}[e_t] = 0 gives c=AμX\mathbf{c} = A\boldsymbol\mu_X, so e=A(x−μX)\mathbf{e} = A(\mathbf{x} - \boldsymbol\mu_X) and x−μX=Le\mathbf{x} - \boldsymbol\mu_X = L\mathbf{e}.

Step 2: independence. Theorem 12 says that given X1:t−1=x1:t−1X_{1:t-1} = x_{1:t-1}, Xt∼N(Hmt−,St)X_t \sim \mathcal{N}(Hm^-_t, S_t). Subtracting the conditional mean,

et∣x1:t−1∼N(0,St).e_t \mid x_{1:t-1} \sim \mathcal{N}(0, S_t).

This conditional law does not depend on x1:t−1x_{1:t-1}, so ete_t is independent of X1:t−1X_{1:t-1}, and in particular E[et]=0\mathbb{E}[e_t] = 0. By Step 1, (e1,…,et−1)(e_1, \dots, e_{t-1}) is an invertible function of X1:t−1X_{1:t-1}, so conditioning on one is conditioning on the other. The chain rule then gives

p(e1,…,eT)=∏t=1Tp(et∣e1:t−1)=∏t=1TN(et;0,St),p(e_1, \dots, e_T) = \prod_{t=1}^T p(e_t \mid e_{1:t-1}) = \prod_{t=1}^T \mathcal{N}(e_t; 0, S_t),

which is (i): e∼N(0,D)\mathbf{e} \sim \mathcal{N}(0, D).

Step 3: factorization. From X−μX=Le\mathbf{X} - \boldsymbol\mu_X = L\mathbf{e} and the covariance rule for linear maps (Topic 8 §8.3), ΣX=LDL⊤\Sigma_X = LDL^\top, which is (ii). Since det⁡L=1\det L = 1,

det⁡ΣX=det⁡L det⁡D det⁡L⊤=∏t=1Tdet⁡St.\det\Sigma_X = \det L\,\det D\,\det L^\top = \prod_{t=1}^T\det S_t .

For the quadratic form, ΣX−1=L−⊤D−1L−1\Sigma_X^{-1} = L^{-\top}D^{-1}L^{-1} and L−1(x−μX)=eL^{-1}(\mathbf{x} - \boldsymbol\mu_X) = \mathbf{e}, so

(x−μX)⊤ΣX−1(x−μX)=e⊤D−1e=∑t=1Tet⊤St−1et.(\mathbf{x} - \boldsymbol\mu_X)^\top\Sigma_X^{-1}(\mathbf{x} - \boldsymbol\mu_X) = \mathbf{e}^\top D^{-1}\mathbf{e} = \sum_{t=1}^T e_t^\top S_t^{-1}e_t .

Substituting both identities into log⁡N(x;μX,ΣX)=−12[Tdlog⁡2π+log⁡det⁡ΣX+(x−μX)⊤ΣX−1(x−μX)]\log\mathcal{N}(\mathbf{x}; \boldsymbol\mu_X, \Sigma_X) = -\tfrac12\bigl[Td\log 2\pi + \log\det\Sigma_X + (\mathbf{x} - \boldsymbol\mu_X)^\top\Sigma_X^{-1}(\mathbf{x} - \boldsymbol\mu_X)\bigr] gives the formula in (iii).

Step 4: cost. One filter step forms FPt−1F⊤+QFP_{t-1}F^\top + Q in O(k3)O(k^3) and St=HPt−H⊤+RS_t = HP^-_tH^\top + R in O(k2d+kd2)O(k^2d + kd^2). It takes a Cholesky factor of StS_t in O(d3)O(d^3), the gain in O(k2d+kd2)O(k^2d + kd^2), and the update in O(k3+k2d)O(k^3 + k^2d). That is O(k3+d3)O(k^3 + d^3) per step and O(T(k3+d3))O(T(k^3 + d^3)) in total, against O((Td)3)O\bigl((Td)^3\bigr) for a Cholesky factor of ΣX\Sigma_X. ■\blacksquare — using Topic 34 Thm 12 (the filter and its predictive law), Topic 8 §8.3 (linear maps of Normal vectors), and the chain rule for densities.

◼

Row tt of x−μX=Le\mathbf{x} - \boldsymbol\mu_X = L\mathbf{e} reads Xt−EXt=et+∑s<tLtsesX_t - \mathbb{E}X_t = e_t + \sum_{s<t}L_{ts}e_s, with Lts=Cov(Xt,es)Ss−1L_{ts} = \mathrm{Cov}(X_t, e_s)S_s^{-1}. This is Gram–Schmidt in the covariance inner product, run in time order, and ΣX=LDL⊤\Sigma_X = LDL^\top is the block Cholesky factorization that Gram–Schmidt produces ( formalCalculus: linear-algebra ), one row at a time.

Example 5 The Nile's exact likelihood, term by term

Theorem 1 holds for any P1P_1. Starting the Nile filter from P1=κ=106P_1 = \kappa = 10^6 (Definition 5), the t=1t = 1 term (−8.4521-8.4521) measures only the vague prior, so we drop it; at (q^,r^)(\hat q, \hat r) the diffuse log-likelihood is

∑t=2100log⁡N(et;0,St)=−632.537686.\sum_{t=2}^{100}\log\mathcal{N}(e_t; 0, S_t) = -632.537686 .
  • The innovation variance shrinks as the level is learned, from S2=31455.31S_2 = 31455.31 to S100=20599.00S_{100} = 20599.00.
  • The innovations whiten the series. The lag-1 autocorrelation is 0.4984 for the flows and 0.1151 for the standardized innovations et/Ste_t/\sqrt{S_t}, and 4 of the 99 standardized innovations fall outside ±1.96\pm 1.96.
  • For an ARMA(1,1), the factorization Γ=LDL⊤\Gamma = LDL^\top of Topic 35’s 12×1212 \times 12 Toeplitz Γn\Gamma_n returns the Kalman StS_t on the diagonal of DD, to 1.1×10−151.1 \times 10^{-15}.

Left: standardized Nile innovations inside a 1.96 band. Middle: large autocorrelations for the flows, small ones for the innovations. Right: a 12 by 12 unit lower-triangular heatmap.

Figure 3. Innovations are Gram–Schmidt in time order. The filter turns an autocorrelated series into nearly white standardized errors, and the data are a unit-triangular mix of them.

Remark 6 Why O(T) matters

Evaluating N(x;μX,ΣX)\mathcal{N}(\mathbf{x}; \boldsymbol\mu_X, \Sigma_X) directly needs a Cholesky factor of a Td×TdTd \times Td matrix: O(T3d3)O(T^3d^3) time, O(T2d2)O(T^2d^2) memory. The filter needs O(T(k3+d3))O(T(k^3 + d^3)) time and O(k2)O(k^2) memory. For a 10,000-step sensor log that is infeasible versus instant; Example 16 shows the same gap for GP regression.

Remark 7 Innovations as diagnostics

Under a correct model the standardized innovations are i.i.d. N(0,1)\mathcal{N}(0, 1) (Theorem 1(i)): they are the residuals. Check them with the sample ACF and its white-noise band (Topic 35 §35.6), a Ljung–Box statistic, and a Normal Q-Q plot. On the Nile, the run of large values after 1898 flags the level shift as an intervention (Remark 18). This is the residual check for any learned state-space or sequence model.

36.4 ARMA models are state-space models

Topic 35’s Remark 10 stacked an AR(pp) into a first-order recursion with a companion matrix (§35.4). MA terms need one more idea: the state carries the part of each upcoming observation that the present already determines.

Definition 2 Harvey's state-space form of an ARMA(p, q)

Let ϕ(B)Xt=θ(B)εt\phi(B)X_t = \theta(B)\varepsilon_t be an ARMA(pp, qq) with εt\varepsilon_t i.i.d. N(0,σ2)\mathcal{N}(0, \sigma^2). Let k=max⁡(p,q+1)k = \max(p, q + 1), and pad with ϕj=0\phi_j = 0 for j>pj > p and θj=0\theta_j = 0 for j>qj > q.

  • FF is k×kk \times k, with first column (ϕ1,…,ϕk)⊤(\phi_1, \dots, \phi_k)^\top, ones on the superdiagonal, and zeros elsewhere.
  • g=(1,θ1,…,θk−1)⊤\mathbf{g} = (1, \theta_1, \dots, \theta_{k-1})^\top.
  • Zt=FZt−1+gεtZ_t = FZ_{t-1} + \mathbf{g}\varepsilon_t and Xt=HZtX_t = HZ_t, with H=(1,0,…,0)H = (1, 0, \dots, 0).
  • So Q=σ2gg⊤Q = \sigma^2\mathbf{g}\mathbf{g}^\top (rank 1) and R=0R = 0: an observation with no noise.
  • P1P_1 is the stationary covariance, the solution of P=FPF⊤+QP = FPF^\top + Q.

For an ARMA(1,1), k=2k = 2 and

F=(ϕ100),g=(1θ).F = \begin{pmatrix} \phi & 1 \\ 0 & 0 \end{pmatrix}, \qquad \mathbf{g} = \begin{pmatrix} 1 \\ \theta \end{pmatrix}.

This is a noise-driven linear difference system ( formalCalculus: linear-systems ; HAR1989).

Theorem 2 ARMA ⇔ state-space

Let ϕ(B)Xt=θ(B)εt\phi(B)X_t = \theta(B)\varepsilon_t be an ARMA(pp, qq) with εt\varepsilon_t i.i.d. N(0,σ2)\mathcal{N}(0, \sigma^2), and take FF, g\mathbf{g}, HH from Definition 2, with k=max⁡(p,q+1)k = \max(p, q+1). Then:

(i) If Zt=FZt−1+gεtZ_t = FZ_{t-1} + \mathbf{g}\varepsilon_t and Xt=HZtX_t = HZ_t, the process XtX_t satisfies Xt=∑j=1pϕjXt−j+εt+∑j=1qθjεt−jX_t = \sum_{j=1}^{p}\phi_jX_{t-j} + \varepsilon_t + \sum_{j=1}^{q}\theta_j\varepsilon_{t-j}.

(ii) A nonzero λ\lambda is an eigenvalue of FF if and only if ϕ(1/λ)=0\phi(1/\lambda) = 0. So the process is causal if and only if the spectral radius ρ(F)\rho(F) is below 1.

(iii) If the model is causal, P=FPF⊤+QP = FPF^\top + Q (with Q=σ2gg⊤Q = \sigma^2\mathbf{g}\mathbf{g}^\top) has the unique solution P1=∑j≥0FjQFj⊤P_1 = \sum_{j\ge 0}F^jQF^{j\top}. Started from Z1∼N(0,P1)Z_1 \sim \mathcal{N}(0, P_1), the observations (X1,…,Xn)(X_1, \dots, X_n) have the law of nn consecutive values of the stationary ARMA, with autocovariance γ(h)=HFhP1H⊤\gamma(h) = HF^hP_1H^\top and ψj=HFjg\psi_j = HF^j\mathbf{g}.

Proof 2 Proof of Thm 2 (ARMA ⇔ state-space) [show]

(i) Write the state’s coordinates as Zt=(Z1,t,…,Zk,t)⊤Z_t = (Z_{1,t}, \dots, Z_{k,t})^\top, and set Zk+1,t=0Z_{k+1,t} = 0 and θ0=1\theta_0 = 1. Row jj of the state equation reads

Zj,t=ϕjZ1,t−1+Zj+1,t−1+θj−1εt,j=1,…,k.Z_{j,t} = \phi_jZ_{1,t-1} + Z_{j+1,t-1} + \theta_{j-1}\varepsilon_t, \qquad j = 1, \dots, k.

We claim that for each jj,

Zj,t=∑i=jk(ϕiZ1,t−1−i+j+θi−1εt−i+j).Z_{j,t} = \sum_{i=j}^{k}\Bigl(\phi_iZ_{1,t-1-i+j} + \theta_{i-1}\varepsilon_{t-i+j}\Bigr).

For j=kj = k this is row kk itself. If it holds for j+1j + 1 at every time, substitute it (at time t−1t - 1) into row jj:

Zj,t=ϕjZ1,t−1+θj−1εt+∑i=j+1k(ϕiZ1,t−1−i+j+θi−1εt−i+j),Z_{j,t} = \phi_jZ_{1,t-1} + \theta_{j-1}\varepsilon_t + \sum_{i=j+1}^{k}\Bigl(\phi_iZ_{1,t-1-i+j} + \theta_{i-1}\varepsilon_{t-i+j}\Bigr),

and the first two terms are the i=ji = j summand. At j=1j = 1, using Xt=Z1,tX_t = Z_{1,t} and the zero padding ϕi=0\phi_i = 0 for i>pi > p and θi=0\theta_i = 0 for i>qi > q,

Xt=∑i=1kϕiXt−i+∑i=1kθi−1εt−i+1=∑i=1pϕiXt−i+εt+∑i=1qθiεt−i.X_t = \sum_{i=1}^{k}\phi_iX_{t-i} + \sum_{i=1}^{k}\theta_{i-1}\varepsilon_{t-i+1} = \sum_{i=1}^{p}\phi_iX_{t-i} + \varepsilon_t + \sum_{i=1}^{q}\theta_i\varepsilon_{t-i}.

(ii) F⊤F^\top has first row (ϕ1,…,ϕk)(\phi_1, \dots, \phi_k) and ones on the subdiagonal: it is Topic 35’s companion matrix Φ\Phi (§35.4 Rem 10), zero-padded to size kk. FF and F⊤F^\top share eigenvalues. Take λ≠0\lambda \ne 0 and v=(λk−1,λk−2,…,1)⊤\mathbf{v} = (\lambda^{k-1}, \lambda^{k-2}, \dots, 1)^\top. Rows 2,…,k2, \dots, k of F⊤v=λvF^\top\mathbf{v} = \lambda\mathbf{v} hold automatically: row ii of F⊤vF^\top\mathbf{v} is vi−1=λk−i+1=λviv_{i-1} = \lambda^{k-i+1} = \lambda v_i. Row 1 reads ∑i=1kϕiλk−i=λk\sum_{i=1}^{k}\phi_i\lambda^{k-i} = \lambda^k. Dividing by λk\lambda^k gives 1−∑iϕiλ−i=01 - \sum_i\phi_i\lambda^{-i} = 0, that is, ϕ(1/λ)=0\phi(1/\lambda) = 0.

Conversely, any eigenvector of F⊤F^\top with λ≠0\lambda \ne 0 has this form. Rows 2,…,k2, \dots, k force vi−1=λviv_{i-1} = \lambda v_i, so v\mathbf{v} is a multiple of the vector above. So the nonzero eigenvalues are exactly the reciprocals of the roots of ϕ\phi; the padding contributes only zero eigenvalues. Causality (Topic 35 §35.4 Thm 5) is “every root of ϕ\phi lies outside the unit circle”, which is ρ(F)<1\rho(F) < 1.

(iii) If ρ(F)<1\rho(F) < 1, pick ρ(F)<ρˉ<1\rho(F) < \bar\rho < 1. Then ∥Fj∥≤Cρˉ j\|F^j\| \le C\bar\rho^{\,j} for some constant CC, so ∑jFjQFj⊤\sum_j F^jQF^{j\top} converges absolutely. Its sum P1P_1 satisfies

FP1F⊤+Q=∑j≥0Fj+1QF(j+1)⊤+Q=P1.FP_1F^\top + Q = \sum_{j\ge 0}F^{j+1}QF^{(j+1)\top} + Q = P_1 .

If PP and P′P' both solve the equation, Δ=P−P′\Delta = P - P' satisfies Δ=FΔF⊤=FjΔFj⊤\Delta = F\Delta F^\top = F^j\Delta F^{j\top} for every jj, and the right side tends to 0. So the solution is unique.

The stationary causal ARMA is Xt=∑j≥0ψjεt−jX_t = \sum_{j\ge0}\psi_j\varepsilon_{t-j} (Topic 35 Thm 5). Define Zt=∑j≥0Fjgεt−jZ_t = \sum_{j\ge0}F^j\mathbf{g}\varepsilon_{t-j}, which converges in L2L^2 by the bound on ∥Fj∥\|F^j\|. It satisfies Zt=FZt−1+gεtZ_t = FZ_{t-1} + \mathbf{g}\varepsilon_t, it is independent of εt+1,εt+2,…\varepsilon_{t+1}, \varepsilon_{t+2}, \dots, and

Cov(Zt)=σ2∑j≥0Fjgg⊤Fj⊤=P1.\mathrm{Cov}(Z_t) = \sigma^2\sum_{j\ge0}F^j\mathbf{g}\mathbf{g}^\top F^{j\top} = P_1 .

By (i), HZtHZ_t solves the ARMA equations. It is causal and stationary, so by the uniqueness in Topic 35 Thm 5 it equals XtX_t, and matching coefficients of εt−j\varepsilon_{t-j} gives ψj=HFjg\psi_j = HF^j\mathbf{g}. Its state at any time t0t_0 is N(0,P1)\mathcal{N}(0, P_1) and independent of later shocks, which is exactly how Definition 2 starts Z1Z_1. So the model started at Z1∼N(0,P1)Z_1 \sim \mathcal{N}(0, P_1) produces the law of (Xt0,…,Xt0+n−1)(X_{t_0}, \dots, X_{t_0+n-1}).

Finally, iterating the state equation hh times gives Zt+h=FhZt+∑j<hFjgεt+h−jZ_{t+h} = F^hZ_t + \sum_{j<h}F^j\mathbf{g}\varepsilon_{t+h-j}, and the sum is independent of ZtZ_t. So Cov(Zt+h,Zt)=FhP1\mathrm{Cov}(Z_{t+h}, Z_t) = F^hP_1, and

γ(h)=Cov(Xt+h,Xt)=HFhP1H⊤.\gamma(h) = \mathrm{Cov}(X_{t+h}, X_t) = HF^hP_1H^\top .

■\blacksquare — using Topic 35 §35.4 Rem 10 (the companion matrix) and Thm 5 (causality; uniqueness of the causal solution), and L2L^2 convergence of geometrically dominated series.

◼

Part (ii) keeps Topic 35’s Remark 10 promise: AR roots become eigenvalues, and causality becomes the stability condition ρ(F)<1\rho(F) < 1 ( formalCalculus: eigenvalues-eigenvectors , formalCalculus: stability-dynamics ). Part (iii) makes the filter, started at the stationary P1P_1, compute the exact likelihood.

Example 6 AR(1) in state-space form

Here k=1k = 1, F=ϕF = \phi, and the Lyapunov equation P=ϕ2P+σ2P = \phi^2P + \sigma^2 gives P1=σ2/(1−ϕ2)=γ(0)P_1 = \sigma^2/(1 - \phi^2) = \gamma(0). Since R=0R = 0, the first update pins the state to x1x_1, and the filter then predicts ϕxt−1\phi x_{t-1} with variance σ2\sigma^2. So S1=γ(0)S_1 = \gamma(0) and St=σ2S_t = \sigma^2 for t≥2t \ge 2: the exact likelihood is the conditional likelihood plus one term for x1x_1. For ϕ=0.7\phi = 0.7, S1/σ2=1.960784S_1/\sigma^2 = 1.960784.

Theorem 3 Kalman innovations are Wold innovations

Let {Xt}\{X_t\} be a causal, mean-zero ARMA(pp, qq) driven by i.i.d. N(0,σ2)\mathcal{N}(0, \sigma^2) noise, filtered in the form of Definition 2 with the stationary P1P_1 of Theorem 2(iii). Write X^t=Πt−1Xt\hat X_t = \Pi_{t-1}X_t for the best linear predictor of XtX_t from X1,…,Xt−1X_1, \dots, X_{t-1}, and vt−1=E(Xt−X^t)2v_{t-1} = \mathbb{E}(X_t - \hat X_t)^2 (Topic 35 Def 5, with X^1=0\hat X_1 = 0 and v0=γ(0)v_0 = \gamma(0)). Topic 35 wrote this projection Pt−1XtP_{t-1}X_t; here PtP_t is a covariance, so the projection is Πt−1\Pi_{t-1}. Then for every t≥1t \ge 1:

(i) Hmt−=x^tHm^-_t = \hat x_t, so the Kalman innovation is the prediction error: et=xt−x^te_t = x_t - \hat x_t.

(ii) St=vt−1S_t = v_{t-1}.

(iii) If the model is also invertible, then St≥σ2S_t \ge \sigma^2, St→σ2S_t \to \sigma^2, and E(et−εt)2=St−σ2→0\mathbb{E}(e_t - \varepsilon_t)^2 = S_t - \sigma^2 \to 0, where ete_t denotes the random innovation Xt−X^tX_t - \hat X_t.

Proof 3 Proof of Thm 3 (Kalman innovations are Wold innovations) [show]

(i) By Theorem 2(iii), (X1,…,Xt)(X_1, \dots, X_t) is a mean-zero Gaussian vector. Topic 34’s Theorem 12 gives E[Xt∣X1:t−1]=Hmt−\mathbb{E}[X_t \mid X_{1:t-1}] = Hm^-_t, and by Step 1 of Proof 1 (with m1=0m_1 = 0, so ct=0c_t = 0) this is a linear combination of X1,…,Xt−1X_1, \dots, X_{t-1}. The conditional expectation minimizes E(Xt−Y)2\mathbb{E}(X_t - Y)^2 over all square-integrable functions YY of X1:t−1X_{1:t-1}, so in particular over the linear span sp{X1,…,Xt−1}\mathrm{sp}\{X_1, \dots, X_{t-1}\}, and we have just seen that it lies in that span. By the projection theorem, the minimizer over a closed subspace is unique (formalCalculus: Hilbert spaces). Hence Hmt−=Πt−1Xt=X^tHm^-_t = \Pi_{t-1}X_t = \hat X_t.

(ii) Theorem 12 also says that Var(Xt∣x1:t−1)=St\mathrm{Var}(X_t \mid x_{1:t-1}) = S_t does not depend on x1:t−1x_{1:t-1}. Taking expectations of the conditional mean-squared error, St=E(Xt−Hmt−)2=E(Xt−X^t)2=vt−1S_t = \mathbb{E}(X_t - Hm^-_t)^2 = \mathbb{E}(X_t - \hat X_t)^2 = v_{t-1}.

(iii) Invertibility gives εt=∑j≥0πjXt−j\varepsilon_t = \sum_{j\ge0}\pi_jX_{t-j} with π0=1\pi_0 = 1 and ∑j∣πj∣<∞\sum_j|\pi_j| < \infty (Topic 35 Thm 6). So

Xt=εt−∑j≥1πjXt−j.X_t = \varepsilon_t - \sum_{j\ge1}\pi_jX_{t-j} .

Causality makes εt\varepsilon_t uncorrelated with every XsX_s, s<ts < t. Write

et=Xt−X^t=εt+Ut,Ut=−∑j≥1πjXt−j−X^t.e_t = X_t - \hat X_t = \varepsilon_t + U_t, \qquad U_t = -\sum_{j\ge1}\pi_jX_{t-j} - \hat X_t .

UtU_t is a mean-square limit of linear combinations of past values, so E[εtUt]=0\mathbb{E}[\varepsilon_tU_t] = 0, and Pythagoras gives

vt−1=σ2+E Ut2,et−εt=Ut.v_{t-1} = \sigma^2 + \mathbb{E}\,U_t^2, \qquad e_t - \varepsilon_t = U_t .

So vt−1≥σ2v_{t-1} \ge \sigma^2 and E(et−εt)2=vt−1−σ2\mathbb{E}(e_t - \varepsilon_t)^2 = v_{t-1} - \sigma^2. For the upper bound, the truncated predictor Yt=−∑j=1t−1πjXt−jY_t = -\sum_{j=1}^{t-1}\pi_jX_{t-j} lies in sp{X1,…,Xt−1}\mathrm{sp}\{X_1, \dots, X_{t-1}\}, and X^t\hat X_t is the best element of that span, so

vt−1≤E(Xt−Yt)2=E(εt−∑j≥tπjXt−j)2.v_{t-1} \le \mathbb{E}(X_t - Y_t)^2 = \mathbb{E}\Bigl(\varepsilon_t - \sum_{j\ge t}\pi_jX_{t-j}\Bigr)^2 .

By Minkowski’s inequality in L2L^2 and EXs2=γ(0)\mathbb{E} X_s^2 = \gamma(0),

vt−1≤σ+γ(0)∑j≥t∣πj∣  ⟶  σ,\sqrt{v_{t-1}} \le \sigma + \sqrt{\gamma(0)}\sum_{j\ge t}|\pi_j| \;\longrightarrow\; \sigma ,

since the tail of a convergent series tends to 0. Combined with vt−1≥σ2v_{t-1} \ge \sigma^2, we get vt−1→σ2v_{t-1} \to \sigma^2. By (ii), St→σ2S_t \to \sigma^2 and E(et−εt)2→0\mathbb{E}(e_t - \varepsilon_t)^2 \to 0. ■\blacksquare — using Topic 34 Thm 12, Topic 8 §8.4 Thm 3 (Gaussian conditional means are linear), Topic 35 Def 5 and Thm 6, and the projection theorem.

◼

The clash of Remark 1 is now a theorem: the innovation ete_t predicts from the finite past, the Wold innovation εt\varepsilon_t from the infinite past, and they agree in L2L^2 as t→∞t \to \infty. Topic 35’s Remark 8 follows: the exact Gaussian ARMA likelihood is a product of innovation densities, computed in O(n)O(n).

Example 7 ARMA(1,1): exact vs CSS vs Whittle

Topic 35’s ARMA(1,1) fixture (ϕ=0.7\phi = 0.7, θ=0.4\theta = 0.4, n=1000n = 1000), demeaned, with every estimate evaluated under the exact likelihood:

Estimatorϕ^\hat\phiθ^\hat\thetaσ^2\hat\sigma^2exact ℓ\ell at the estimate
Exact Gaussian MLE (Kalman, profile; 57 Nelder–Mead iterations)0.6374210.4041901.000176−1419.605827
CSS (Topic 35)0.6389680.4026741.001488−1419.607146
Whittle (Topic 35)0.6410250.3899101.011371−1419.678996

At n=1000n = 1000 all three are within one standard error of each other; Theorem 8’s asymptotic equivalence shows as contour-level agreement in Figure 4 (left). At the true parameters, the ratios St/σ2S_t/\sigma^2 for t=1,…,6t = 1, \dots, 6 are 3.372549, 1.112558, 1.016187, 1.002549, 1.000407 and 1.000065, converging at the rate θ2=0.16\theta^2 = 0.16 per step (Figure 4, right). See mode B of the explorer in §36.8.

Example 8 Yule's sunspots, exactly

Exact Gaussian MLE, mean estimated, on Yule’s sunspots (Topic 35 §35.6); the exact Kalman log-likelihood agrees with SARIMAX to 10−910^{-9}:

Modelμ^\hat\muϕ^\hat\phiθ^\hat\thetaσ^2\hat\sigma^2ℓ^\hat\ell
AR(2)49.659396(1.390656, −0.688571)—274.760365−1307.318169
ARMA(2,1)49.749208(1.470738, −0.755121)−0.153691270.878333−1305.138596

CSS gives AR(2) ϕ^=(1.391812,−0.690282)\hat\phi = (1.391812, -0.690282) and ARMA(2,1) (1.472013,−0.756875; −0.154109)(1.472013, -0.756875;\ -0.154109); Whittle gives (1.393809,−0.688528)(1.393809, -0.688528) and (1.469596,−0.751783; −0.144834)(1.469596, -0.751783;\ -0.144834).

  • AR(2) innovation variances: S1/σ2=5.910522S_1/\sigma^2 = 5.910522 and S2/σ2=1.901612S_2/\sigma^2 = 1.901612, then exactly 1 from t=3t = 3 on. CSS throws away precisely these two start-up terms (Remark 10).
  • AIC vs BIC: with nϑ=p+q+2n_\vartheta = p + q + 2 parameters, AIC prefers ARMA(2,1) (2620.28 vs 2622.64) and BIC prefers AR(2) (2637.57 vs 2638.94).
  • Reconciliation: Topic 35’s table printed AR(2) ℓ^=−1307.319\hat\ell = -1307.319 from a slightly early-stopped optimizer; the exact optimum is −1307.318169-1307.318169.

This is the exact estimator that Topic 35’s Remark 14 deferred.

Left: profile log-likelihood contours over the AR and MA coefficients, with the truth, the exact maximum, conditional least squares and Whittle all close together. Right: innovation variance ratio minus one on a log scale, decaying geometrically for the ARMA(1,1) and vanishing after two steps for the sunspot AR(2).

Figure 4. The exact ARMA likelihood, computed by the Kalman filter. CSS and Whittle land near its peak, and the innovation variances converge to σ² exactly as Theorem 3 predicts.

Remark 8 State-space forms are not unique

For invertible MM, (MFM−1,HM−1,MQM⊤)(MFM^{-1}, HM^{-1}, MQM^\top) gives the same observation process. Harvey’s, the companion and Akaike’s forms are similarity transforms of one another, so FF, HH, QQ are unidentifiable without a canonical form (Remark 20).

Remark 9 Profiling out the noise variance

Because P1P_1 and QQ scale with σ2\sigma^2, run the filter at σ2=1\sigma^2 = 1 to get ete_t and st=St/σ2s_t = S_t/\sigma^2. Then σ^2=n−1∑tet2/st\hat\sigma^2 = n^{-1}\sum_t e_t^2/s_t and

ℓp(ϕ,θ)=−n2(log⁡2π+log⁡σ^2+1)−12∑tlog⁡st.\ell_p(\phi, \theta) = -\tfrac{n}{2}\bigl(\log 2\pi + \log\hat\sigma^2 + 1\bigr) - \tfrac12\textstyle\sum_t\log s_t .

This is the surface of Figure 4 and mode B, with one parameter fewer for Nelder–Mead.

Remark 10 What conditional least squares discards

CSS conditions on the first pp values and sets pre-sample shocks to zero. The exact likelihood keeps the start-up terms with St>σ2S_t > \sigma^2: O(1)O(1) in total, but they matter when nn is small or roots are near the unit circle. They vanish geometrically, so all three estimators share a limit (Topic 35 Thm 8).

Remark 11 ARIMA and nonstationary models

A unit root makes ρ(F)=1\rho(F) = 1, and the Lyapunov equation has no solution. State-space methods handle ARIMA by differencing first or by a diffuse prior on the nonstationary states (Definition 5, §36.7, Remark 17).

36.5 Missing data and forecasting

In a state-space model a missing value is not a hole to patch but a step with nothing to update on.

Definition 3 Observation set; filtering with gaps

Write O⊆{1,…,T}\mathcal{O} \subseteq \{1, \dots, T\} for the set of times observed and xOx_{\mathcal{O}} for the observed values. At a time t∉Ot \notin \mathcal{O} the filter skips the update, setting mt=mt−m_t = m^-_t and Pt=Pt−P_t = P^-_t, and adds no likelihood term. In code, a missing value is NaN.

Theorem 4 Missing observations

Let O⊆{1,…,T}\mathcal{O} \subseteq \{1, \dots, T\} be the observed times, and run the filter of Definition 3: at t∉Ot \notin \mathcal{O}, set mt=mt−m_t = m^-_t and Pt=Pt−P_t = P^-_t and add no likelihood term. Then for every tt:

(i) Zt∣xO∩[1,t−1]∼N(mt−,Pt−)Z_t \mid x_{\mathcal{O}\cap[1,t-1]} \sim \mathcal{N}(m^-_t, P^-_t) and Zt∣xO∩[1,t]∼N(mt,Pt)Z_t \mid x_{\mathcal{O}\cap[1,t]} \sim \mathcal{N}(m_t, P_t);

(ii) log⁡p(xO)=∑t∈Olog⁡N(xt;Hmt−,St)\log p(x_{\mathcal{O}}) = \sum_{t\in\mathcal{O}}\log\mathcal{N}(x_t; Hm^-_t, S_t), the log-density of the observed values alone;

(iii) the backward recursion of Theorem 5, run on these filtered moments, returns Zt∣xO∼N(mts,Pts)Z_t \mid x_{\mathcal{O}} \sim \mathcal{N}(m^s_t, P^s_t).

Proof 4 Proof of Thm 4 (Missing observations) [show]

Write Ot=O∩[1,t]\mathcal{O}_t = \mathcal{O}\cap[1, t]. We prove (i) by induction on tt; the base case is Z1∼N(m1,P1)Z_1 \sim \mathcal{N}(m_1, P_1) with O0=∅\mathcal{O}_0 = \emptyset.

Predict. Suppose Zt−1∣xOt−1∼N(mt−1,Pt−1)Z_{t-1} \mid x_{\mathcal{O}_{t-1}} \sim \mathcal{N}(m_{t-1}, P_{t-1}). The noise WtW_t is independent of Zt−1Z_{t-1} and of every XsX_s with s≤t−1s \le t - 1, since those are functions of Z1,W2:t−1,V1:t−1Z_1, W_{2:t-1}, V_{1:t-1}. So the predict step of Proof 10 in Topic 34 applies verbatim with the conditioning set xOt−1x_{\mathcal{O}_{t-1}} in place of x1:t−1x_{1:t-1}, giving the first half of (i). That argument never used which past observations were in the conditioning set.

Update. If t∉Ot \notin \mathcal{O}, then Ot=Ot−1\mathcal{O}_t = \mathcal{O}_{t-1}: no new information arrives, the conditional law is unchanged, and setting mt=mt−m_t = m^-_t, Pt=Pt−P_t = P^-_t is exact. If t∈Ot \in \mathcal{O}, then VtV_t is independent of (Zt,XOt−1)(Z_t, X_{\mathcal{O}_{t-1}}). So (Zt,Xt)(Z_t, X_t) given xOt−1x_{\mathcal{O}_{t-1}} is jointly Gaussian with the covariance blocks of Proof 10, and the conditional MVN formula (Topic 8 §8.4 Thm 3) gives the usual update. That proves (i).

Likelihood. Order the observed times t1<t2<…t_1 < t_2 < \dots. The chain rule gives

p(xO)=∏t∈Op(xt∣xOt−1),p(x_{\mathcal{O}}) = \prod_{t\in\mathcal{O}}p\bigl(x_t \mid x_{\mathcal{O}_{t-1}}\bigr),

and by the predict step and Xt=HZt+VtX_t = HZ_t + V_t, each factor is N(xt;Hmt−,St)\mathcal{N}(x_t; Hm^-_t, S_t), which is (ii). A missing time contributes no factor because it is not a variable of p(xO)p(x_{\mathcal{O}}).

Smoother. Proof 5 uses three facts: the Markov property Zt⊥Xt+1:T∣Zt+1Z_t \perp X_{t+1:T} \mid Z_{t+1}, restricted here to whichever of Xt+1:TX_{t+1:T} are observed; the filtered law Zt∣xOtZ_t \mid x_{\mathcal{O}_t} from (i); and the linear-Gaussian dynamics. Each holds with O\mathcal{O} in place of {1,…,T}\{1, \dots, T\}, so (iii) follows by the same argument. ■\blacksquare — using Topic 34 Proof 10 (predict and update), Topic 8 §8.4 Thm 3, the chain rule, and Theorem 5.

◼
Example 9 Durbin–Koopman's gap experiment

Delete Nile observations 21–40 and 61–80, leaving 60 values (DUR2012). With P1=107P_1 = 10^7 and no burn-in, the Kalman log-likelihood of the 60 observed values is −389.62213776, and the 60-dimensional brute-force Normal marginal gives the same number to 1.0×10−111.0 \times 10^{-11}. The diffuse gapped log-likelihood used for estimation is −380.573887-380.573887. This is the “missing data for free” of Topic 35’s Remark 28.

Example 10 Forecasting the Nile

Append 20 missing years. The forecast mean stays flat at mT=798.5277m_T = 798.5277, and the state variance grows linearly, PT+hqP_T + hq, with PT=4027.1365P_T = 4027.1365. The observation forecast standard deviation (sd) PT+hq+r\sqrt{P_T + hq + r} rises from 143.5235 (h=1h = 1) to 220.0145 (h=20h = 20); the state sd at h=20h = 20 is 182.4776. The NaN-padded filter and the closed form agree to 2.2×10−112.2 \times 10^{-11}. Probabilistic forecasting with honest bands is a filter run past the data.

The Nile series with its filtered band, then a flat 20-year amber forecast whose 50 and 95 percent bands widen, with dots at the closed-form band edges.

Figure 5. A forecast is a run of missing observations: the update is skipped and the variance grows by q each year.

Remark 12 Partially observed vectors; irregular times

If only some coordinates of xtx_t are missing, drop those rows of HH and rows and columns of RR at that time (Remark 5). Irregular sampling is a time-varying FF and QQ from a continuous-time model, as in Example 16.

Remark 13 When skipping is legitimate

Theorem 4 gives the likelihood of what was observed, which is the right one when missingness does not depend on the unobserved values (missing at random; JON1980). Sensor dropouts qualify; a reading censored because it was extreme does not.

Back to §36.1’s question. The filter at 1913 used only 1871–1913, but the later readings carry information too. Smoothing runs a second, backward pass that folds the future in: the continuous-state counterpart of §34.5’s forward–backward.

Theorem 5 Rauch–Tung–Striebel smoother (featured)

Run the filter on x1:Tx_{1:T}, and assume Pt+1−P^-_{t+1} is invertible (true whenever Q≻0Q \succ 0; Remark 15 covers the singular case). Set mTs=mTm^s_T = m_T and PTs=PTP^s_T = P_T, and for t=T−1,…,1t = T-1, \dots, 1 define the smoother gain and the recursion

Gt=PtF⊤(Pt+1−)−1,G_t = P_tF^\top\bigl(P^-_{t+1}\bigr)^{-1},mts=mt+Gt(mt+1s−mt+1−),Pts=Pt+Gt(Pt+1s−Pt+1−)Gt⊤.m^s_t = m_t + G_t\bigl(m^s_{t+1} - m^-_{t+1}\bigr), \qquad P^s_t = P_t + G_t\bigl(P^s_{t+1} - P^-_{t+1}\bigr)G_t^\top .

Then Zt∣x1:T∼N(mts,Pts)Z_t \mid x_{1:T} \sim \mathcal{N}(m^s_t, P^s_t) for every tt, and the lag-one smoothed covariance is

Ct+1,t:=Cov(Zt+1,Zt∣x1:T)=Pt+1sGt⊤.C_{t+1,t} := \mathrm{Cov}\bigl(Z_{t+1}, Z_t \mid x_{1:T}\bigr) = P^s_{t+1}G_t^\top .
Proof 5 Proof of Thm 5 (Rauch–Tung–Striebel smoother) [show]

Backward induction on tt. The case t=Tt = T is the filter (Topic 34 Thm 12). Assume Zt+1∣x1:T∼N(mt+1s,Pt+1s)Z_{t+1} \mid x_{1:T} \sim \mathcal{N}(m^s_{t+1}, P^s_{t+1}).

Step 1: the future enters only through Zt+1Z_{t+1}. By Topic 34 Thm 4 (whose proof holds verbatim for densities), the joint density factors as

p(z1:T,x1:T)=p(z1)∏s=2Tp(zs∣zs−1)∏s=1Tp(xs∣zs).p(z_{1:T}, x_{1:T}) = p(z_1)\prod_{s=2}^{T}p(z_s \mid z_{s-1})\prod_{s=1}^{T}p(x_s \mid z_s).

Group the factors that involve z1:tz_{1:t} or x1:tx_{1:t}, the single factor p(zt+1∣zt)p(z_{t+1} \mid z_t), and the factors that involve only zt+1:Tz_{t+1:T} and xt+1:Tx_{t+1:T}. Integrating out z1:t−1z_{1:t-1} and conditioning on zt+1z_{t+1} and x1:Tx_{1:T} leaves

p(zt∣zt+1,x1:T)∝p(zt∣x1:t) p(zt+1∣zt),p(z_t \mid z_{t+1}, x_{1:T}) \propto p(z_t \mid x_{1:t})\,p(z_{t+1} \mid z_t),

because the last group does not involve ztz_t and cancels in the normalization. The right side does not involve xt+1:Tx_{t+1:T}, so p(zt∣zt+1,x1:T)=p(zt∣zt+1,x1:t)p(z_t \mid z_{t+1}, x_{1:T}) = p(z_t \mid z_{t+1}, x_{1:t}). Once we know Zt+1Z_{t+1}, later observations tell us nothing more about ZtZ_t.

Step 2: one backward conditioning. Given x1:tx_{1:t}, Zt∼N(mt,Pt)Z_t \sim \mathcal{N}(m_t, P_t) and Zt+1=FZt+Wt+1Z_{t+1} = FZ_t + W_{t+1} with Wt+1W_{t+1} independent. So the pair (Zt,Zt+1)(Z_t, Z_{t+1}) is jointly Gaussian with means (mt,mt+1−)(m_t, m^-_{t+1}) and covariance blocks

Cov(Zt)=Pt,Cov(Zt,Zt+1)=PtF⊤,Cov(Zt+1)=Pt+1−.\mathrm{Cov}(Z_t) = P_t, \qquad \mathrm{Cov}(Z_t, Z_{t+1}) = P_tF^\top, \qquad \mathrm{Cov}(Z_{t+1}) = P^-_{t+1} .

The conditional MVN formula (Topic 8 §8.4 Thm 3), with block 1 = ZtZ_t and block 2 = Zt+1Z_{t+1}, gives

Zt∣zt+1,x1:t∼N(mt+Gt(zt+1−mt+1−),  Pt−GtPt+1−Gt⊤),Z_t \mid z_{t+1}, x_{1:t} \sim \mathcal{N}\Bigl(m_t + G_t(z_{t+1} - m^-_{t+1}),\; P_t - G_tP^-_{t+1}G_t^\top\Bigr),

where the Schur complement Pt−PtF⊤(Pt+1−)−1FPtP_t - P_tF^\top(P^-_{t+1})^{-1}FP_t was rewritten using GtPt+1−Gt⊤=PtF⊤(Pt+1−)−1Pt+1−(Pt+1−)−1FPtG_tP^-_{t+1}G_t^\top = P_tF^\top(P^-_{t+1})^{-1}P^-_{t+1}(P^-_{t+1})^{-1}FP_t.

Step 3: average over the smoothed Zt+1Z_{t+1}. By Step 1, the law in Step 2 is also the law of ZtZ_t given (Zt+1,x1:T)(Z_{t+1}, x_{1:T}). Define

Ut=Zt−mt−Gt(Zt+1−mt+1−).U_t = Z_t - m_t - G_t\bigl(Z_{t+1} - m^-_{t+1}\bigr).

Given (Zt+1,x1:T)(Z_{t+1}, x_{1:T}), Ut∼N(0,Pt−GtPt+1−Gt⊤)U_t \sim \mathcal{N}(0, P_t - G_tP^-_{t+1}G_t^\top), a law that does not depend on Zt+1Z_{t+1}. So, given x1:Tx_{1:T}, UtU_t is independent of Zt+1Z_{t+1}, and

Zt=mt+Gt(Zt+1−mt+1−)+UtZ_t = m_t + G_t\bigl(Z_{t+1} - m^-_{t+1}\bigr) + U_t

is an affine function of the Gaussian vector Zt+1∼N(mt+1s,Pt+1s)Z_{t+1} \sim \mathcal{N}(m^s_{t+1}, P^s_{t+1}) plus independent Gaussian noise. By Topic 8 §8.3 it is Gaussian, with mean mt+Gt(mt+1s−mt+1−)=mtsm_t + G_t(m^s_{t+1} - m^-_{t+1}) = m^s_t and covariance

GtPt+1sGt⊤+Pt−GtPt+1−Gt⊤=Pt+Gt(Pt+1s−Pt+1−)Gt⊤=Pts.G_tP^s_{t+1}G_t^\top + P_t - G_tP^-_{t+1}G_t^\top = P_t + G_t\bigl(P^s_{t+1} - P^-_{t+1}\bigr)G_t^\top = P^s_t .

The same representation gives Cov(Zt,Zt+1∣x1:T)=GtPt+1s\mathrm{Cov}(Z_t, Z_{t+1} \mid x_{1:T}) = G_tP^s_{t+1}, since UtU_t contributes nothing. Transposing yields Ct+1,t=Pt+1sGt⊤C_{t+1,t} = P^s_{t+1}G_t^\top. This completes the induction. ■\blacksquare — using Topic 34 Thm 4 (factorization, for densities), Topic 8 §8.4 Thm 3 (conditional MVN and the Schur complement), Topic 8 §8.3 (affine maps of Normals), and Topic 34 Thm 12 (the filter, for the base case).

◼

The structure is §34.5’s forward–backward line for line. The filter supplies p(zt∣x1:t)p(z_t \mid x_{1:t}); the backward pass multiplies in what the future says through one transition. The correction mt+1s−mt+1−m^s_{t+1} - m^-_{t+1} is how far hindsight moved our belief about tomorrow, and GtG_t carries it back to today. In the scalar local level, Gt=Pt/(Pt+q)G_t = P_t/(P_t + q), a weight between 0 and 1: small when the level was well pinned down at tt, and large when qq is small, so the level barely moves.

Top left: full Nile data with an indigo filtered band and a narrower teal smoothed band. Bottom left: two deleted stretches shaded rose, where the filtered band fans out and snaps back while the smoothed band bulges smoothly. Right: filtered and smoothed posterior standard deviations over time, gapped and full.

Figure 6. Filtering looks back; smoothing looks both ways. Across a gap the filtered band fans out and snaps shut, while the smoothed band bulges in the middle and pinches at the observations on either side.

Tap observations to delete them, or pick the gaps preset. Raise qq and both means chase the data; lower it and they flatten. The forecast slider is a gap at the end, and “MLE” refits (q,r)(q, r).

Data:
diffuse ℓ(q, r) = -632.5377q/r = 0.09687K∞ = 0.26655|𝒪| = 100 of 100
Hover or tap the plot for a readout; tap a point to toggle it missing, drag across years to delete a range.
Example 11 Filtered vs smoothed on the Nile

With full data, the mid-sample filtered sd is 63.46 and the smoothed sd 48.20. The smoothed sd is 63.33 at t=1t = 1 and equals the filtered 63.46 at t=100t = 100 (no future to borrow). With Example 9’s gaps:

  • the filtered sd ramps from 74.10 to 182.48 across the first gap;
  • the smoothed sd bulges to 98.40 mid-gap and pinches to 68.65 at the gap’s first year and 60.08 at the last observed year before it.

The 1897-to-1899 level change is −87.36-87.36 smoothed against −107.76-107.76 filtered: the smoother spreads the 1898 shift symmetrically instead of reacting late.

The smoother gives marginals. For whole paths, say as one block of a Gibbs sampler, the same ingredients give exact joint draws.

Theorem 6 Forward-filtering backward-sampling (stated; CAR1994, FRU1994)

Run the filter on x1:Tx_{1:T}. Draw ZT∼N(mT,PT)Z_T \sim \mathcal{N}(m_T, P_T), then for t=T−1,…,1t = T - 1, \dots, 1 draw

Zt∼N(mt+Gt(Zt+1−mt+1−), Pt−GtPt+1−Gt⊤).Z_t \sim \mathcal{N}\bigl(m_t + G_t(Z_{t+1} - m^-_{t+1}),\ P_t - G_tP^-_{t+1}G_t^\top\bigr).

Then (Z1,…,ZT)(Z_1, \dots, Z_T) is an exact draw from p(z1:T∣x1:T)p(z_{1:T} \mid x_{1:T}), at cost O(Tk3)O(Tk^3).

Steps 1 and 2 of Proof 5 are its two ingredients; the extension of Step 1 to Zt⊥(Zt+2:T,Xt+1:T)∣Zt+1Z_t \perp (Z_{t+2:T}, X_{t+1:T}) \mid Z_{t+1} is the same factorization argument.

Example 12 FFBS draws on the Nile

With 2,000 FFBS draws at the MLE, the largest deviation of the draw mean from mtsm^s_t is 0.053 smoothed sds, and the average ratio of draw sd to Pts\sqrt{P^s_t} is 1.0018. The explorer’s “Sample paths” toggle shows five draws, each a plausible history of the river’s level.

Remark 14 Smoothing is projection onto past and future

For Gaussian models the conditional mean is the L2L^2 projection (Topic 8 §8.4 Thm 3). So mtm_t projects ZtZ_t onto the span of X1:tX_{1:t}, and mtsm^s_t onto the span of the whole sample, extending Topic 35’s projection picture (§35.3) from the past to the past and future. A larger subspace can only reduce error, so Pts⪯PtP^s_t \preceq P_t, with equality at t=Tt = T ( formalCalculus: hilbert-spaces ).

Remark 15 Other smoothers

Besides fixed-lag, fixed-point and two-filter smoothers, the disturbance smoother, which estimates WtW_t and VtV_t, is the efficient route to EM and outlier detection (DUR2012). If Pt+1−P^-_{t+1} is singular, as in Harvey’s form, use the Moore–Penrose inverse; Proof 5 still holds.

Remark 16 FFBS is a Gibbs block

Given the states, (q,r)(q, r) have conjugate inverse-gamma updates; given the variances, FFBS draws all states at once. Alternating is a blocked Gibbs sampler (Topic 26 §26.3) for West and Harrison’s dynamic linear models (WES1997; formalML: bayesian-inference ). Drawing the states jointly is what makes it mix.

36.7 Structural time-series models

Real series have trends that bend and cycles that repeat. State-space models write each feature as its own small component and add them: a modeling language in which we say what the series is made of, and the filter and smoother do the rest.

Definition 4 Structural components
  • Local level: state μt\mu_t, with μt=μt−1+Wt\mu_t = \mu_{t-1} + W_t and Wt∼N(0,qμ)W_t \sim \mathcal{N}(0, q_\mu).
  • Local linear trend: state (μt,νt)(\mu_t, \nu_t) of level and slope, with μt=μt−1+νt−1+W1,t\mu_t = \mu_{t-1} + \nu_{t-1} + W_{1,t} and νt=νt−1+W2,t\nu_t = \nu_{t-1} + W_{2,t}, so
F=(1101),Q=(qμ00qν).F = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}, \qquad Q = \begin{pmatrix} q_\mu & 0 \\ 0 & q_\nu \end{pmatrix}.
  • Dummy seasonal of period ss: the effect obeys δt=−∑j=1s−1δt−j+W3,t\delta_t = -\sum_{j=1}^{s-1}\delta_{t-j} + W_{3,t}, so that ss consecutive effects sum to noise. The state is (δt,…,δt−s+2)(\delta_t, \dots, \delta_{t-s+2}), of dimension s−1s - 1. FF has first row (−1,…,−1)(-1, \dots, -1) and the identity on its subdiagonal, and Q=diag(qδ,0,…,0)Q = \mathrm{diag}(q_\delta, 0, \dots, 0).
  • Stacking: block-diagonal FF and QQ, horizontally concatenated HH, and observation noise rr: a sum of independent, interpretable components (HAR1989, DUR2012).
Definition 5 Approximate-diffuse initialization

Nonstationary components have no stationary start. We set P1=κIP_1 = \kappa I with κ=106\kappa = 10^6 and drop the first bb log-likelihood terms, where bb is the number of diffuse states (1 for the local level, 13 for Example 13’s model). We call the result the diffuse log-likelihood. This is statsmodels’ default (loglikelihood_burn = k_states). The dropped terms are dominated by −12log⁡κ-\tfrac12\log\kappa and carry essentially no information about the parameters.

Example 13 Mauna Loa CO2: trend plus season

Monthly means of the weekly Scripps flask record, March 1958 – December 2001 (n=526n = 526; KEE2004, as bundled in statsmodels). The 5 months with no weekly sample are NaN, so Theorem 4 handles real missing data.

  • Model: local linear trend plus a 12-month dummy seasonal, a 13-dimensional state.
  • Fit: the maximum-likelihood variances (statsmodels’ UnobservedComponents) are irregular r=0.0240221r = 0.0240221, level qμ=0.0508443q_\mu = 0.0508443, slope qν=3.45×10−6q_\nu = 3.45 \times 10^{-6} and seasonal qδ=1.03365×10−5q_\delta = 1.03365 \times 10^{-5}, with diffuse log-likelihood ℓ^=−157.914578\hat\ell = -157.914578, which our own filter reproduces to 10−610^{-6}.
  • Findings: the smoothed growth rate climbs from 1.006 ppm/yr in January 1960 to 1.545 ppm/yr in December 2000. The seasonal swing is 6.07 ppm from peak to trough. The smoother fills in the empty months.

Four stacked panels from 1958 to 2001: carbon dioxide readings with the rising smoothed level, the slowly climbing slope, a regular seasonal cycle, and a small irregular part; empty months shaded rose.

Figure 7. A structural model as a sum of interpretable parts: a slowly accelerating trend and a stable 6 ppm seasonal cycle in the Mauna Loa CO2 record.

Toggle components and move their variances; watch the badge when a toggle changes bb (Remark 21).

Components:
Window:
model: level + slope + seasonalk = 13burn b = 13n = 526 (5 empty)diffuse ℓ = -157.914578AIC = 323.829 (n_ϑ = 4)seasonal peak-to-trough (last 12 mo) = 6.07 ppmgrowth Jan 1960 → Dec 2000 = 1.006 → 1.545 ppm/yr
Remark 17 Exact diffuse initialization

The honest limit is κ→∞\kappa \to \infty, where the naive filter loses precision; de Jong’s diffuse filter (DEJ1991) and Koopman’s exact initial filter (KOO1997) carry the κ\kappa and κ0\kappa^0 parts separately. For the scalar local level with prior mean 0 and variance P1−=κP^-_1 = \kappa, the first update gives

K1=κκ+r→1,filtered mean κκ+r x1→x1,filtered variance κrκ+r→r.K_1 = \frac{\kappa}{\kappa + r} \to 1, \qquad \text{filtered mean } \frac{\kappa}{\kappa + r}\,x_1 \to x_1, \qquad \text{filtered variance } \frac{\kappa r}{\kappa + r} \to r .

So the exact diffuse filter is “start at x1x_1 with variance rr, drop t=1t = 1”, which equals Definition 5 to O(1/κ)O(1/\kappa). In general the diffuse part takes bb steps to clear.

Remark 18 Reduced forms and interventions

The local linear trend’s reduced form is an ARIMA(0,2,2), and a seasonal block corresponds to seasonal differencing. A known break such as 1898 enters as a level-shift dummy, the canonical intervention analysis (DUR2012).

36.8 Learning the parameters: direct likelihood and EM

Direct maximization. Theorem 1 makes ℓ(ϑ)\ell(\vartheta) computable in O(T)O(T), so any optimizer applies (Topic 14 §14.7). Nelder–Mead on (log⁡q,log⁡r)(\log q, \log r), the same nelderMead Topic 35 ships, converges on the Nile in 60 iterations to (q^,r^)=(1463.5474,15108.3145)(\hat q, \hat r) = (1463.5474, 15108.3145), with diffuse ℓ^=−632.537686\hat\ell = -632.537686. That is slightly higher than statsmodels’ default fit (−632.537761-632.537761 at q=1478.81q = 1478.81, r=15078.01r = 15078.01), and Durbin and Koopman’s published (1469.1,15099)(1469.1, 15099) give −632.537695-632.537695: a flat ridge (Figure 8).

EM. Treat the state path as missing data (Topic 14’s EM appendix, Topic 34 §34.7). For the linear-Gaussian model the M-step is closed-form.

Theorem 7 EM M-step for the linear-Gaussian state-space model (SHU1982)

Hold FF, HH, m1m_1, P1P_1 fixed, let ϑ=(Q,R)\vartheta = (Q, R), and let all smoothed moments be computed under the current ϑ\vartheta by Theorem 5. Write

Mt=Pts+mtsmts⊤,Mt,t−1=Ct,t−1+mtsmt−1s⊤\mathbf{M}_t = P^s_t + m^s_tm^{s\top}_t, \qquad \mathbf{M}_{t,t-1} = C_{t,t-1} + m^s_tm^{s\top}_{t-1}

for E[ZtZt⊤∣x]\mathbb{E}[Z_tZ_t^\top \mid x] and E[ZtZt−1⊤∣x]\mathbb{E}[Z_tZ_{t-1}^\top \mid x]. The EM objective J(ϑ′∣ϑ)=Eϑ[log⁡pϑ′(Z1:T,x1:T)∣x1:T]\mathcal{J}(\vartheta' \mid \vartheta) = \mathbb{E}_\vartheta\bigl[\log p_{\vartheta'}(Z_{1:T}, x_{1:T}) \mid x_{1:T}\bigr] is uniquely maximized over Q′,R′≻0Q', R' \succ 0 by

Q′=1T−1∑t=2T(Mt−FMt,t−1⊤−Mt,t−1F⊤+FMt−1F⊤),Q' = \frac{1}{T-1}\sum_{t=2}^{T}\Bigl(\mathbf{M}_t - F\mathbf{M}_{t,t-1}^\top - \mathbf{M}_{t,t-1}F^\top + F\mathbf{M}_{t-1}F^\top\Bigr),R′=1T∑t=1T((xt−Hmts)(xt−Hmts)⊤+HPtsH⊤),R' = \frac1T\sum_{t=1}^{T}\Bigl((x_t - Hm^s_t)(x_t - Hm^s_t)^\top + HP^s_tH^\top\Bigr),

provided both right sides are positive definite. Combined with EM’s ascent property (Topic 34 §34.7 Thm 9), each iteration ϑ↦ϑ′\vartheta \mapsto \vartheta' does not decrease ℓ\ell.

Proof 6 Proof of Thm 7 (EM M-step) [show]

Step 1: the complete-data log-likelihood. By the factorization in Step 1 of Proof 5,

log⁡pϑ′(z,x)=log⁡p(z1)−T−12log⁡det⁡Q′−12∑t=2T(zt−Fzt−1)⊤Q′−1(zt−Fzt−1)−T2log⁡det⁡R′−12∑t=1T(xt−Hzt)⊤R′−1(xt−Hzt),\log p_{\vartheta'}(z, x) = \log p(z_1) - \frac{T-1}{2}\log\det Q' - \frac12\sum_{t=2}^{T}(z_t - Fz_{t-1})^\top Q'^{-1}(z_t - Fz_{t-1}) - \frac T2\log\det R' - \frac12\sum_{t=1}^{T}(x_t - Hz_t)^\top R'^{-1}(x_t - Hz_t),

up to constants that do not involve ϑ′\vartheta'. The first term does not involve ϑ′\vartheta' either.

Step 2: conditional expectations. For a vector uu and a matrix AA, u⊤Au=tr(Auu⊤)u^\top Au = \mathrm{tr}(Auu^\top), and trace commutes with expectation. Expanding the outer product of Zt−FZt−1Z_t - FZ_{t-1} and inserting E[ZtZt⊤∣x]=Mt\mathbb{E}[Z_tZ_t^\top \mid x] = \mathbf{M}_t and E[ZtZt−1⊤∣x]=Mt,t−1\mathbb{E}[Z_tZ_{t-1}^\top \mid x] = \mathbf{M}_{t,t-1} (Theorem 5) gives

E[(Zt−FZt−1)(Zt−FZt−1)⊤∣x]=Mt−FMt,t−1⊤−Mt,t−1F⊤+FMt−1F⊤=:At.\mathbb{E}\bigl[(Z_t - FZ_{t-1})(Z_t - FZ_{t-1})^\top \mid x\bigr] = \mathbf{M}_t - F\mathbf{M}_{t,t-1}^\top - \mathbf{M}_{t,t-1}F^\top + F\mathbf{M}_{t-1}F^\top =: A_t .

Similarly, writing xt−HZt=(xt−Hmts)−H(Zt−mts)x_t - HZ_t = (x_t - Hm^s_t) - H(Z_t - m^s_t), the cross term has conditional mean zero, so

E[(xt−HZt)(xt−HZt)⊤∣x]=(xt−Hmts)(xt−Hmts)⊤+HPtsH⊤=:Bt.\mathbb{E}\bigl[(x_t - HZ_t)(x_t - HZ_t)^\top \mid x\bigr] = (x_t - Hm^s_t)(x_t - Hm^s_t)^\top + HP^s_tH^\top =: B_t .

With Aˉ=1T−1∑t≥2At\bar A = \frac{1}{T-1}\sum_{t\ge2}A_t and Bˉ=1T∑tBt\bar B = \frac1T\sum_tB_t,

J(ϑ′∣ϑ)=const−T−12[log⁡det⁡Q′+tr(Q′−1Aˉ)]−T2[log⁡det⁡R′+tr(R′−1Bˉ)].\mathcal{J}(\vartheta' \mid \vartheta) = \text{const} - \frac{T-1}{2}\Bigl[\log\det Q' + \mathrm{tr}\bigl(Q'^{-1}\bar A\bigr)\Bigr] - \frac T2\Bigl[\log\det R' + \mathrm{tr}\bigl(R'^{-1}\bar B\bigr)\Bigr].

The two brackets involve Q′Q' and R′R' separately, so we can minimize each one on its own.

Step 3: a matrix inequality. For a fixed S≻0S \succ 0, let g(Σ)=log⁡det⁡Σ+tr(Σ−1S)g(\Sigma) = \log\det\Sigma + \mathrm{tr}(\Sigma^{-1}S) over Σ≻0\Sigma \succ 0. Let λ1,…,λm>0\lambda_1, \dots, \lambda_m > 0 be the eigenvalues of Σ−1S\Sigma^{-1}S; they equal those of the symmetric positive-definite matrix S1/2Σ−1S1/2S^{1/2}\Sigma^{-1}S^{1/2}. Then

g(Σ)−g(S)=tr(Σ−1S)−log⁡det⁡(Σ−1S)−m=∑i=1m(λi−log⁡λi−1).g(\Sigma) - g(S) = \mathrm{tr}(\Sigma^{-1}S) - \log\det(\Sigma^{-1}S) - m = \sum_{i=1}^{m}\bigl(\lambda_i - \log\lambda_i - 1\bigr).

Each term is nonnegative, since u−log⁡u−1≥0u - \log u - 1 \ge 0 for u>0u > 0 with equality only at u=1u = 1. So g(Σ)≥g(S)g(\Sigma) \ge g(S), with equality exactly when every λi=1\lambda_i = 1, that is, Σ−1S=I\Sigma^{-1}S = I and Σ=S\Sigma = S.

Step 4: conclude. Applying Step 3 with S=AˉS = \bar A and S=BˉS = \bar B gives the unique maximizers Q′=AˉQ' = \bar A and R′=BˉR' = \bar B, the displayed formulas. ■\blacksquare — using Theorem 5 (smoothed means, covariances and lag-one covariances), the factorization of Topic 34 Thm 4, and Topic 34 §34.7 Thm 9 for ascent.

◼

For the local level (F=H=1F = H = 1) the M-step reads

q′=1T−1∑t=2T[(mts−mt−1s)2+Pts+Pt−1s−2Ct,t−1],r′=1T∑t=1T[(xt−mts)2+Pts].q' = \frac{1}{T-1}\sum_{t=2}^{T}\Bigl[(m^s_t - m^s_{t-1})^2 + P^s_t + P^s_{t-1} - 2C_{t,t-1}\Bigr], \qquad r' = \frac1T\sum_{t=1}^{T}\Bigl[(x_t - m^s_t)^2 + P^s_t\Bigr].

The squared residuals are the naive plug-in estimates; the PsP^s and CC terms correct for the states being unobserved, Baum–Welch’s expected counts in continuous form. With missing data, R′R' averages over t∈Ot \in \mathcal{O} only (divide by ∣O∣|\mathcal{O}|).

Example 14 EM on the Nile

Start at (q,r)=(10000,5000)(q, r) = (10000, 5000), where ℓ=−640.1247\ell = -640.1247. The first M-step moves to (10501.6097,6033.8233)(10501.6097, 6033.8233).

  • After 172 iterations the relative-tolerance rule (10−810^{-8}) stops EM at q=1482.5693q = 1482.5693, r=15079.4881r = 15079.4881, ℓ=−632.537795\ell = -632.537795, still 1.09×10−41.09 \times 10^{-4} below the direct MLE.
  • EM is within 0.01 of the maximum after 88 iterations, and every step increases ℓ\ell; the smallest increase is 6.0×10−66.0 \times 10^{-6}.

In Figure 8 the EM path climbs the contours and then crawls along the ridge: EM’s linear convergence, against Nelder–Mead’s 60 iterations. All log-likelihoods here are diffuse.

Left: Nile log-likelihood contours over log q and log r, with an amber EM path that climbs quickly and then creeps along a long ridge toward the indigo direct maximum. Right: the EM log-likelihood gap on a log scale against iteration.

Figure 8. Two ways up the same hill. Direct maximization reaches the top in 60 iterations; EM climbs every step but crawls along the ridge.

Theorem 8 Asymptotic normality of the SSM maximum-likelihood estimator (stated; HAN1988 Ch. 4; HAR1989 Ch. 3)

Let ϑ∈Θ⊂Rnϑ\vartheta \in \Theta \subset \mathbb{R}^{n_\vartheta} parameterize a stationary SSM, with ρ(Fϑ)<1\rho(F_\vartheta) < 1 and the observation law depending smoothly on ϑ\vartheta. Assume the model is identifiable, the truth ϑ0\vartheta_0 is interior, and the per-observation information

I(ϑ0)ij=lim⁡T→∞1T∑t=1T[12tr(St−1∂iStSt−1∂jSt)+E(∂iet⊤St−1∂jet)]\mathcal{I}(\vartheta_0)_{ij} = \lim_{T\to\infty}\frac1T\sum_{t=1}^{T}\Bigl[\tfrac12\mathrm{tr}\bigl(S_t^{-1}\partial_iS_tS_t^{-1}\partial_jS_t\bigr) + \mathbb{E}\bigl(\partial_ie_t^\top S_t^{-1}\partial_je_t\bigr)\Bigr]

is nonsingular. Then the MLE is consistent and T(ϑ^−ϑ0)⇒N(0,I(ϑ0)−1)\sqrt T(\hat\vartheta - \vartheta_0) \Rightarrow \mathcal{N}\bigl(0, \mathcal{I}(\vartheta_0)^{-1}\bigr).

This is Topic 14 §14.5’s theorem for dependent data, with the score built from innovations; Topic 35’s Theorem 8 is the ARMA case. Variances on the boundary (q=0q = 0: a level that never moves) have nonstandard limits.

Remark 19 Type-II maximum likelihood

The variances (q,r)(q, r) are hyperparameters of a Gaussian prior on the state path, and ℓ(q,r)=log⁡∫p(x∣z) p(z∣q) dz\ell(q, r) = \log\int p(x \mid z)\,p(z \mid q)\,dz is a marginal likelihood. Maximizing it is Topic 28 §28.7’s Type-II MLE and Topic 33’s empirical Bayes: the data choose the smoothing strength q/rq/r, as evidence maximization chooses GP kernel hyperparameters.

Remark 20 EM in practice
  • EM’s rate is set by the fraction of missing information (here, of the state path), which is why Example 14 crawls. Practitioners run EM to get close, then switch to quasi-Newton.
  • With FF and HH free, the M-step is two regressions on smoothed moments: F′=(∑tMt,t−1)(∑tMt−1)−1F' = (\sum_t \mathbf{M}_{t,t-1})(\sum_t \mathbf{M}_{t-1})^{-1} and H′=(∑txtmts⊤)(∑tMt)−1H' = (\sum_t x_t m^{s\top}_t)(\sum_t \mathbf{M}_t)^{-1}. Remark 8’s similarity transforms make that model unidentifiable without constraints.
  • Subspace methods such as N4SID estimate (F,H)(F, H) without likelihood iterations; HAN1988 gives the theory.
Remark 21 Choosing among structural models

Use AIC or BIC (Topic 24 §24.3, §24.4) with nϑn_\vartheta free variances. Diffuse log-likelihoods with different numbers of diffuse states drop different numbers of terms, so compare them only via the exact diffuse likelihood (Remark 17) or on a common burn-in; comparing them directly is a common silent error.

Mode A is Figure 8’s surface: tap to start EM anywhere and watch every increase stay positive. Mode B is §36.4’s exact ARMA(1,1) surface with the exact, CSS and Whittle optima; at n=100n = 100 they spread apart.

Surface:
k = 0 M-steps (1 ℓ evaluations)(q, r) = (10000.00, 5000.00)ℓ = -640.124651ℓ̂ − ℓ = 7.59e+0last increase = —
direct MLE (Nelder–Mead): q̂ = 1463.55, r̂ = 15108.32, ℓ̂ = -632.537686

36.9 The steady state: Riccati, observability, and the constant gain

In Topic 34’s Example 15 the local-level gain settled to K∞=0.270156K_\infty = 0.270156 from step 22 on. Since Pt−P^-_t and KtK_t never depend on the data, why and how fast it settles is a property of a deterministic map, the Riccati recursion.

Theorem 9 Convergence of the scalar Riccati recursion

Let q>0q > 0 and r>0r > 0, and define f(P)=PrP+r+qf(P) = \dfrac{Pr}{P + r} + q on [0,∞)[0, \infty). The local level’s predicted variances obey Pt+1−=f(Pt−)P^-_{t+1} = f(P^-_t) (Topic 34 Ex 15). Then for any P1−≥0P^-_1 \ge 0:

(i) ff has exactly one fixed point in [0,∞)[0, \infty), namely P∞−=(q+q2+4qr)/2P^-_\infty = \bigl(q + \sqrt{q^2 + 4qr}\bigr)/2.

(ii) With K∞=P∞−/(P∞−+r)K_\infty = P^-_\infty/(P^-_\infty + r),

∣Pt+1−−P∞−∣≤(1−K∞) ∣Pt−−P∞−∣,\bigl|P^-_{t+1} - P^-_\infty\bigr| \le (1 - K_\infty)\,\bigl|P^-_t - P^-_\infty\bigr|,

so Pt−→P∞−P^-_t \to P^-_\infty geometrically.

(iii) ∣Pt+1−−P∞−∣/∣Pt−−P∞−∣→(1−K∞)2\bigl|P^-_{t+1} - P^-_\infty\bigr|/\bigl|P^-_t - P^-_\infty\bigr| \to (1 - K_\infty)^2 whenever Pt−≠P∞−P^-_t \ne P^-_\infty, and the gains satisfy ∣Kt−K∞∣≤∣Pt−−P∞−∣/r|K_t - K_\infty| \le |P^-_t - P^-_\infty|/r, so they converge at the same rate.

Proof 7 Proof of Thm 9 (Convergence of the scalar Riccati recursion) [show]

(i) For P≥0P \ge 0, P=f(P)P = f(P) means P(P+r)=Pr+q(P+r)P(P + r) = Pr + q(P + r), that is,

P2−qP−qr=0.P^2 - qP - qr = 0 .

The two roots multiply to −qr<0-qr < 0, so exactly one is positive: P∞−=(q+q2+4qr)/2P^-_\infty = \bigl(q + \sqrt{q^2 + 4qr}\bigr)/2.

(ii) For P,P′≥0P, P' \ge 0,

PrP+r−P′rP′+r=r[P(P′+r)−P′(P+r)](P+r)(P′+r)=r2(P−P′)(P+r)(P′+r).\frac{Pr}{P + r} - \frac{P'r}{P' + r} = \frac{r\bigl[P(P' + r) - P'(P + r)\bigr]}{(P + r)(P' + r)} = \frac{r^2(P - P')}{(P + r)(P' + r)} .

Take P=Pt−P = P^-_t and P′=P∞−P' = P^-_\infty, and use f(P∞−)=P∞−f(P^-_\infty) = P^-_\infty (the qq‘s cancel):

Pt+1−−P∞−=rPt−+r⋅rP∞−+r (Pt−−P∞−).P^-_{t+1} - P^-_\infty = \frac{r}{P^-_t + r}\cdot\frac{r}{P^-_\infty + r}\,\bigl(P^-_t - P^-_\infty\bigr).

Since Pt−≥0P^-_t \ge 0, the first factor is at most 1, and the second equals 1−K∞1 - K_\infty. This gives the inequality. Iterating, ∣Pt−−P∞−∣≤(1−K∞)t−1∣P1−−P∞−∣→0|P^-_t - P^-_\infty| \le (1 - K_\infty)^{t-1}|P^-_1 - P^-_\infty| \to 0, because 0<1−K∞<10 < 1 - K_\infty < 1.

(iii) By (ii), Pt−→P∞−P^-_t \to P^-_\infty, so the ratio rPt−+r⋅rP∞−+r→(rP∞−+r)2=(1−K∞)2\dfrac{r}{P^-_t + r}\cdot\dfrac{r}{P^-_\infty + r} \to \Bigl(\dfrac{r}{P^-_\infty + r}\Bigr)^2 = (1 - K_\infty)^2. For the gains, with Kt=Pt−/(Pt−+r)K_t = P^-_t/(P^-_t + r),

Kt−K∞=Pt−(P∞−+r)−P∞−(Pt−+r)(Pt−+r)(P∞−+r)=r(Pt−−P∞−)(Pt−+r)(P∞−+r),K_t - K_\infty = \frac{P^-_t(P^-_\infty + r) - P^-_\infty(P^-_t + r)}{(P^-_t + r)(P^-_\infty + r)} = \frac{r\bigl(P^-_t - P^-_\infty\bigr)}{(P^-_t + r)(P^-_\infty + r)} ,

whose absolute value is at most ∣Pt−−P∞−∣/r|P^-_t - P^-_\infty|/r, because (Pt−+r)(P∞−+r)≥r2(P^-_t + r)(P^-_\infty + r) \ge r^2. ■\blacksquare — using Topic 34 Ex 15 (the Riccati recursion and its fixed-point equation) and elementary algebra.

◼

For q=0.1q = 0.1 and r=1r = 1 the asymptotic rate is (1−0.270156)2=0.532672(1 - 0.270156)^2 = 0.532672 per step, so ∣Kt−K∞∣|K_t - K_\infty| loses a factor of 10 roughly every 3.6 steps. That is why Topic 34 saw the gain settle within 10−610^{-6} by step 22. The uniform rate (1−K∞)(1 - K_\infty) in (ii) holds from the first step, whatever the prior variance.

Example 15 The rate, measured

For q=0.1q = 0.1 and r=1r = 1: P∞−=0.370156212P^-_\infty = 0.370156212 and K∞=0.270156212K_\infty = 0.270156212: Topic 34’s values, now to nine digits.

  • Rate: Theorem 9(iii) predicts the asymptotic contraction (1−K∞)2=0.532672(1 - K_\infty)^2 = 0.532672; the measured log-linear rate of ∣Kt−K∞∣|K_t - K_\infty| is 0.532363.
  • Nile at the MLE: K∞=0.266551K_\infty = 0.266551, rate 0.537947 (Example 2’s θ=K∞−1\theta = K_\infty - 1).
  • Matrix case: for Example 3’s tracking model the gain converges to K∞=(0.731705,0.448577)⊤K_\infty = (0.731705, 0.448577)^\top, with
P∞−=(1.0908940.6687810.6687810.639350).P^-_\infty = \begin{pmatrix} 1.090894 & 0.668781 \\ 0.668781 & 0.639350 \end{pmatrix}.

That solves the discrete algebraic Riccati equation (agreement 4.3×10−134.3 \times 10^{-13} after 22 iterations), reached from P1=100IP_1 = 100I and P1=0P_1 = 0 alike.

Left: the scalar Riccati map with cobweb paths from 1.15 and 0 converging to the fixed point near 0.37. Right: the gain error on a log scale, falling along straight lines at the predicted rate for the local level and the tracking model.

Figure 9. Why the gain settles. The Riccati map contracts toward its fixed point, and every starting covariance is forgotten at a geometric rate.

In more dimensions the question is whether, not just how fast: a state direction the data never see has nothing to pin it down.

Definition 6 Observability, controllability, detectability, stabilizability
  • (F,H)(F, H) is observable if the kd×kkd \times k matrix stacking H,HF,…,HFk−1H, HF, \dots, HF^{k-1} has rank kk: every direction of the state eventually shows up in the data.
  • (F,B)(F, B) is controllable, where Q=BB⊤Q = BB^\top, if the matrix placing B,FB,…,Fk−1BB, FB, \dots, F^{k-1}B side by side has rank kk: noise eventually reaches every direction.
  • Detectable and stabilizable weaken these to “every unstable mode” (eigenvalues ∣λ∣≥1|\lambda| \ge 1).

Constant velocity with position observed is observable: the rank-2 matrix stacks (1,0)(1, 0) and (1,1)(1, 1). With velocity observed, H=HF=(0,1)H = HF = (0, 1), and the unstable position mode is not detectable.

Theorem 10 Convergence of the matrix Riccati recursion (stated; AND1979 Ch. 4)

Let Q=BB⊤Q = BB^\top and R≻0R \succ 0, and suppose (F,H)(F, H) is detectable and (F,B)(F, B) stabilizable (Definition 6). Then the discrete algebraic Riccati equation

P=F(P−PH⊤(HPH⊤+R)−1HP)F⊤+QP = F\bigl(P - PH^\top(HPH^\top + R)^{-1}HP\bigr)F^\top + Q

has a unique positive-semidefinite solution P∞−P^-_\infty. For every P1⪰0P_1 \succeq 0 the predicted covariances Pt−P^-_t converge to it, and the steady-state closed-loop matrix F(I−K∞H)F(I - K_\infty H) has spectral radius less than 1.

Theorem 9 is the k=d=1k = d = 1 case with an explicit rate, and (1−K∞)(1 - K_\infty) is its closed-loop factor. In §36.2’s stepper, “Run to steady state” converges in about 20 steps with position observed and never with velocity alone, where detectability fails.

Remark 22 The steady-state filter is a fixed linear filter

Once Kt≈K∞K_t \approx K_\infty, the filter is the time-invariant recursion mt=Fmt−1+K∞(xt−HFmt−1)m_t = Fm_{t-1} + K_\infty(x_t - HFm_{t-1}): the Wiener filter, exponential smoothing for the local level (Topic 34 Ex 15), and the invertible AR(∞\infty) predictor of Theorem 3(iii) for an ARMA. Production systems often precompute K∞K_\infty; the price is a slightly wrong start-up transient, exactly Remark 10’s CSS-versus-exact difference.

Remark 23 Continuous time: Kalman–Bucy

For dZ=AZ dt+L dBtdZ = AZ\,dt + L\,dB_t observed continuously through HH with white noise, the Riccati recursion becomes the Riccati ODE

P˙=AP+PA⊤+LL⊤−PH⊤R−1HP\dot P = AP + PA^\top + LL^\top - PH^\top R^{-1}HP

(KAL1961; formalCalculus: first-order-odes ). Its steady state solves the continuous algebraic Riccati equation, P˙=0\dot P = 0.

36.10 Connections, and the Track 9 synthesis

Exact GP regression on nn points costs O(n3)O(n^3). On a line, for the Matérn family, the state-space view removes that cost.

Example 16 A Matérn-3/2 GP is a two-state SSM

The kernel c(τ)=s2(1+λ∣τ∣)e−λ∣τ∣c(\tau) = s^2(1 + \lambda|\tau|)e^{-\lambda|\tau|}, with λ=3\lambda = \sqrt3 divided by the length scale, is the covariance of the stationary solution of df=Af dt+L dBtdf = Af\,dt + L\,dB_t for the state (f,f′)(f, f'), where

A=(01−λ2−2λ),L=(02sλ3/2),A = \begin{pmatrix} 0 & 1 \\ -\lambda^2 & -2\lambda \end{pmatrix}, \qquad L = \begin{pmatrix} 0 \\ 2s\lambda^{3/2} \end{pmatrix},

and BtB_t is a Brownian motion (HAR2010).

  • Exact discretization: between inputs a gap Δ\Delta apart,
F(Δ)=eAΔ=e−λΔ(1+λΔΔ−λ2Δ1−λΔ),Q(Δ)=P∞−F(Δ)P∞F(Δ)⊤,F(\Delta) = e^{A\Delta} = e^{-\lambda\Delta}\begin{pmatrix} 1 + \lambda\Delta & \Delta \\ -\lambda^2\Delta & 1 - \lambda\Delta \end{pmatrix}, \qquad Q(\Delta) = P_\infty - F(\Delta)P_\infty F(\Delta)^\top,

with P∞=diag(s2,λ2s2)P_\infty = \mathrm{diag}(s^2, \lambda^2s^2); irregular inputs give a different FF and QQ at each step (Remark 5), and H=(1,0)H = (1, 0).

  • Setup: 60 irregular inputs on [0,10][0, 10], s2=1s^2 = 1, length scale 1.5 (so λ=1.154701\lambda = 1.154701), and noise variance r=0.09r = 0.09. The RTS smoother’s posterior mean equals the O(n3)O(n^3) Cholesky GP posterior mean to 4.8×10−154.8 \times 10^{-15}, and its variance to 4.4×10−164.4 \times 10^{-16}.
  • Cost: fitted log-log slopes of runtime against nn are 2.6 (dense) and 1.0 (Kalman); absolute timings are machine-dependent, and the gap widens with nn.

Exact one-dimensional GP regression is an O(n)O(n) smoothing problem, and every half-integer Matérn-ν\nu kernel works the same way with ν+1/2\nu + 1/2 states ( formalML: gaussian-processes ).

Left: 60 noisy points with the dense Gaussian-process posterior band in indigo and teal Kalman smoother means lying on it. Right: log-log runtime against the number of points, with the dense method climbing more steeply.

Figure 10. A Matérn Gaussian process is a two-state linear model, so the Kalman smoother returns the exact GP posterior in linear time.

Remark 24 S4, Mamba, and what the probabilistic view adds

This extends Topic 34’s Remark 25. S4 (GU2022) discretizes a continuous linear system h˙=Ah+Bu\dot h = Ah + Bu exactly as Example 16 does, F(Δ)=eAΔF(\Delta) = e^{A\Delta}, and runs the state equation as a learned, noise-free layer. Mamba (GU2023) makes Δ\Delta, BB and the output map input-dependent. What they omit is everything this topic adds: a noise model, a likelihood, uncertainty bands, smoothing, and principled handling of missing tokens.

Remark 25 Leaving linear or Gaussian

This extends Topic 34’s Remark 22. With nonlinear F(⋅)F(\cdot) or H(⋅)H(\cdot), the extended and unscented filters linearize; the smoother then needs the same linearization backward (the extended RTS smoother), and EM needs Monte Carlo or variational E-steps ( formalML: variational-inference ). Particle filters (GOR1993) and particle smoothers replace every Gaussian closed form with weighted samples, and FFBS (Theorem 6) is the exact linear-Gaussian case of backward-simulation smoothing ( formalML: sequential-monte-carlo ).

Remark 26 Track 9 closer

Three topics, one object. Topic 34 built a hidden chain and got filtering, smoothing and EM on a trellis. Topic 35 built a stationary series from its autocovariance and got Wold’s innovations and the spectrum. This topic proved they meet: an ARMA is a linear-Gaussian SSM, its innovations are Kalman’s, and the exact likelihood, smoother and EM are the continuous-state versions of Topic 34’s recursions. The road forward runs to formalML ( formalML: gaussian-processes , formalML: sequential-monte-carlo , formalML: bayesian-inference ). This closes Track 9, not the site: Track 8’s Parametric vs Nonparametric Models is still to come.


References

  1. Durbin, James, and Siem Jan Koopman. (2012). Time Series Analysis by State Space Methods (2nd ed.). Oxford University Press.
  2. Harvey, Andrew C. (1989). Forecasting, Structural Time Series Models and the Kalman Filter. Cambridge University Press.
  3. Särkkä, Simo. (2013). Bayesian Filtering and Smoothing. Cambridge University Press.
  4. Brockwell, Peter J., and Richard A. Davis. (1991). Time Series: Theory and Methods (2nd ed.). Springer.
  5. Shumway, Robert H., and David S. Stoffer. (2017). Time Series Analysis and Its Applications: With R Examples (4th ed.). Springer.
  6. Kalman, Rudolph E. (1960). A New Approach to Linear Filtering and Prediction Problems. Journal of Basic Engineering, 82(1), 35–45.
  7. Rauch, Herbert E., F. Tung, and Charlotte T. Striebel. (1965). Maximum Likelihood Estimates of Linear Dynamic Systems. AIAA Journal, 3(8), 1445–1450.
  8. Shumway, Robert H., and David S. Stoffer. (1982). An Approach to Time Series Smoothing and Forecasting Using the EM Algorithm. Journal of Time Series Analysis, 3(4), 253–264.
  9. Dempster, A. P., N. M. Laird, and D. B. Rubin. (1977). Maximum Likelihood from Incomplete Data via the EM Algorithm. Journal of the Royal Statistical Society, Series B, 39(1), 1–22.
  10. Jones, Richard H. (1980). Maximum Likelihood Fitting of ARMA Models to Time Series with Missing Observations. Technometrics, 22(3), 389–395.
  11. Carter, C. K., and R. Kohn. (1994). On Gibbs Sampling for State Space Models. Biometrika, 81(3), 541–553.
  12. Frühwirth-Schnatter, Sylvia. (1994). Data Augmentation and Dynamic Linear Models. Journal of Time Series Analysis, 15(2), 183–202.
  13. de Jong, Piet. (1991). The Diffuse Kalman Filter. Annals of Statistics, 19(2), 1073–1083.
  14. Koopman, Siem Jan. (1997). Exact Initial Kalman Filtering and Smoothing for Nonstationary Time Series Models. Journal of the American Statistical Association, 92(440), 1630–1638.
  15. Anderson, Brian D. O., and John B. Moore. (1979). Optimal Filtering. Prentice-Hall.
  16. Hannan, E. J., and Manfred Deistler. (1988). The Statistical Theory of Linear Systems. Wiley.
  17. Bucy, Richard S., and Peter D. Joseph. (1968). Filtering for Stochastic Processes with Applications to Guidance. Interscience.
  18. Kalman, Rudolph E., and Richard S. Bucy. (1961). New Results in Linear Filtering and Prediction Theory. Journal of Basic Engineering, 83(1), 95–108.
  19. Hartikainen, Jouni, and Simo Särkkä. (2010). Kalman Filtering and Smoothing Solutions to Temporal Gaussian Process Regression Models. 2010 IEEE International Workshop on Machine Learning for Signal Processing, 379–384.
  20. West, Mike, and Jeff Harrison. (1997). Bayesian Forecasting and Dynamic Models (2nd ed.). Springer.
  21. Gordon, N. J., D. J. Salmond, and A. F. M. Smith. (1993). Novel Approach to Nonlinear/Non-Gaussian Bayesian State Estimation. IEE Proceedings F, 140(2), 107–113.
  22. Gu, Albert, Karan Goel, and Christopher Ré. (2022). Efficiently Modeling Long Sequences with Structured State Spaces. International Conference on Learning Representations (ICLR 2022).
  23. Gu, Albert, and Tri Dao. (2023). Mamba: Linear-Time Sequence Modeling with Selective State Spaces. arXiv preprint arXiv:2312.00752.
  24. Cobb, George W. (1978). The Problem of the Nile: Conditional Solution to a Changepoint Problem. Biometrika, 65(2), 243–251.
  25. Keeling, Charles D., and Timothy P. Whorf. (2004). Atmospheric CO2 Concentrations Derived from Flask Air Samples at Sites in the SIO Network [Data set]. In Trends: A Compendium of Data on Global Change. Carbon Dioxide Information Analysis Center, Oak Ridge National Laboratory.