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.

Intro to Autoregressive models

Up until now we’ve thought about signals in both the frequency and the time domain, and most recently we’ve been looking at decomposing signals into sinusoids and looking at power spectra. Today, we look at autoregressive models, which allow us to predict a signal from its past.

Autoregression = regression on self.

Ordinary regression: Y=XβY=X\beta

AR(1) process: xt=ϕxt1+wtx_t = \phi x_{t-1} + w_t

In the AR process, xtx_t can be written as a function of pp past values xt1,xt2,,xtpx_{t-1}, x_{t-2}, \dots, x_{t-p}. pp determines the number of steps in the past needed to forecast the current value. This is also called the order of the AR(pp) process.

AR(p) process: xt=ϕ1xt1+ϕ2xt2++ϕpxtp+wtx_t = \phi_1 x_{t-1} +\phi_2 x_{t-2} + \dots + \phi_p x_{t-p} + w_t

We can also add an intercept, α\alpha if xtˉ0\bar{x_t} \neq 0.

Let’s look at some examples of these in the accompanying Lecture 16 notebook. In the plot below, series A is white noise, series B is an AR(1) model with ϕ=0.9\phi=0.9, series C is a random walk (AR with ϕ=1\phi=1, which is not stationary, and series D is an AR(1) model with ϕ=0.8\phi=-0.8.

Example time series

AR(1) process

The simplest AR model is the AR(1) model, where xtx_t depends on ϕxt1\phi x_{t-1} plus some white noise (or “shock”). This could be used to look at temperature (if it’s 72 degrees F right now, what’s your best guess for one hour from now?), stock returns (if the market went up 2% today, what does that tell you about tomorrow?), etc.

What does ϕ\phi control?

ϕ\phiBehavior
ϕ=0\phi = 0White noise (no memory)
0<ϕ<10 < \phi < 1Positive memory - values drift slowly
ϕ1\phi \to 1Very long memory
ϕ=1\phi = 1Random walk (nonstationary)
1<ϕ<0-1 < \phi < 0Oscillatory memory - alternating values

So what happens if ϕ>1|\phi| > 1? In this case, the influence of past shocks doesn’t decay and the variance of xtx_t increases without bound. The AR(1) process is stationary iff ϕ<1|\phi| < 1. Below are some example AR1 time series from the accompanying lecture notebook:

Example AR1 time seriesExample AR1 time series for negative values of \phi

Some observations:

Properties of the stationary AR(1) model

When ϕ<1|\phi| < 1, we can derive closed-form expressions (see the derivations of these in your book, Ch 3 example 3.1):

PropertyFormula
Meanμx=0\mu_x = 0 (assuming zero-mean)
Varianceγ(0)=σw21ϕ2\gamma(0) = \frac{\sigma_w^2}{1 - \phi^2}
Autocovarianceγ(h)=σw2ϕh1ϕ2\gamma(h) = \frac{\sigma_w^2\phi^h}{1 - \phi^2} for h0h\geq 0
ACFρ(h)=γ(h)γ(0)=ϕh\rho(h) = \frac{\gamma(h)}{\gamma(0)} = \phi^{h}

Note that the ACF of an AR(1) process decays exponentially! We can also see here that ϕ<1|\phi| < 1 is needed for stationarity, because the denominator in the variance equation goes to zero as ϕ1|\phi| \to 1. Let’s look at an example for the ACF in the notebook.

Example ACF for AR(1) process with phi=0.9

The backshift operator

Next, to look into the properties of the AR models, we’re going to define the backshift operator BB:

Bxt=xt1B x_t = x_{t-1}

Then we can rewrite the AR(1) model as:

xtϕxt1=wtxtϕBxt=wt(1ϕB)xt=wt\begin{aligned} x_t - \phi x_{t-1} &= w_t\\ x_t - \phi B x_t &= w_t\\ (1 - \phi B) x_t &= w_t \end{aligned}

or the AR(p) model:

(1ϕ1Bϕ2B2ϕpBp)xt=wt(1 - \phi_1 B - \phi_2 B^2 - \dots - \phi_p B^p) x_t = w_t

The autoregressive operator/characteristic polynomial

We then define the autoregressive operator as:

ϕ(B)=(1ϕ1Bϕ2B2ϕpBp)\phi(B) = (1 - \phi_1 B - \phi_2 B^2 - \dots - \phi_p B^p)

so we have ϕ(B)xt=wt\phi(B)x_t=w_t

This is also sometimes called the characteristic polynomial because we can use it to find the roots of the polynomial, which will then tell us some more interpretable information about stationarity and oscillatory frequency. Let’s first consider the AR(1) model. There we have:

ϕ(B)=(1ϕ1B)\phi(B) = (1 - \phi_1 B)

The root is at B=1/ϕB = 1/\phi.

Important: For stationarity, we require all roots to lie outside the unit circle, that is, 1/ϕ>1    ϕ<1|1/\phi| > 1 \iff |\phi| < 1.

Now let’s try this with an AR(2) model:

xt=ϕ1xt1+ϕ2xt2+wtx_t = \phi_1 x_{t-1} + \phi_2 x_{t-2} + w_t

the characteristic polynomial is:

ϕ(B)=(1ϕ1Bϕ2B2)\phi(B) = (1 - \phi_1 B - \phi_2 B^2)

Now when we solve for the roots of this polynomial, we could potentially get:

  1. Two real roots (overdamped behavior) - this means the process will decay smoothly back to the mean without oscillating

  2. Complex conjugate roots - this will lead to oscillatory decay

Example AR(2) model

Let’s try an example:

xt=0.6xt10.5xt2+wtx_t = 0.6 x_{t-1} -0.5x_{t-2} + w_t

We will do the following:

  1. Write the characteristic polynomial

  2. Find its roots. Are they real or complex?

  3. Is this process stationary?

  4. What kind of behavior do you expect?

Characteristic polynomial:

ϕ(B)=(10.6B+0.5B2)\phi(B) = (1 - 0.6 B + 0.5 B^2)

We then solve for its roots using the quadratic formula. For this particular AR(2) model, we get complex roots:

0=0.6±(0.6)24(0.5)(1)2(0.5)0=\frac{0.6 \pm \sqrt{(-0.6)^2 - 4(0.5)(1)}}{2(0.5)}

The roots are 0.6±1.28i0.6 \pm 1.28i, which are complex. The modulus tells us whether the process is stationary:

z=a2+b2=0.62+1.282=1.41|z| = \sqrt{a^2+b^2} = \sqrt{0.6^2 + 1.28^2} = 1.41

Because this is greater than 1, we determine that yes, the process is indeed stationary. The modulus also has another intuitive meaning - a modulus closer to 1 means less damping and a more persistent oscillation, whereas a modulus closer to 0 means more damping (the signal dies out fast).

Next time - ARMA

Next time, we will discuss AR(p) models and the extension to ARMA models, which include a moving average comopnent that allows us to also model recent shocks in our autoregressive process.