Big picture: what you are trying to compute

When you have a time-ordered data series XtX_t​ (today, yesterday, two days ago, …), a common question is:

  • How strongly is $X_t$​ related to its past values $X_{t-1}, X_{t-2}, \dots$?

That relationship is summarized by the autocorrelation function (ACF):

  • ρ(h)\rho(h) = correlation between XtX_t and XthX_{t-h}
  • hh is the lag (how many time steps back)

Key facts:

  • ρ(0)=1\rho(0)=1 (a value is perfectly correlated with itself)
  • If ρ(h)\rho(h) is large in magnitude for some hh, the series has “memory” at that lag.
  • If ρ(h)\rho(h) quickly decays to 0, the series forgets quickly.

The model: AR(1) and AR(2) in plain words

White noise WtW_t

Think of WtW_t as the completely unpredictable “new shock” at time tt.
It has mean 0 and no correlation over time.

AR(1)

XtϕXt1=WtXt=ϕXt1+WtX_t – \phi X_{t-1} = W_t \quad\Longleftrightarrow\quad X_t = \phi X_{t-1} + W_t

Interpretation:

  • Today is a fraction ϕ\phi of yesterday, plus a new shock.

AR(2)

Xtϕ1Xt1ϕ2Xt2=WtXt=ϕ1Xt1+ϕ2Xt2+WtX_t – \phi_1 X_{t-1} – \phi_2 X_{t-2} = W_t \quad\Longleftrightarrow\quad X_t = \phi_1 X_{t-1} + \phi_2 X_{t-2} + W_t

Interpretation:

  • Today depends on the last two values, plus a new shock.

Why “causal” matters (in everyday terms)

A model is causal if XtX_t can be written using only today and earlier shocks:Xt=Wt+ψ1Wt1+ψ2Wt2+X_t = W_t + \psi_1 W_{t-1} + \psi_2 W_{t-2} + \cdots

So you do not need future information to define the present.

This is crucial for forecasting: a model that needs future shocks is not usable as a practical forward-looking model.


Two ways to get the ACF — and why this method is simpler

A standard method is:

  1. Rewrite XtX_t​ as an infinite sum of past shocks (ψ\psi-weights),
  2. Compute covariances from those weights.

That can be messy for anything beyond AR(1).

The alternative method here is cleaner:

Use the model equation itself to create a difference equation for ρ(h)\rho(h)

A “difference equation” is like a recurrence rule:

  • it tells you how ρ(h)\rho(h) relates to earlier values like ρ(h1)\rho(h-1), ρ(h2)\rho(h-2), etc.

Once you have that recurrence and a couple of starting values, you can compute the entire ACF.


Part A. AR(1): ACF via a difference equation

Start with:XtϕXt1=WtX_t – \phi X_{t-1} = W_t

Multiply both sides by XthX_{t-h}​ and take expectations.

For h1h\ge1, the key idea is:

  • WtW_t​ is independent of the past, and if the model is causal then XthX_{t-h}​ depends only on shocks at time tht-h and earlier.
  • So E(WtXth)=0E(W_t X_{t-h})=0 for h1h\ge1.

That gives:γ(h)ϕγ(h1)=0(h1)\gamma(h) – \phi \gamma(h-1) = 0 \quad (h\ge1)

Divide by γ(0)\gamma(0) to convert to ACF:ρ(h)ϕρ(h1)=0,ρ(0)=1\rho(h) – \phi \rho(h-1)=0,\quad \rho(0)=1

So:ρ(h)=ϕh(h0)\rho(h)=\phi^h \quad (h\ge0)

and by symmetry of correlation:ρ(h)=ϕh\rho(h)=\phi^{|h|}

Meaning: AR(1) correlations decay geometrically.


Part B. AR(2): difference equation for the ACF

Start with:Xtϕ1Xt1ϕ2Xt2=WtX_t – \phi_1 X_{t-1} – \phi_2 X_{t-2} = W_t

Do the same trick (multiply by XthX_{t-h}, take expectations). For h1h\ge1, again E(WtXth)=0E(W_t X_{t-h})=0 under causality, so you get:γ(h)ϕ1γ(h1)ϕ2γ(h2)=0\gamma(h)-\phi_1\gamma(h-1)-\phi_2\gamma(h-2)=0

Divide by γ(0)\gamma(0):ρ(h)ϕ1ρ(h1)ϕ2ρ(h2)=0,(h1)\rho(h)-\phi_1\rho(h-1)-\phi_2\rho(h-2)=0,\quad (h\ge1)

This is a second-order recurrence: each value depends on the previous two.

So if you know:

  • ρ(0)=1\rho(0)=1
  • ρ(1)=?\rho(1)=?

then you can compute ρ(2)\rho(2), then ρ(3)\rho(3), and so on.


How to get ρ(1)\rho(1) for AR(2)

Use the same recurrence at h=1h=1:ρ(1)ϕ1ρ(0)ϕ2ρ(1)=0\rho(1)-\phi_1\rho(0)-\phi_2\rho(-1)=0

And use the symmetry ρ(1)=ρ(1)\rho(-1)=\rho(1), plus ρ(0)=1\rho(0)=1:ρ(1)ϕ1ϕ2ρ(1)=0\rho(1)-\phi_1-\phi_2\rho(1)=0(1ϕ2)ρ(1)=ϕ1(1-\phi_2)\rho(1)=\phi_1ρ(1)=ϕ11ϕ2\rho(1)=\frac{\phi_1}{1-\phi_2}

Now you have the two starting points, and the recurrence generates all lags.


Closed-form “shape” of the ACF for AR(2)

To understand what ρ(h)\rho(h) looks like, you connect the recurrence to the roots of a polynomial.

Define the AR polynomial:ϕ(z)=1ϕ1zϕ2z2\phi(z)=1-\phi_1 z-\phi_2 z^2

Its roots r1,r2r_1, r_2​ determine the form of the solution.

Case 1: Two distinct real roots

If r1r2r_1\neq r_2​, then:ρ(h)=c1r1h+c2r2h,(h0)\rho(h)=c_1 r_1^{-h}+c_2 r_2^{-h},\quad (h\ge0)

This means the ACF is a sum of two decaying exponentials, possibly with sign changes depending on the roots.

Case 2: One repeated real root

If r1=r2=r0r_1=r_2=r_0​, then:ρ(h)=(c1+c2h)r0h,(h0)\rho(h)=(c_1+c_2 h) r_0^{-h},\quad (h\ge0)

So it’s still decaying, but the extra “hh” term can change the curvature.

Case 3: Complex conjugate roots

If the roots are complex conjugates, the ACF has the form:ρ(h)=Kβhcos(hΦ+Θ)\rho(h)=K\cdot \beta^h \cos(h\Phi+\Theta)

That is:

  • $\beta^h$ gives exponential decay
  • $\cos(\cdot)$ gives oscillation (alternating positive/negative in a wave pattern)

This explains why some AR(2) processes have an ACF that “wiggles” around zero while shrinking.


Why roots outside the unit circle means “causal”

The causality condition for AR(2) is:

  • both roots r1,r2r_1, r_2​ satisfy r1>1|r_1|>1 and r2>1|r_2|>1

Practical meaning:

  • the influence of past shocks fades over time instead of exploding
  • the process can be represented using past shocks only (no future terms needed)

What the examples are illustrating

Example 3.1 (real distinct roots, negative inverses)

You get something like:ρ(h)=c1(0.4)h+c2(0.9)h\rho(h)=c_1(-0.4)^h+c_2(-0.9)^h

Because the bases are negative, the sign flips as hh increases:

  • ACF alternates +/− and decays.

Example 3.2 (repeated root)

You get:ρ(h)=(1+0.83h)0.3h\rho(h)=(1+0.83h)\cdot 0.3^h

This is:

  • always positive (since 0.3h>00.3^h>0)
  • decays very fast, but the (1+0.83h)(1+0.83h) factor changes the early-lag shape.

Example 3.3 (complex roots)

You get:ρ(h)=Kβhcos(hΦ+Θ)\rho(h)=K\beta^h\cos(h\Phi+\Theta)

So the ACF:

  • oscillates (wave pattern)
  • shrinks over time (because βh\beta^h decays)

The practical “recipe” to compute an AR(2) ACF

  1. Check causality
    Find the roots of ϕ(z)=1ϕ1zϕ2z2\phi(z)=1-\phi_1 z-\phi_2 z^2.
    If both roots have magnitude >1>1, it is causal.
  2. Write the recurrence ρ(h)=ϕ1ρ(h1)+ϕ2ρ(h2)\rho(h)=\phi_1\rho(h-1)+\phi_2\rho(h-2)
  3. Set initial values
    • ρ(0)=1\rho(0)=1
    • ρ(1)=ϕ1/(1ϕ2)\rho(1)=\phi_1/(1-\phi_2)
  4. Either
    • compute ρ(h)\rho(h) recursively for as many lags as you want, or
    • use the closed-form formula based on the root type (distinct, repeated, complex)

Why this method is valuable

  • You avoid computing an infinite series representation of the process.
  • You get a direct recurrence rule for the ACF.
  • The root structure immediately explains the qualitative shape:
    • monotone decay,
    • alternating decay,
    • oscillatory decay.