The Correlogram (Sample ACF)
The
autocorrelation
function is a property of the process — a truth we can never see directly. What we
actually have is one finite stretch of data, and from it we compute an estimate: the
sample ACF. Plot that estimate against lag and you get the single most-used diagnostic
in all of time series, the correlogram. It is the first thing a practitioner draws when
a new series lands on the desk, because its shape announces — at a glance — whether there is a trend, a
season, or nothing but noise.
The whole skill is learning to read it: which spikes are real signal and which are just the random
jitter that any finite sample produces even when the truth is zero. That reading is what this
lesson builds.
Estimating the autocorrelation
Given observations x_1, \dots, x_T with sample mean
\bar{x}, the sample autocovariance at lag
h is
\hat{\gamma}(h) = \frac{1}{T} \sum_{t=1}^{T-h} (x_t - \bar{x})(x_{t+h} - \bar{x}),
and the sample ACF — the height of each spike in the correlogram — is
r_h = \frac{\hat{\gamma}(h)}{\hat{\gamma}(0)}.
Two details repay attention. The divisor is T, not
T - h, even though only T - h product terms appear in
the sum. That deliberate choice slightly shrinks estimates at long lags, but it guarantees the estimated
\hat{\gamma} sequence is
positive
semi-definite — a valid autocovariance, as any real one must be. And precisely because each
r_h uses fewer terms as h grows, the estimates get
noisier at large lags: trust the left of the plot far more than the right.
Reading the plot
A correlogram is a stem plot: a vertical spike at each lag h
rising to height r_h, always starting with r_0 = 1.
The dashed horizontal lines are the significance bands. Under the null hypothesis that
the series is white noise, each r_h is approximately normal with mean zero and
standard error 1/\sqrt{T} (Bartlett's result), so a 95% band sits at
\pm \frac{1.96}{\sqrt{T}}.
A spike poking outside the band is evidence of genuine autocorrelation at that lag; a spike
inside is consistent with pure chance. In the figure below (a made-up example with
T = 100, so the band is at
\pm 0.196), the early lags clearly break through while the rest rattle around
harmlessly inside the fence.
Three canonical shapes cover most of what you will ever see, and each has an unmistakable silhouette.
The three tell-tale shapes
- White noise: every spike beyond lag 0 sits inside the bands — no structure to
model. This is the target you difference and transform towards.
- Trend / non-stationarity: the ACF starts near 1 and
decays very slowly, staying positive across many lags. Slow decay screams "not stationary —
difference me first."
- Seasonality: spikes recur at the seasonal lag and its multiples — a large
r_{12}, r_{24}, \dots for monthly data with a yearly cycle — a comb of
peaks poking out at regular spacing.
A gradually tapering ACF suggests an
autoregressive
component; a sharp cut-off after a few lags suggests a
moving-average
one. Reading these silhouettes is the heart of the
Box–Jenkins
model-identification procedure.
Worked example: is lag 1 significant?
Suppose you have T = 144 monthly observations and your software reports
r_1 = 0.31, r_2 = 0.12,
r_5 = -0.10. The band is
\pm \frac{1.96}{\sqrt{144}} = \pm \frac{1.96}{12} \approx \pm 0.163.
Compare: |r_1| = 0.31 > 0.163 — outside the band, so the
lag-1 correlation is significant, real dependence. |r_2| = 0.12 < 0.163 and
|r_5| = 0.10 < 0.163 — both inside, consistent with noise.
Conclusion: there is genuine one-step memory here, but nothing convincing beyond it — a profile that
points toward a low-order model. Notice how the verdict hinges entirely on the sample size: with only
T = 36 observations the band would balloon to
\pm 0.327 and that same r_1 = 0.31 would not
clear it. More data, tighter fence, sharper eyes.
The bands are drawn so that, if the series really is white noise, each individual spike has a 5%
chance of poking out by luck alone. But a correlogram shows dozens of lags at once. Across 40 lags of
genuine white noise you should expect about 0.05 \times 40 = 2 spikes
to breach the band purely by chance — and seeing a couple of stray breaches is therefore not
evidence of structure. This is the multiple-comparisons trap: hunt through enough lags and you will
always find a "significant" one to over-interpret. Two defences: judge the pattern (a lone
random breach at lag 23 is noise; a clean spike at lag 12 and 24 is seasonality), and use a
joint test across many lags at once — the
Ljung–Box
portmanteau test — rather than eyeballing spikes one by one.
It looks like a mistake. You are averaging T - h product terms but dividing by
T, which biases each \hat\gamma(h) a little toward
zero — worse at long lags. Why accept a biased estimator on purpose? Because the alternative,
dividing by T - h, can produce an estimated autocovariance sequence
that is not positive semi-definite — an "impossible" ACF that no real process could own, which then
wrecks anything downstream that assumes a valid covariance (spectral estimates going negative, model
fits failing). The 1/T version is guaranteed valid. It is a classic
statistician's trade: swallow a touch of bias to keep a structural guarantee that actually matters. The
gentle down-weighting of far-lag estimates is a feature, not a bug — those are the estimates you trust
least anyway.