Autocorrelation: how a series remembers its past
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 SeeMatch traces to ACF bars.
- 2 TryPredict, then change the memory.
- 3 ProveBuild the covariance recursion.
- 4 ApplyCompute and interpret the numbers.
Before you start · 3 quick checks on means, covariance and correlation
Two ideas before you start
2 ideasA 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.
Match the traces and the bars
- Compare the three traces with ACF panels A, B and C. Each panel is used once.
- Choose a panel for every trace, then press Check matches.
- After checking, choose a trace and lag to unfold its paired readings.
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.
Open one bar into its pairs
See every product in the numerator
A point in the upper-right or lower-left quadrant, formed by the dashed lines, has two deviations of the same sign and contributes a positive product; a point in the upper-left or lower-right quadrant contributes a negative product. A point on a dashed line contributes zero. Their distances from the dashed lines determine the sizes of those contributions. A negative ACF bar describes opposition across that lag, not necessarily a downward trend over time.
The scatterplot helps explain the numerator, but its ordinary Pearson correlation is generally a different statistic. Pearson correlation would recenter each shortened list and normalize by the spreads of those two lists. Here both means and the denominator stay tied to the complete record. Increasing the lag also reduces the number of pairs; a long-lag bar has less paired data behind it.
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.
Under these assumptions, the population ACF is \(\rho(k)=\phi^k\) for nonnegative whole-number lags, with \(\rho(0)=1\). Each extra lag multiplies the covariance by the same coefficient. The proof in the next stage explains why the new disturbance adds no covariance with an earlier reading.
- Set the memory coefficient and select a lag.
- Meet each goal, then advance to a fresh setting.
A positive coefficient gives positive correlation at every lag. A negative coefficient gives correlation whose sign alternates from one lag to the next. With magnitude below one, either pattern shrinks toward zero as the lag grows. A coefficient close to a boundary still lies inside the stationary range, but the model then retains correlation over many more steps.
What the model does not say
The assumptions used here require uncorrelated disturbances and past readings, not independence. They determine covariances, but do not by themselves determine a conditional distribution or every nonlinear forecasting rule. If disturbances are also independent of the past, the conditional mean of the next disturbance given the past readings is zero, and the conditional mean of the next reading given the past is \(\phi X_t\). This is a stronger assumption.
A zero population ACF at positive lags rules out linear correlation at those lags. It does not prove independence. Nor should the bars of a finite independent sample be expected to vanish exactly. This explorer shows no significance bands or hypothesis test.
Why the same factor appears at every lag
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.
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.
Further reading
- NIST/SEMATECH, e-Handbook of Statistical Methods, section 1.3.5.12, Autocorrelation, for the sample convention used here.
- P. J. Brockwell and R. A. Davis, Introduction to Time Series and Forecasting, chapter 2, “Stationary Processes.”