Art of DS

Appearance

Palette
Theme
Unlock $20 one time
Sign in, or create an account

Sign in to Art of DSCreate your Art of DS account

We email you a link and a six-digit code. Either one signs you in; there is no password.Enter your email. We send a link and a six-digit code to confirm it — no password to remember. The account is free.

  • You come back to this page, right where you were.
  • Already have an account? The same email simply signs you in.

By continuing you accept the Terms and the Privacy policy.

Your account

Free accountLifetime access

difficulty 3/5

Autocorrelation

Definition

The correlation of a series with a shifted copy of itself. It is how you find a cycle you were not told about, and how you discover that your sample size is smaller than you thought.

Formula
rk=∑t(yt−yˉ)(yt+k−yˉ)∑t(yt−yˉ)2r_k = \frac{\sum_{t} (y_t - \bar{y})(y_{t+k} - \bar{y})}{\sum_{t} (y_t - \bar{y})^2}

Intuition

If today's value was high, is tomorrow's likely to be high too? That is a correlation question, and the only unusual thing about it is that both variables come from the same series — one shifted against the other.

Think Stats calls the lag-1 case serial correlation, "because each value is correlated with the next one in the series" [1, §12.6], and notes that "'autocorrelation' is another name for serial correlation, used more often when the lag is not 1" [1, §12.7].

Computing it at every lag at once turns a vague question into a picture: "if you think a series might have some serial correlation, but you don't know which lags to test, you can test them all! The autocorrelation function is a function that maps from lag to the serial correlation with the given lag" [1, §12.7].

Two very different things come out of that picture. One is cycles — a weekly pattern nobody documented. The other is a warning: if your observations are correlated, you have fewer of them than you counted, and every interval and p-value computed from them is too narrow.

Formal definition

How it works

Where it's used

Why & when

Worked example

Pitfalls

Check yourself

3 questions

The questions on this page come with access. They are graded on the server, so the answers stay there until you have given yours.

Unlock all quizzes

Sources

  1. Downey. Think Stats, 2nd ed.book · retrieved 2026-09-13https://greenteapress.com/thinkstats2/html/index.html
  2. NIST/SEMATECH e-Handbook of Statistical Methodsstandard · retrieved 2026-09-13https://www.itl.nist.gov/div898/handbook/pmc/section4/pmc443.htm
  3. NIST/SEMATECH. e-Handbook of Statistical Methods — 6.4.4.6 Box-Jenkins Model Identificationstandard · retrieved 2026-10-04https://www.itl.nist.gov/div898/handbook/pmc/section4/pmc446.htm
  4. scikit-learn User Guide — Cross-validationdocs · retrieved 2026-10-04https://scikit-learn.org/stable/modules/cross_validation.html
  5. NIST/SEMATECH. e-Handbook of Statistical Methods — 1.3.3.1 Autocorrelation Plotstandard · retrieved 2026-10-04https://www.itl.nist.gov/div898/handbook/eda/section3/autocopl.htm

Have a promo code?

A code that takes 100% off unlocks everything at once. A smaller one takes its share off the price in the payment window: enter the same code there.

Write to support

A question, a problem with access, a refund? Write to us and we answer by email.

What is it about?

Your address is used only to answer you.

Message sent

Thank you. We will reply to the address you gave, by email.

Or write to us directly

support@artofds.com

Message sent Thank you. We will reply to the address you gave, by email.

Check the email address: we need it to reply.

That is our own address. Enter yours, so the reply reaches you.

This address cannot receive email. Check it for a typo.

Write a little more: at least 10 characters.

Too many messages in a short time. Try again in a few minutes.

The message could not be sent. Please write to us directly: support@artofds.com