Autocorrelation (ACF & PACF)

The essential tools for understanding the memory and structure of time series data.

What is Autocorrelation?

Autocorrelation is the correlation of a time series with a delayed copy of itself. It's a measure of how much the value of the series at one point in time is related to its value at a previous point in time.

In finance, this is a critical concept. If a stock's return today is positively autocorrelated with its return yesterday, it suggests momentum. If it's negatively correlated, it suggests mean reversion. The ACF and PACF plots are the primary tools quants use to diagnose this "memory" in a time series.

ACF vs. PACF

Autocorrelation Function (ACF)

The ACF plot shows the correlation of the series with its lags. For example, the bar at lag `k` shows the correlation between the series at time `t` and time `t-k`. It measures the **total** effect (direct and indirect) of a past value on the current value.

Partial Autocorrelation Function (PACF)

The PACF is more subtle. It shows the correlation between the series at time `t` and time `t-k` **after removing the effects of all the shorter lags** (t-1, t-2, ..., t-k+1). It measures the **direct** effect of a specific lag on the current value.

Interactive AR(1) Process
Below is a simulated Autoregressive process of order 1 (AR(1)), defined as Xt=ϕXt1+ϵtX_t = \phi X_{t-1} + \epsilon_t. Adjust the autoregressive parameter (ϕ\phi) to see how it impacts the time series and its ACF plot. A high ϕ\phi means the series has strong "memory".

Simulated Time Series

Autocorrelation Function (ACF)

Notice how for a high positive ϕ, the ACF decays slowly, indicating strong memory. The PACF (not shown here) for an AR(1) process would have a single significant spike at lag 1 and then cut off to zero.