Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

6.4 ARMA Models (Under Construction)

Autocovariance and Autocorrelation of AR(pp) Models

Deriving Weights for Causal Process

We’ve seen that the autoregressive operator ϕ(B)\phi(\mathbb{B}) is extremely useful for determining stationarity. In this section, we will explore another useful application of ϕ(B)\phi(\mathbb{B}), namely converting a finite AR model into a so called MA(\infty) consisting of an infinite series of noise (or shock) terms. This in turn will help us understand the autocovariance of AR processes and derive confidence intervals for predictions.

We’ve already seen one example of converting to an infinite series of noise for AR(1) models

xt=(1+ϕB+ϕ2B2+ϕ3B3+)wt=wt+ϕwt1+ϕ2wt2+ϕ3wt3+\begin{split} x_t&=(1 + \phi \mathbb{B} + \phi^2 \mathbb{B}^2 + \phi^3 \mathbb{B}^3 + \ldots)\,w_t\\ &= w_t + \phi w_{t-1} + \phi^2 w_{t-2} + \phi^3 w_{t-3} + \ldots \end{split}

How might we go about finding weights, call them ψj\psi_j’s with associated operator ψ(B)\psi(\mathbb{B}), for higher order AR(pp) processes? In other words, we want to find ψ\psi weights to satisfy the equation

xt=ψ(B)wtx_t = \psi(\mathbb{B})\,w_t

where we have defined ψ0=1\psi_0\stackrel{\triangle}{=}1.Given that an AR model is defined as

wt=ϕ(B)xt,w_t = \phi(\mathbb{B})\,x_t,

we may combine Eqs. (2) and (3) to arrive at

wt=ϕ(B)xt=ϕ(B)ψ(B)wt=(1ϕ1Bϕ2B2ϕpBp)(1+ψ1B+ψ2B2+)=1+(ψ1ϕ1)B+(ψ2ϕ2ψ1ϕ1)B2+\begin{split} w_t &=\phi(\mathbb{B})x_t\\ &=\phi(\mathbb{B})\psi(\mathbb{B})w_t\\ &=(1 - \phi_1 \mathbb{B}-\phi_2 \mathbb{B}^2-\ldots-\phi_p \mathbb{B}^p)(1 + \psi_1 \mathbb{B} + \psi_2 \mathbb{B}^2 + \ldots)\\ &= 1 + (\psi_1-\phi_1)\mathbb{B} + (\psi_2 -\phi_2 -\psi_1\phi_1) \mathbb{B}^2 +\ldots \end{split}

Given that the left-hand side of Eq. (4) does not have any backshifted terms, we conclude that the coefficients of each backshift operator must be zero, i.e.

ψ0=1ψ1ϕ1=0ψ1=ϕ1ψ2ϕ2ψ1ϕ1=0ψ2ϕ2ϕ12=0substituting ψ1=ϕ1ψ2=ϕ2+ϕ12\begin{split} \psi_0&=1\\ \psi_1-\phi_1&=0\\ \psi_1 &= \phi_1\\ \psi_2 -\phi_2 -\psi_1\phi_1 &= 0\\ \psi_2 -\phi_2 -\phi_1^2 &= 0 \qquad \text{substituting }\psi_1 = \phi_1\\ \psi_2 &=\phi_2 +\phi_1^2\\ \vdots \end{split}

Fortunately, statsmodels performs the operations in Eq. (5) for us using the property impulse_response[4]. Continuing with the example from above, add the following line to the code:

print(f"psi weights 0-9: {ar2.impulse_response()[:10]}")

Do the results agree with Eq. (5) applied in the problem above?

ψ\psi Weight Representation

Brockwell & Davis (1991) chapter 3.3 provides three broad methods to calculate the theoretical autocovariance and autocorrelation of AR models (and ARMA models in general). We will focus on the first here.

The first method relies on representing the model in the form of Eq. (2). γ(h)\gamma(h) is then calculated in the same fashion as Eq. (5)

γ(h)=Cov(xt+h,xt)=E[xt+hxt]=E[(j=0ψjwt+hj)(k=0ψkwtk)]=σw2i=0ψiψi+h\begin{split} \gamma(h) &= \text{Cov}(x_{t+h}, x_t)\\ &=\mathbb{E}[x_{t+h}x_t]\\ &=\mathbb{E}\Big[\Big(\sum_{j=0}^{\infty}\psi_j w_{t+h-j}\Big)\Big(\sum_{k=0}^{\infty} \psi_k w_{t-k}\Big)\Big]\\ &= \sigma_w^2 \sum_{i=0}^{\infty} \psi_i\,\psi_{i+h} \end{split}

where we have used the fact that the noise is iid resulting in zero covariance for different noise terms. Unfortunately, AR(pp) models with p2p\geq2 do not have the same convenient geometric series representation seen with an AR(1) model. Nevertheless, Eq. (6) provides an elegant method for calculating the autocovariance, and hence the autocorrelation, of any stationary AR process—or, as we shall see, any stationary ARMA process. The fact that the ψ\psi weights decay exponentially results in it being possible to truncate Eq. (6) after say, thirty terms, with relatively little loss in accuracy.

Recursion Relations

The second and third methods in Brockwell & Davis (1991) rely on using recursion relations relating higher hh values to lower ones. We will not go into great depth regarding this method, but it is instructive to see how it might be applied to an AR(2) model. Let us begin with the AR(2) process xt=ϕ1xt1+ϕ2xt2+wtx_t = \phi_1 x_{t-1} + \phi_2 x_{t-2} + w_t. We can multiply through by xthx_{t-h} and take the expectation:

xtxth=ϕ1xt1xth+ϕ2xt2xth+wtxthE[xtxth]=E[ϕ1xt1xth]+E[ϕ2xt2xth]+E[wtxth]E[xtxth]=ϕ1E[xt1xth]+ϕ2E[xt2xth]+E[wtxth]γ(h)=ϕ1γ(h1)+ϕ2γ(h2)+E[wtxth].\begin{split} x_t x_{t-h} &= \phi_1 x_{t-1}x_{t-h} + \phi_2 x_{t-2}x_{t-h} + w_t x_{t-h}\\ \mathbb{E}[x_t x_{t-h}] &= \mathbb{E}[\phi_1 x_{t-1}x_{t-h}] + \mathbb{E}[\phi_2 x_{t-2}x_{t-h}] + \mathbb{E}[w_t x_{t-h}]\\ \mathbb{E}[x_t x_{t-h}] &= \phi_1\mathbb{E}[ x_{t-1}x_{t-h}] + \phi_2\mathbb{E}[x_{t-2}x_{t-h}] + \mathbb{E}[w_t x_{t-h}]\\ \gamma(h) &= \phi_1\gamma(h-1) +\phi_2 \gamma(h-2) + \mathbb{E}[w_t x_{t-h}]. \end{split}

Provided that our AR(2) process is causal (stationary), we can rewrite the final term in Eq. (7) as

E[wtxth]=E[wtj=0ψjwthj]=0.\mathbb{E}[w_t x_{t-h}] = \mathbb{E}\Big[w_t\sum_{j=0}^{\infty}\psi_j w_{t-h-j}\Big]=0.

Combining Eqs. (7) and (8) we arrive at the desired recursion relation

γ(h)=ϕ1γ(h1)+ϕ2γ(h2)\gamma(h) = \phi_1\gamma(h-1) +\phi_2 \gamma(h-2)

Without additional information, we cannot further simplify in Eq. (9). However, dividing through by γ(0)\gamma(0) generates a recursion relation for the autocorrelation

ρ(h)=ϕ1ρ(h1)+ϕ2ρ(h2).\rho(h) = \phi_1\rho(h-1) + \phi_2 \rho(h-2).

We know that ρ(0)=1\rho(0)=1, and we can evaluate ρ(1)\rho(1) using Eq. (9):

γ(1)=ϕ1γ(0)+ϕ2γ(1)=ϕ1γ(0)+ϕ2γ(1)(1ϕ2)γ(1)=ϕ1γ(0)γ(1)=ϕ11ϕ2γ(0)ρ(1)=ϕ11ϕ2\begin{split} \gamma(1) &= \phi_1 \gamma(0) + \phi_2 \gamma(-1)\\ &= \phi_1 \gamma(0) + \phi_2 \gamma(1)\\ (1-\phi_2)\gamma(1) &= \phi_1 \gamma(0)\\ \gamma(1) &= \frac{\phi_1}{1-\phi_2}\gamma(0)\\ \rho(1) &= \frac{\phi_1}{1-\phi_2}\\ \end{split}

Thus we can derive ρ(2)\rho(2) as

ρ(2)=ϕ121ϕ2+ϕ2,\rho(2) = \frac{\phi_1^2}{1-\phi_2} + \phi_2,

and continue extending the recursion relation to higher values of hh.

Footnotes
  1. The term “impulse response” comes from signal processing and denotes that fact that ψ(B)\psi(\mathbb{B}) dictates how noise, or an “impulse,” decays with time.

References
  1. Brockwell, P. J., & Davis, R. A. (1991). Time Series: Theory and Methods. In Springer Series in Statistics. Springer New York. 10.1007/978-1-4419-0320-4