skip to content

Autocorrelation and Lags

How strongly a series correlates with its own past at each lag, read off ACF and PACF plots and tested for leftover signal with Ljung-Box. It is how model order gets chosen.

on this pageshow

questions

5

What is the difference between the ACF and the PACF of a time series?

level: middleimportance: must knowfreq 78%

answer

  1. one is total, one is direct
  2. intermediate lags held constant
  3. echoes through lag 1 inflate lag 2
  4. one decays while the other cuts off
  5. AR(1) decays in ACF, cuts off in PACF

basics

~20 s

The ACF measures the correlation between a series and its own values k steps earlier, including everything routed through the intermediate lags. The PACF measures that same lag-k correlation after the effect of lags 1 through k-1 has been removed.

solid answer

~50 s

The autocorrelation function (ACF) at lag k is the correlation between `y_t` and `y_{t-k}`. It is a *total* correlation: if today depends on yesterday and yesterday on the day before, the ACF at lag 2 picks up that indirect chain. The partial autocorrelation function (PACF) at lag k is that same correlation with lags 1 through k-1 held constant, so it isolates the *direct* link. That is why the pair is read together. A stationary AR(1) has an ACF decaying geometrically as `phi^k` while its PACF cuts off after lag 1 — only the one-step link is real. An MA(1) shows the mirror image: the ACF cuts off after lag 1 and the PACF decays. A sharp cut-off in one function alongside a slow decay in the other is the fingerprint that tells you which kind of lag structure you are looking at.

go deeper

for a junior

Be ready to say in one sentence that autocorrelation is a series correlated with its own earlier values, and that lag k means shifted by k periods. Knowing the ACF exists and is plotted as a correlogram is enough here.

for a middle

Explain the mechanics: total versus direct correlation, why the PACF conditions on the intermediate lags, and the AR-decays-in-ACF versus MA-decays-in-PACF signatures. Expect to be asked why lag 1 is identical in both.

for a senior

Show judgment about when the plots are readable at all. Point out that a trend or drifting variance dominates the correlogram, that single bars are noisy estimates, and that you read the shape across several lags rather than adjudicating one spike.

for a principal

Own the framing question: what does lag structure buy you here. Be ready to argue when a correlogram-driven classical model is the right baseline versus when the signal is nonlinear or driven by external covariates that no self-correlation plot will surface.

## The two functions A time series is a sequence of observations `y_1, y_2, ..., y_n` recorded in order. **Autocorrelation** is the correlation of that series with a shifted copy of itself. Shifting by k periods gives the **lag-k autocorrelation**, written `r_k`, and the whole set of values `r_1, r_2, r_3, ...` plotted against k is the **autocorrelation function (ACF)**. The plot is called a *correlogram*. For a series with sample mean `ybar`, the usual estimate is ``` r_k = sum_{t=k+1..n} (y_t - ybar)(y_{t-k} - ybar) / sum_{t=1..n} (y_t - ybar)^2 ``` Note the denominator uses all n terms, so `r_0 = 1` always and `|r_k| <= 1`. This estimator assumes the series is *stationary* — that its mean, variance and lag structure do not drift over time — because a single mean `ybar` is subtracted everywhere. The **partial autocorrelation function (PACF)** answers a different question. Its value at lag k, often written `phi_kk`, is the correlation between `y_t` and `y_{t-k}` **after the linear effect of the intermediate lags** `y_{t-1}, ..., y_{t-k+1}` has been removed from both. Operationally it is the coefficient on `y_{t-k}` when you regress `y_t` on all lags up to k. At lag 1 the two functions agree, because there is nothing in between to remove; from lag 2 onward they diverge. ## Why total and direct differ Suppose each day's value is 0.8 times yesterday's plus noise — an AR(1) process with `phi = 0.8`. Then: - The ACF at lag 1 is about 0.8. - The ACF at lag 2 is about 0.64, and at lag 3 about 0.51. Nothing in the process links today directly to two days ago; the correlation is inherited through yesterday. In general the ACF of a stationary AR(1) is `phi^k`, a geometric decay. - The PACF at lag 1 is 0.8. At lag 2 and beyond it is essentially zero, because once yesterday is held fixed, two days ago adds nothing. So the ACF shows a long tail of correlations that are all echoes of one real dependency, and the PACF strips the echoes away. Now reverse the mechanism: a moving-average process, MA(1), where today equals the noise term today plus `theta` times the noise term from yesterday. Two observations two steps apart share no noise term at all, so the ACF is exactly zero from lag 2 onward — a sharp cut-off. Its lag-1 value is `theta / (1 + theta^2)`, which is bounded between -0.5 and 0.5. The PACF of an MA(1), by contrast, tails off gradually, often alternating in sign. ## The reading rule This gives the classic identification pattern: | Pattern | ACF | PACF | |---|---|---| | Autoregressive character | decays gradually | cuts off after a few lags | | Moving-average character | cuts off after a few lags | decays gradually | | Mixed | decays | decays | | White noise | all bars inside the bands | all bars inside the bands | "Cuts off" means the bars drop inside the significance bands and stay there; "decays" means they shrink toward zero without a clean break. The number of lags before the cut-off is what indicates how many terms of that type the lag structure carries. ## Practical cautions **Stationarity first.** On a trending series the ACF is dominated by the trend: every short lag is large and positive and the decay is glacially slow, because two nearby points are both above the overall mean or both below it. That says "there is a trend", not "there is an AR structure". The lag structure only becomes readable once the series has been made roughly level. **Both plots, always.** Reading one alone is ambiguous. A single ACF spike at lag 1 could be the cut-off of a moving-average structure or the first step of a decay you have not seen enough of; the PACF disambiguates it. **Sampling noise.** Sample ACF and PACF values are estimates from finite data. Individual bars wobble, longer lags are estimated from fewer overlapping pairs, and a textbook-clean cut-off is rarer in real data than in exam questions. Judge the *shape* across the first several lags rather than adjudicating single bars. **Not a causal statement.** A large lag-k autocorrelation says the series carries predictable structure at that spacing. It does not say the past causes the present in any mechanistic sense — a shared seasonal driver or a slow-moving external factor produces the same picture.

  • Why do the ACF and PACF always agree at lag 1?
    At lag 1 there are no intermediate lags to condition on, so removing their effect removes nothing. The partial autocorrelation at lag 1 is by construction the same quantity as the ordinary lag-1 autocorrelation. The two functions can only separate from lag 2 onward, where lag 1 sits between the two points being compared.
  • What do the ACF and PACF of pure white noise look like?
    Both are essentially zero at every lag beyond lag 0, with all bars falling inside the significance bands apart from the occasional chance crossing. That is the null picture you compare everything against: if a correlogram is indistinguishable from it, the series carries no linear structure worth modelling at those lags.
  • Why can a strong trend make the ACF useless for identifying lag structure?
    A trending series has a mean that moves, but the estimator subtracts one global mean from every observation. Long stretches sit entirely above or below that mean, so nearby points are strongly correlated at every short lag and the ACF decays extremely slowly. The plot then describes the trend, and any genuine short-lag structure is buried underneath it.

The ACF is asking how much a rumour you hear today resembles the rumour from three days ago, counting the whole chain of retellings. The PACF asks how much of that resemblance survives once you account for what was said on the two days in between.

saying these in an interview costs you the question

  • Saying the ACF and PACF are just two names for the same plot
  • Claiming a large lag-2 ACF proves a direct two-step dependency
  • Reading lag structure off a strongly trending series without comment
  • Swapping the signatures: claiming AR shows an ACF cut-off
  • Treating autocorrelation as evidence that the past causes the present

context

open as a page

Your forecast model's residuals fail a Ljung-Box test at lag 10 — what does that mean?

level: seniorimportance: must knowfreq 58%

basics

~20 s

It means the residuals still carry autocorrelation somewhere in the first ten lags, so the model has left predictable structure behind. The Ljung-Box null is that all those residual autocorrelations are zero; a small p-value rejects it.

open as a page

What do the dashed confidence bands on an ACF correlogram represent?

level: juniorimportance: should knowfreq 52%

basics

~20 s

They mark how large a sample autocorrelation can get by chance if the series were white noise. The band is plus or minus 1.96 over the square root of n, so a bar inside it is indistinguishable from noise.

open as a page

What does an ACF with large spikes at lags 12 and 24 tell you about monthly data?

level: middleimportance: should knowfreq 45%

basics

~20 s

Spikes at lags 12 and 24 on monthly data mean each month resembles the same month one and two years earlier: an annual cycle of period 12. A seasonal period shows up at its multiples.

open as a page

After differencing, a series has a lag-1 autocorrelation near -0.5. What does that suggest?

level: seniorimportance: nice to knowfreq 26%

basics

~10 s

A large negative lag-1 autocorrelation right after differencing is the classic signature of over-differencing: the series was already level enough, and the extra difference injected artificial negative correlation and inflated the variance.

open as a page