12. Linear Least Squares Prediction#
(a) The Wiener–Kolmogorov Formula#
The Wold moving average representation is useful for representing the linear least squares \(u\)-step ahead prediction for a purely linearly indeterministic process. Let \(x(t)\) be a purely linearly indeterministic process with Wold moving average representation
where \(\int^\infty_0 p(s)^2\, ds < +\infty\) and \(w(t)\) is a fundamental white noise for \(x(t)\). Recall that the property that \(w(t)\) is a fundamental white noise for \(x(t)\) means equality of the linear spaces
and
where \(L_2\,[0,\, \infty)\) is the space of square integrable functions, i.e., functions \(b(s)\) for \(0 \leq s < \infty\) such that \(\int^\infty_0 b(s)^2\, ds < +\infty\). The equality of these spaces means that lagged \(x\)’s contain the same amount of information as lagged \(w\)’s.
Since (62) holds for all \(t\), we have
Using the identity of the linear spaces \(H_x(-\infty,\,t)\) and \(H_w(-\infty,\,t)\), we have that
Equation (63) is the continuous time Wiener–Kolmogorov formula. It rests on the equality of the spaces spanned by past \(x\)’s and past fundamental innovations \(w\)’s established in Wold’s theorem (Theorem 10 of 8. Spectral Densities); 15. State-Space Models, the Kalman Filter, and Spectral Factorization gives the equivalent state-space form, in which \(w\) becomes the Kalman innovations process and this same forecast is computed recursively.
Using operational calculus, the formula can be expressed as
where \([\, \tilde P(s)\, e^{su} \,]_+\) is the time function formed by taking the inverse Laplace transform of \(\tilde P(s)\, e^{su}\), and then multiplying it by the Heaviside unit step function (i.e., setting values of the time function for \(t < 0\) equal to zero, while leaving values of the function for \(t \geq 0\) unaltered). The operator \([\,\cdot\,]_+\) is known as the annihilation operator. Note that \(e^{uD}\) is the operator that shifts a time function ahead \(u\) units. Reading property 4 (Delay) of Table 2 in the direction of an advance rather than a delay, \(e^{su}\, \tilde P(s)\) is the Laplace transform of the advanced function \(p(t+u)\); annihilating its negative part then leaves the kernel \(p(s+u),\ s \geq 0\), of (63). This \(e^{uD}\) convention is the one used throughout the book, in 19. Prediction Formulas for Continuous Time Linear Rational Expectations Models and in 20. Aggregation Over Time and the Inverse Optimal Predictor Problem for Adaptive Expectations in Continuous Time.
As a check, for \(\tilde P(s) = 1/(a+s)\) the inverse transform of \(e^{su}/(a+s)\) is \(e^{-a(t+u)}\) for \(t + u \geq 0\); annihilating \(t<0\) and transforming back gives \(e^{-au}/(a+s)\), which is (65).
As an example of the use of formula (63), let \(x(t)\) be governed by the first order stochastic differential equation
so that \(p(\tau) = e^{-a\tau}\). Then formula (63) gives
or
(b) A Formula for Predicting “Geometric Distributed Leads”#
Such geometric distributed leads are the present values that appear in every asset-pricing equation, permanent-income model, and quadratic-adjustment-cost Euler equation; they are also the continuous-time counterpart of the discounted expected sums that define the optimal feedforward decision rules of 16. Faster Methods for Solving Recursive Linear Models of Dynamic Economies. Evaluating them is the central computational step in solving continuous-time rational expectations models.
In linear rational expectation models, there often appear terms of the form
where \(x(t)\) is a covariance stationary stochastic process. Where \(x(t)\) is governed by the first order Markov process \((D+a)\, x(t) = w(t)\), equation (65) implies that the linear least squares forecast of the geometric distributed lead (66) is given by
An approach to the evaluation of (66) which readily generalizes to \(x(t)\)’s governed by higher order linear differential equations is as follows. Denote the geometric distributed lead to be forecast as
where for \(re(\rho) < 0\), \(-1/(\rho + s)\) is the (two-sided) Laplace transform of the time function equal to \(e^{-\rho u}\) for \(u \leq 0\) and \(0\) for \(u > 0\).
Obtaining a partial fraction representation of the right side of (67) gives
or
It then follows that
This approach generalizes readily as follows. Represent equation (68) as
where \(\tilde P(D) = 1/(a+D)\). As it happens, Equation (69) holds for any \(\tilde P(D)\), where \(\tilde P(s)\) is the Laplace transform of a squared summable function \(p(\tau)\) concentrated on \(\tau \in [0,\, \infty)\). Thus, where
we claim that the generalization of (69) is
The general formula (70), valid for any rational \(\tilde P(D)\), is established in 19. Prediction Formulas for Continuous Time Linear Rational Expectations Models.
Exercises#
There is a direct route to the kernel of a geometric distributed lead that provides an independent check on (70). Writing \(x(t+s) = \int_0^\infty p(\tau)w(t+s-\tau)d\tau\) and discarding the terms dated after \(t\) leaves \(E_t\, x(t+s) = \int_0^\infty p(\tau+s)\, w(t-\tau)\, d\tau\), which is (63). Multiplying by \(e^{\rho s}\) and integrating,
Formula (71) computes the same object as (70), but in the time domain and by quadrature rather than by partial fractions.
import numpy as np
from scipy.integrate import quad
Exercise 14
Take the second-order process \((D+a_1)(D+a_2)x(t) = w(t)\) with \(a_1 = 0.6\), \(a_2 = 1.7\), whose kernel is \(p(\tau) = (e^{-a_1\tau} - e^{-a_2\tau})/(a_2 - a_1)\), and let \(\rho = -0.4\).
(a) Show by partial fractions that (70) gives
and verify this closed form against the quadrature (71).
(b) Confirm that \(g(0) = \tilde P(-\rho) = 1/[(a_1-\rho)(a_2-\rho)]\), as the initial value theorem of 9. Characterizations of Mean Square Differentiability and Mean Square Continuity requires. Note that \(g(0) \neq 0\) even though \(p(0) = 0\). 13. Locally Unpredictable Stochastic Processes exploits that fact.
(c) Recover the first-order case by letting \(a_2 \to \infty\). Note that the kernel itself vanishes in that limit, so the process must be rescaled: \(a_2\, p(\tau) \to e^{-a_1\tau}\), and correspondingly \(a_2\, g(0) \to 1/(a_1 - \rho)\), which is the coefficient in (68).
Solution to Exercise 14
a1, a2, rho = 0.6, 1.7, -0.4
p = lambda t: (np.exp(-a1*t) - np.exp(-a2*t))/(a2 - a1)
g_cf = lambda t: (np.exp(-a1*t)/(a1-rho) - np.exp(-a2*t)/(a2-rho))/(a2 - a1)
Ptil = lambda s: 1.0/((s+a1)*(s+a2))
print(" tau g closed form g by quadrature")
for tau in [0.0, 0.5, 1.5, 4.0]:
num, _ = quad(lambda u: np.exp(rho*u)*p(tau+u), 0, 200, limit=400)
print(f"{tau:5.1f} {g_cf(tau):15.10f} {num:15.10f}")
print(f"\n(b) g(0) = {g_cf(0.0):.10f}")
print(f" P(-rho) = {Ptil(-rho):.10f}")
print(f" p(0) = {p(0.0):.10f} <- vanishes, but g(0) does not")
tau g closed form g by quadrature
0.0 0.4761904762 0.4761904762
0.5 0.4884430006 0.4884430006
1.5 0.3358071946 0.3358071946
4.0 0.0819887129 0.0819887129
(b) g(0) = 0.4761904762
P(-rho) = 0.4761904762
p(0) = 0.0000000000 <- vanishes, but g(0) does not
# (c) as a2 -> infinity, rescaled by a2, the process becomes first order with decay a1
print(f"target 1/(a1-rho) = {1/(a1-rho):.6f}")
for A2 in [10.0, 100.0, 1000.0, 1e5]:
g0 = 1.0/((a1-rho)*(A2-rho)) # = g(0) with a2 replaced by A2
print(f" a2={A2:9.0f}: a2*g(0) = {A2*g0:.6f}")
target 1/(a1-rho) = 1.000000
a2= 10: a2*g(0) = 0.961538
a2= 100: a2*g(0) = 0.996016
a2= 1000: a2*g(0) = 0.999600
a2= 100000: a2*g(0) = 0.999996
The quadrature reproduces the partial-fraction formula to ten digits, and \(g(0)\) equals \(\tilde P(-\rho)\) exactly. Part (c) shows the first-order limit: the second exponential decays ever faster and contributes ever less, so after rescaling by \(a_2\) the present value collapses to \(x(t)/(a_1-\rho)\), which is (68).