Hexa Scholar

Autocorrelation: how a series remembers its past

A clay hiker calls across a red-rock canyon while gold sound arcs travel toward the far wall.
A call and its echo: a signal compared with a delayed copy of itself.

The question

Three records, sixteen readings each: can you match each trace to its autocorrelation bars?

Make all your matches, then inspect the pairs behind each bar.

  1. 1 SeeMatch traces to ACF bars.
  2. 2 TryPredict, then change the memory.
  3. 3 ProveBuild the covariance recursion.
  4. 4 ApplyCompute and interpret the numbers.
Before you start · 3 quick checks on means, covariance and correlation

Two ideas before you start

2 ideas

A lag tells you which readings to pair

Two rows of readings, with lines joining observations the chosen lag apart.

Keep the time order. A lag is a separation in observation steps, not a distance between measured values.

Exact definition

A time series is a sequence of measurements \(x_1,\ldots,x_n\), ordered by time. Here readings are equally spaced and none are missing. At a whole-number lag \(k\), pair \(x_t\) with \(x_{t+k}\) for \(t=1,\ldots,n-k\). There are \(n-k\) pairs. Values beyond the record are left out; the end does not wrap around to the beginning.

Compare deviations from a common center

An example record shown as raw readings or deviations from its mean.

Use the mean of the whole record for both members of every pair. The ACF collects the resulting comparisons across lags.

Exact definition

Write \(\bar x\) for the average of all readings and \(d_t=x_t-\bar x\). The sample autocorrelation used on this page is

\[\begin{aligned} D&=\sum_{t=1}^{n}d_t^2,\\ N_k&=\sum_{t=1}^{n-k}d_t d_{t+k},\\ r_k&=N_k/D.\end{aligned}\]

This is defined for a nonconstant record and \(0\le k\lt n\). The numerator uses only available pairs; the denominator always uses the whole record. The autocorrelation function, or ACF, is the sequence of these values. This convention uses the same divisor in sample autocovariance and variance, so that divisor cancels.

Refresher: when a process has one ACF

A record is one observed sequence. A stochastic process \((X_t)\) describes the random readings before they are observed. It is weakly stationary if it has a constant finite mean, a constant finite variance, and a covariance between two times that depends only on their separation. With positive variance, write

\[\begin{aligned}\gamma(k)&=\operatorname{Cov}(X_t,X_{t+k}),\\ \rho(k)&=\gamma(k)/\gamma(0).\end{aligned}\]

Greek \(\rho\) describes the process; \(r_k\) describes a finite record. A sample ACF can be computed even when stationarity is not plausible. Interpreting it as an estimate of a fixed population ACF requires more care. Weak stationarity alone does not ensure that estimates from one long record converge to their population values.

1 See

Match the traces and the bars

The records are constructed examples, not measurements from a population. All traces share an observation axis; all ACF panels share a correlation scale. The bar at each lag comes from the formula in Start. The plotted traces and bars are the evidence for your matches; the answer key stays hidden until you submit.

2 Try

Give the process a memory rule

Now move from a record to a model. An autoregressive process of order one, written AR(1), obeys \(X_t=\phi X_{t-1}+\varepsilon_t\). The coefficient \(\phi\) multiplies the previous value. The new disturbance \(\varepsilon_t\) has mean zero and is uncorrelated with every earlier \(X_s\). Assume a zero-mean weakly stationary process, positive disturbance variance, and \(|\phi|\lt1\).

The population ACF and the explorer open after your prediction.

3 Prove

Why the same factor appears at every lag

Theorem: the stationary AR(1) ACF

Assume \((X_t)\), indexed by integer time, is weakly stationary with mean zero and finite variance \(v\gt0\). Suppose \(X_t=\phi X_{t-1}+\varepsilon_t\), where \(|\phi|\lt1\), \(E[\varepsilon_t]=0\), \(\operatorname{Var}(\varepsilon_t)=\tau^2\gt0\), and \(\operatorname{Cov}(\varepsilon_t,X_s)=0\) for every \(s\lt t\). Then

\[\begin{aligned}v&=\frac{\tau^2}{1-\phi^2},\\ \gamma(k)&=v\phi^k,\\ \rho(k)&=\phi^k\qquad(k\ge0).\end{aligned}\]

Here \(\gamma(k)=\operatorname{Cov}(X_t,X_{t+k})\). At \(k=0\), the power is defined to be one, including when \(\phi=0\). This theorem derives properties of a process satisfying the assumptions; it does not construct one from an arbitrary initial reading.

Stationarity is doing real work: it makes the variances at consecutive times equal and lets covariance depend on the lag alone. Covariance symmetry also gives \(\gamma(-k)=\gamma(k)\). Gaussian distributions are not needed for this argument. The result covers a zero coefficient as well as either sign.

4 Apply

Compute it, then interpret it

Use the page's full-record convention for sample questions. The process questions state their assumptions separately. Each problem accepts a decimal within its displayed tolerance and includes hints and a worked solution.

Connecting this lesson to other processes

Covariance and correlation compares two variables measured together. Autocorrelation applies that idea to different times of the same process. In a Markov chain, the present state determines the conditional law of the next state, but it need not be linearly related to that next state. The Markov property and the ACF describe different aspects of dependence.

For Brownian motion, the variance of the level grows with elapsed time. Its levels therefore do not have the stationary ACF defined here. Equally spaced, non-overlapping increments do have constant variance and are independent. Always ask whether a calculation concerns levels, changes, or residuals after a fitted trend.

Key point State which ACF you are computing, keep track of the available pairs, and check the assumptions before treating a sample pattern as a model property.
Level IntroPrerequisites covariance and correlation; stationarity refreshed in StartTime ~35 min

Further reading