insideout Get Pro

08 · Autoregressive models

Pro

Time Series, lesson 8

Autoregressive models

Predicting the next value from the last few.

You know autocorrelation, stationarity, and the form xₜ = φxₜ₋₁ + εₜ.

Part 1. Tomorrow from today

Take the model where tomorrow is φ ("phi") times today, plus a shock nobody can predict. Set φ and look at what it forecasts for the next 40 days.

An AR(1) forecastLive

The forecast is a steady slide toward the average: each step keeps φ of the gap. The band starts at the size of one shock and widens as shocks pile up, until the pull back balances them. At φ = 1 nothing pulls, so the band never stops widening.

AR(1)

An autoregressive model of order 1: xₜ = c + φxₜ₋₁ + εₜ, read "today is a constant, plus phi times yesterday, plus a fresh shock". With |φ| below 1 it's stationary, with average μ = c / (1 − φ).

Example 1.1

Forecasting with c = 1 and φ = 0.8

  1. μ=1 / (1 − 0.8)=5

    The long-run average.

  2. today 9→1 + 0.8 × 9=8.2 tomorrow

    One step: put today into the equation, with the shock at its average, zero.

  3. 5 + 0.8² × (9 − 5)=7.56

    Two steps: the gap from the average, 4, shrinks by φ each step. In general the h-step forecast is μ + φʰ(x − μ).

  4. 5 + 0.8¹⁰ × 4=5.43

    Ten steps out, the forecast has nearly reached the average.

Your turn

xₜ = 2 + 0.5xₜ₋₁ + εₜ, and today x = 10. What's the forecast two steps ahead?

The average is 2 / (1 − 0.5) = 4, and today's gap is 6. Two steps keep 0.5² = 0.25 of it: 4 + 0.25 × 6 = 5.5. Or step by step: 2 + 0.5 × 10 = 7, then 2 + 0.5 × 7 = 5.5.

Part 2. How many lags?

Keep going with Pro

You've done the first part. Pro opens the rest of this lesson, and every other one.

Still to come
  1. How many lags?
  2. A worked problem
  3. The same thing, for real

Time Series overviewSpotted a mistake? Tell us.