Hexa Scholar

MA models and the ACF cutoff

A row of six wooden drums on a dark stage; a gold mallet strikes the first drum, ripples spread across the first three drumheads, and the other three are still.
Strike one drum, and the ripples reach only its two neighbors.

The question

Two weights on past shocks: can you make the autocorrelation ≈ 0.54 at lag 1, ≈ 0.21 at lag 2, and 0 after?

Move two sliders, match the bars, then compare with an AR(1).

  1. 1 SeeMatch a target ACF with two weights.
  2. 2 TryProbe one weight, then read one record.
  3. 3 ProveBuild the proof, line by line.
  4. 4 ApplyRolling returns, bid-ask spreads and more.
Before you start · 3 quick checks on autocorrelation, a variance and the AR(1), about 3 min

Two ideas before you start

2 ideas

Each reading is a weighted sum of recent shocks

Figure: twelve shocks as thin bars and the readings built from them as a dashed line. It needs JavaScript.

θ:

Xₜ = εₜ + 0.8 εₜ₋₁

The thin bars are shocks: new, unpredictable pieces of noise. Each reading, on the dashed line, adds the newest shock to θ times the one before; with θ = 0 the readings are the shocks themselves.

Exact definition

White noise. A sequence \((\varepsilon_t)\) at integer times is white noise with variance \(\sigma^2 \gt 0\) if \(\operatorname{E}[\varepsilon_t] = 0\), \(\operatorname{Var}(\varepsilon_t) = \sigma^2\) and \(\operatorname{Cov}(\varepsilon_s, \varepsilon_t) = 0\) for \(s \ne t\). The shocks need not be independent or normal.

MA(\(q\)) model. For an integer \(q \ge 1\), real weights \(\theta_1, \dots, \theta_q\) with \(\theta_q \ne 0\) and a real mean \(\mu\),

\[\begin{aligned} X_t &= \mu + \varepsilon_t + \theta_1\varepsilon_{t-1} \\ &\qquad + \dots + \theta_q\varepsilon_{t-q}. \end{aligned}\]

It is a moving-average model of order \(q\). The MA(1) is \(X_t = \mu + \varepsilon_t + \theta\varepsilon_{t-1}\); the MA(2) adds the term \(\theta_2\varepsilon_{t-2}\). The card's figure uses fixed whole-number shocks \(\varepsilon_0, \dots, \varepsilon_{12}\), so that the arithmetic is easy to follow, and draws \(\varepsilon_1\) to \(\varepsilon_{12}\).

Readings share shocks only when they are close

Figure: a row of shocks, the three used by one reading and the three used by a reading k steps later, with the shared shocks shaded. It needs JavaScript.

Lag k:

Shared shocks: 2 γ(1) = σ²(θ₁ + θ₁θ₂)

In an MA(2), Xₜ uses the shocks at times t, t − 1 and t − 2 (solid bracket). A reading k steps later (dashed bracket) shares some of them only while k ≤ 2, and shared shocks are the only source of covariance.

Exact definition

Autocovariance and ACF. For a weakly stationary process, \(\gamma(k) = \operatorname{Cov}(X_t, X_{t+k})\) depends only on the lag \(k\), and the autocorrelation function (ACF) is \(\rho(k) = \gamma(k)/\gamma(0)\). The lessons on autocorrelation and stationarity define both.

The MA(2) values. With white-noise shocks of variance \(\sigma^2\),

\[\begin{aligned} \gamma(0) &= \sigma^2(1 + \theta_1^2 + \theta_2^2), \\ \gamma(1) &= \sigma^2(\theta_1 + \theta_1\theta_2), \\ \gamma(2) &= \sigma^2\theta_2, \end{aligned}\]

and \(\gamma(k) = 0\) for every \(k \ge 3\). Stage 3 proves the general version for an MA(\(q\)).

Fine print: the name, the shocks and the mean

"Moving average" is a historical name. The weights \(\theta_i\) need not be positive and need not add up to 1, so \(X_t\) is usually not an average in the everyday sense.

Every exact statement about \(\gamma\) and \(\rho\) on this page uses only the white-noise assumptions: mean 0, a constant variance and no correlation between different times. The simulations in 2 Try use the stronger assumption of independent standard normal shocks. The mean \(\mu\) shifts every reading by the same constant and does not change any covariance.

1 See

Match a target ACF

How the bars are computed

Your model is the MA(2) with white-noise shocks of variance \(\sigma^2\):

\[\begin{aligned} X_t &= \mu + \varepsilon_t + \theta_1\varepsilon_{t-1} \\ &\qquad + \theta_2\varepsilon_{t-2}. \end{aligned}\]

The bars are its exact ACF, from the formulas of the second idea card:

\[\begin{aligned} \rho(1) &= \frac{\theta_1 + \theta_1\theta_2}{1 + \theta_1^2 + \theta_2^2}, \\ \rho(2) &= \frac{\theta_2}{1 + \theta_1^2 + \theta_2^2}, \end{aligned}\]

and \(\rho(k) = 0\) for \(k \ge 3\). Neither \(\sigma^2\) nor \(\mu\) changes them. The target bars are the ACF of one MA(2) whose weights are on the sliders' grid of 0.05.

2 Try

One weight, then one record

A prediction first. The explorer below it opens once you check your answer.

From the model to one record

Every bar so far was a model value \(\rho(k)\). A data analyst sees one finite record and computes its sample ACF \(r_k\), with the full-record formula of the autocorrelation lesson. Predict first; the simulator opens when you check.

3 Prove

Why the ACF stops at lag q

Theorem

Assumptions. \((\varepsilon_t)\) is white noise at integer times: \(\operatorname{E}[\varepsilon_t] = 0\), \(\operatorname{Var}(\varepsilon_t) = \sigma^2 \gt 0\), and \(\operatorname{Cov}(\varepsilon_s, \varepsilon_t) = 0\) for \(s \ne t\). The order \(q \ge 1\) is an integer, \(\theta_0 = 1\), the weights \(\theta_1, \dots, \theta_q\) are real with \(\theta_q \ne 0\), \(\mu\) is real, and

\[X_t = \mu + \sum_{i=0}^{q} \theta_{i}\varepsilon_{t-i}.\]

Write \(\gamma(k) = \operatorname{Cov}(X_t, X_{t+k})\) and \(\rho(k) = \gamma(k)/\gamma(0)\).

Conclusion. \(\operatorname{E}[X_t] = \mu\), and for every \(t\),

\[\begin{aligned} \gamma(0) &= \sigma^2\sum_{i=0}^{q} \theta_{i}^2, \\ \gamma(k) &= \sigma^2\sum_{i=0}^{q-k} \theta_{i}\theta_{i+k} \\ &\qquad (1 \le k \le q), \\ \gamma(k) &= 0 \quad (k \gt q). \end{aligned}\]

So \((X_t)\) is weakly stationary, and since \(\gamma(q) = \sigma^2\theta_q \ne 0\), its ACF is nonzero at lag \(q\) and 0 at every lag beyond \(q\).

Facts the proof uses.

  1. Covariance is unchanged when a constant is added to either argument, and it is linear in each argument: \[\begin{aligned} &\operatorname{Cov}\Bigl(\sum_i a_iU_i, \sum_j b_jV_j\Bigr) \\ &= \sum_i\sum_j a_ib_j\operatorname{Cov}(U_i, V_j). \end{aligned}\]
  2. The variance of a sum of uncorrelated terms is the sum of their variances, and \(\operatorname{Var}(aU) = a^2\operatorname{Var}(U)\).
  3. \(\operatorname{E}[X_t] = \mu\) by linearity of expectation, since every \(\operatorname{E}[\varepsilon_{t-i}] = 0\).

Each option is one step of the proof. Pick the one that is true for every order \(q \ge 1\), all weights with \(\theta_q \ne 0\) and every \(\sigma \gt 0\).

What else follows
4 Apply

Problems

Lines 1 and 4 of the proof give every model value you need; the explorers in 2 Try show the MA(1) curve and Bartlett's band.

Key point An MA(\(q\)) ACF is \(\rho(k) = \sum_{i=0}^{q-k}\theta_i\theta_{i+k}\big/\sum_{i=0}^{q}\theta_i^2\) up to lag \(q\) and 0 after it. In the models of P2 and P3, overlapping sums and bid-ask bounce create this pattern in financial data, and in a sample the bars past the cutoff are judged against a band of width of order \(1/\sqrt{n}\).
Level Intermediate Prerequisites autocorrelation, stationarity, and covariance and correlation; the AR(1) ACF is refreshed in Before you start Time ~35 min

Further reading