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.

Chapter 11 — Autoregressive Models

In previous chapters, we studied:

We are now ready to build formal stochastic models for stationary time series.

One of the most important and widely used classes of models is the autoregressive (AR) model.

Many economic and financial variables adjust gradually rather than instantaneously. Inflation, unemployment, interest rates, exchange rates, and GDP growth all tend to exhibit inertia or persistence.

Autoregressive models capture this gradual adjustment process mathematically.


Learning Objectives

By the end of this chapter, you should be able to:


11.1 The Basic Idea

A simple model is:

xt=ϕxt1+wtx_t = \phi x_{t-1} + w_t

where:


11.2 The AR(1) Model

Mean

E[xt]=μ1ϕE[x_t] = \frac{\mu}{1-\phi}

11.3 Mean-Centered Form

xt=ϕxt1+wtx_t = \phi x_{t-1} + w_t

11.4 Recursive Representation (Key Insight)

By repeated substitution:

xt=j=0ϕjwtjx_t = \sum_{j=0}^{\infty} \phi^j w_{t-j}

11.5 Stationarity


11.6 Simulation

Source
import numpy as np
import matplotlib.pyplot as plt

np.random.seed(123)

n = 300
w = np.random.normal(size=n)

phis = [0.2, 0.7, 0.95]

fig, ax = plt.subplots(3,1, figsize=(10,8))

for i, phi in enumerate(phis):

    x = np.zeros(n)

    for t in range(1,n):
        x[t] = phi*x[t-1] + w[t]

    ax[i].plot(x)
    ax[i].set_title(f"AR(1), phi={phi}")

plt.tight_layout()

plt.savefig("figs/ch10/persistence.png", dpi=300, bbox_inches="tight")
plt.close()   # replace with plt.show()
Persistence

11.7 Variance

Var(xt)=σw21ϕ2Var(x_t) = \frac{\sigma_w^2}{1-\phi^2}

11.8 ACF of AR(1)

ρ(h)=ϕh\rho(h) = \phi^h

11.9 Simulated ACF

Source
from statsmodels.graphics.tsaplots import plot_acf

plot_acf(x, lags=30)

plt.savefig("figs/ch10/acf.png", dpi=300, bbox_inches="tight")
plt.close()   # replace with plt.show()
ACF

11.10 PACF of AR(1)


11.11 AR(2) Model

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

11.12 AR(2) Simulation

Source
np.random.seed(123)

phi1, phi2 = 1.0, -0.6
n = 1000

w = np.random.normal(size=n)
x = np.zeros(n)

for t in range(2,n):
    x[t] = phi1*x[t-1] + phi2*x[t-2] + w[t]

plt.plot(x)
plt.title("AR(2)")

plt.savefig("figs/ch10/ar2.png", dpi=300, bbox_inches="tight")
plt.close()   # replace with plt.show()
AR2

11.13 ACF and PACF for AR(2)

Source
from statsmodels.graphics.tsaplots import plot_pacf

plot_acf(x, lags=30)
plot_pacf(x, lags=30)

plt.savefig("figs/ch11/ar2_acf_pacf.png", dpi=300, bbox_inches="tight")
plt.close()   # replace with plt.show()
AR2 acf pacf

11.14 General AR(p)

xt=i=1pϕixti+wtx_t = \sum_{i=1}^p \phi_i x_{t-i} + w_t

11.15 Estimation in Python

Source
from statsmodels.tsa.ar_model import AutoReg

model = AutoReg(x, lags=2)
res = model.fit()

print(res.summary())
                            AutoReg Model Results                             
==============================================================================
Dep. Variable:                      y   No. Observations:                 1000
Model:                     AutoReg(2)   Log Likelihood               -1416.520
Method:               Conditional MLE   S.D. of innovations              1.000
Date:                Mon, 04 May 2026   AIC                           2841.040
Time:                        21:40:24   BIC                           2860.663
Sample:                             2   HQIC                          2848.499
                                 1000                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
const         -0.0386      0.032     -1.218      0.223      -0.101       0.024
y.L1           1.0000      0.026     38.890      0.000       0.950       1.050
y.L2          -0.5850      0.026    -22.746      0.000      -0.635      -0.535
                                    Roots                                    
=============================================================================
                  Real          Imaginary           Modulus         Frequency
-----------------------------------------------------------------------------
AR.1            0.8547           -0.9894j            1.3074           -0.1366
AR.2            0.8547           +0.9894j            1.3074            0.1366
-----------------------------------------------------------------------------

11.16 Residual Diagnostics

Source
from statsmodels.stats.diagnostic import acorr_ljungbox

lb = acorr_ljungbox(res.resid, lags=[10,20], return_df=True)
lb
|  | lb_stat   | lb_pvalue |
|---------|------------|-----------|
| 10      | 6.476702   | 0.773750  |
| 20      | 18.268325  | 0.569737  |

11.17 Information Criteria

AIC=2logL+2kAIC = -2\log L + 2k
BIC=2logL+klognBIC = -2\log L + k\log n

11.18 Common Mistakes


11.19 Looking Ahead

Next:


Key Takeaways

Concept Check

Basic

  1. What is an autoregressive (AR) model?

  2. What does the parameter ϕ\phi represent in an AR(1) model?

  3. What is the role of the error term wtw_t?


Intuition

  1. What does it mean for a time series to exhibit persistence?

  2. How does the value of ϕ\phi affect the behavior of the series?

  3. What happens when ϕ\phi is:

    • close to zero

    • close to one

    • negative


Intermediate

  1. What is the stationarity condition for an AR(1) model?

  2. Why must shocks decay over time in a stationary process?

  3. What is the difference between:

    • AR(1)

    • AR(2)


ACF & PACF

  1. What pattern does the ACF of an AR(1) process exhibit?

  2. What pattern does the PACF of an AR(1) process exhibit?

  3. Why does the PACF “cut off” for an AR process?


Finance Insight

  1. Why are AR models useful in modeling economic or financial time series?

  2. Why is strong persistence sometimes mistaken for a trend?


Challenge

  1. Suppose ϕ=0.98\phi = 0.98.


Interpretation & Practice

  1. A time series shows gradual adjustment after shocks.

    • What type of model might describe this?

    • Why?

  2. A series appears highly persistent but does not trend upward.

    • What does this suggest about ϕ\phi?

    • Is the series likely stationary?

  3. ACF decays slowly and smoothly.

    • What type of process might this indicate?

  4. PACF shows a large spike at lag 1 and near zero afterward.

    • What model is suggested?

  5. ACF shows a wavy, oscillating pattern.

    • What type of model might generate this?

  6. After fitting an AR model, residuals still show autocorrelation.

    • What does this imply?

    • What should you do?


Finance Interpretation

  1. A return series shows small but positive autocorrelation.

    • What does this imply about predictability?

    • Is this consistent with market efficiency?

  2. A volatility series shows strong persistence.

    • Why might an AR-type structure be useful?


Challenge

  1. A model fits the data well but produces poor forecasts.

    • What might be wrong?

    • What does this suggest about overfitting?


Numerical Practice

AR(1) Simulation Logic

  1. Consider the AR(1) process:

xt=0.5xt1+wtx_t = 0.5 x_{t-1} + w_t

with:



  1. Repeat with:

xt=0.9xt1+wtx_t = 0.9 x_{t-1} + w_t

Persistence

  1. Suppose:

xt=ϕxt1+wtx_t = \phi x_{t-1} + w_t


ACF Interpretation

  1. Suppose you observe:



Model Identification

  1. You observe:



Estimation Output

  1. Suppose an estimated AR(1) model gives:

xt=0.85xt1+wtx_t = 0.85 x_{t-1} + w_t


Diagnostics

  1. Suppose the residuals from an AR model show:



Challenge

  1. Suppose ϕ>1\phi > 1.


  1. Suppose you include too many lags in an AR model.


Appendix 11A — Mathematical Details of AR Models

This appendix provides additional insight into the properties of autoregressive models.

These results are not required for basic understanding, but they help explain why AR models behave the way they do.


A.1 Recursive Representation of AR(1)

Consider:

xt=ϕxt1+wtx_t = \phi x_{t-1} + w_t

Substitute repeatedly:

xt=ϕ(ϕxt2+wt1)+wt=ϕ2xt2+ϕwt1+wtx_t = \phi(\phi x_{t-2} + w_{t-1}) + w_t = \phi^2 x_{t-2} + \phi w_{t-1} + w_t

Continuing:

xt=j=0ϕjwtjx_t = \sum_{j=0}^{\infty} \phi^j w_{t-j}

A.2 Stationarity Condition

From the recursive form:

xt=j=0ϕjwtjx_t = \sum_{j=0}^{\infty} \phi^j w_{t-j}

For this to converge, we require:

ϕ<1|\phi| < 1

A.3 Mean of AR(1)

Consider:

xt=ϕxt1+μ+wtx_t = \phi x_{t-1} + \mu + w_t

Take expectations:

E[xt]=ϕE[xt1]+μE[x_t] = \phi E[x_{t-1}] + \mu

In equilibrium:

E[xt]=E[xt1]=xˉE[x_t] = E[x_{t-1}] = \bar{x}

So:

xˉ=ϕxˉ+μ\bar{x} = \phi \bar{x} + \mu
xˉ=μ1ϕ\bar{x} = \frac{\mu}{1-\phi}

A.4 Variance of AR(1)

From:

xt=ϕxt1+wtx_t = \phi x_{t-1} + w_t

Take variance:

Var(xt)=ϕ2Var(xt1)+σw2Var(x_t) = \phi^2 Var(x_{t-1}) + \sigma_w^2

In steady state:

Var(xt)=σx2Var(x_t) = \sigma_x^2

So:

σx2=ϕ2σx2+σw2\sigma_x^2 = \phi^2 \sigma_x^2 + \sigma_w^2
σx2=σw21ϕ2\sigma_x^2 = \frac{\sigma_w^2}{1-\phi^2}

A.5 Autocovariance Function

We define:

γ(h)=Cov(xt,xth)\gamma(h) = Cov(x_t, x_{t-h})

Multiply the AR(1) equation by xthx_{t-h}:

Cov(xt,xth)=ϕCov(xt1,xth)Cov(x_t, x_{t-h}) = \phi Cov(x_{t-1}, x_{t-h})

Thus:

γ(h)=ϕγ(h1)\gamma(h) = \phi \gamma(h-1)

Iterating:

γ(h)=ϕhγ(0)\gamma(h) = \phi^h \gamma(0)

A.6 Autocorrelation Function

Since:

ρ(h)=γ(h)γ(0)\rho(h) = \frac{\gamma(h)}{\gamma(0)}

we obtain:

ρ(h)=ϕh\rho(h) = \phi^h

A.7 Yule–Walker Equation (AR(1))

At lag 0:

γ(0)=ϕ2γ(0)+σw2\gamma(0) = \phi^2 \gamma(0) + \sigma_w^2

Rearranging:

γ(0)(1ϕ2)=σw2\gamma(0) (1 - \phi^2) = \sigma_w^2

This gives the variance result above.


A.8 AR(2): Intuition and Dynamics

Consider:

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

Unlike AR(1), this process can generate:


A.9 Characteristic Equation

For AR(p):

xt=ϕ1xt1++ϕpxtp+wtx_t = \phi_1 x_{t-1} + \cdots + \phi_p x_{t-p} + w_t

We define the characteristic equation:

1ϕ1zϕ2z2ϕpzp=01 - \phi_1 z - \phi_2 z^2 - \cdots - \phi_p z^p = 0

A.10 Why This Matters