Skip to content
tezvyn:
Menu

ACF vs. PACF: A Time Series Signal and Its Echo

Source: Wikipedia: Partial autocorrelation functionMediumHow cards are made

ACF vs. PACF: A Time Series Signal and Its Echo

Autocorrelation (ACF) measures a time series's total correlation with its past, including indirect echoes. Partial Autocorrelation (PACF) isolates the direct correlation by removing intermediate effects. They help select forecasting model parameters.

The mental model

Imagine shouting in a canyon. The Autocorrelation Function (ACF) is the entire sound you hear back—the initial echo, plus the echo of that echo, and so on. The Partial Autocorrelation Function (PACF) is like a special microphone that only records the first echo from a specific distance, filtering out all the reverberations caused by closer canyon walls. ACF measures total correlation (direct + indirect); PACF measures direct correlation only.

How it works

ACF at lag 'k' is the simple correlation between a time series and its values 'k' periods ago. It includes the influence of all intervening data points (lags 1, 2, ..., k-1). PACF at lag 'k' gives the partial correlation with the 'k'-lagged value after controlling for, or regressing out, the influence of all shorter lags. It calculates the 'new' information that lag 'k' provides that wasn't already explained by the lags before it.

When to use it

The primary use is identifying parameters for time series forecasting models like ARIMA. The shapes of the ACF and PACF plots are signatures of underlying processes. For an Autoregressive (AR) process of order 'p', the PACF plot will cut off sharply after lag 'p'. For a Moving Average (MA) process of order 'q', the ACF plot will cut off sharply after lag 'q'. This is a cornerstone of the Box-Jenkins model selection method.

When not to use it

Do not apply ACF/PACF to a non-stationary time series (one with a trend or changing variance). The results will be misleading, typically showing a very slow decay in the ACF that just reflects the trend. You must first make the series stationary, often by differencing it (e.g., using daily changes instead of absolute price levels). Also, these functions measure correlation, not causation.

One canonical example

Consider daily e-commerce sales. The ACF might show significant correlation at lags 7, 14, and 21, suggesting a weekly pattern. But is the correlation at day 14 just an echo of the strong 7-day correlation? The PACF plot answers this. If the PACF shows a single large spike at lag 7 and then drops to insignificance, it implies the direct relationship is weekly. The 14 and 21-day correlations are just reverberations. This pattern suggests an AR(7) model might be appropriate.

Interview question

When analyzing a time series, which function specifically measures the direct correlation between the current value and a past value, after accounting for the influence of all intervening data points?

  • a.The Autocorrelation Function (ACF)
  • b.The Impulse Response Function (IRF)
  • c.The Partial Autocorrelation Function (PACF)Correct
  • d.The Cross-correlation Function (CCF)
Why?

The Partial Autocorrelation Function (PACF) isolates the direct correlation by removing the influence of intermediate lags. The Autocorrelation Function (ACF), in contrast, measures the total correlation, which includes both direct and indirect effects.

Just read this? Test yourself on what you have been reading.

Read the original → en.wikipedia.org

Put your scrolling time to good use

Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Open roles that interview on time series — each one lists the topics its interview covers.

See open roles