The steady state#

A relative convergence test#

Decision. In a time-invariant model the conventional filter stops updating \(P_t\), \(F_t\) and \(K_t\) once \(\|P_{t+1} - P_t\|_F \le \tau \|P_{t+1}\|_F\), with \(\tau\) = tol_steady = 1e-15 by default (DK §4.3.4). It resumes the full recursion at a missing observation and never starts during the diffuse periods.

Why. At \(\tau\) = 1e-15, a few units in the last place, the shortcut changes results by less than rounding; the tests compare it with the full recursion, also with missing data, time-varying intercepts and a concentrated scale. It reduces a step of the log likelihood to a few matrix-vector products: 4-14 times faster in the benchmarks.

Alternatives. statsmodels switches when \(\|P_{t+1} - P_t\|_F^2 < 10^{-19}\), an absolute threshold: for data on a large scale it is never reached, and on a small scale it can be reached early. This causes the differences near 1e-10 between the two libraries in some time-invariant fixtures.

Where. check_steady, use_steady and steady_step in statespace_filter; tol_steady and t_steady.

Computing the steady state#

Decision. steady_state solves for \(\bar P\) by the structure-preserving doubling algorithm (Chu, Fan, Lin and Wang 2004), whose k-th step equals step \(2^k\) of the Riccati recursion from \(P = 0\); with singular H it iterates the recursion.

Why. The recursion converges slowly exactly where the steady state is of interest: a fixed regression coefficient is learned like 1/t, and a nearly fixed seasonal (the DK §8.2 model has a seasonal variance of 5e-7) over thousands of periods. Doubling reaches those limits in some 40 steps.

The prediction error variance#

Decision. prediction_error_variance returns the steady-state \(\bar F\), the goodness-of-fit measure of DK §7.4.

Note. DK’s printed value in §8.2, 0.00586717, is \(\bar F\) times (n - d)/n; see Road casualties and the seat belt law (DK §8.2).