Loading market pulse…
Tools

ACF and PACF Are How You Diagnose a Time Series Before You Model It

By FatNarwhal·

When you are building a time series model, you need to know what kind of structure the data actually has before you start fitting things. Does yesterday's value predict today's? Does last week's? Are the errors in a simple regression serially correlated, meaning they carry information forward that the model is not capturing?

The autocorrelation function (ACF) and the partial autocorrelation function (PACF) are the standard diagnostic tools for answering these questions. They show you how correlated a series is with its own past values, at every lag, and they do it in a way that makes the structure of the data immediately visible as a chart.

If you have read anything about ARIMA models, you have probably seen ACF and PACF plots referenced for choosing the model's p and q parameters. That is exactly what this tool is for; it gives you those plots and tells you how to read them.

The FatNarwhal ACF/PACF tool generates both functions for any data series and includes confidence bands so you can see which lags have statistically significant autocorrelation.

How to Use It

Go to fatnarwhal.com/autocorrelation and enter a ticker or data series.

The tool generates two charts side by side. The ACF plot shows the correlation between the series and its past values at each lag; lag 1 is the correlation between today and yesterday, lag 2 is today versus two days ago, and so on. The PACF plot shows the same thing but removes the indirect effects; the lag-5 PACF shows only the direct relationship between today and five days ago, after removing the effects flowing through lags 1 through 4.

Blue bars that extend beyond the dashed confidence bands are statistically significant. Bars within the bands are consistent with noise.

For a pure AR(p) process, the PACF will cut off sharply after lag p (bars drop inside the bands), while the ACF will decay gradually. For a pure MA(q) process, the ACF will cut off after lag q while the PACF decays gradually. This pattern is how experienced time series modelers read these plots to choose p and q for ARIMA.

The Math Behind It

The autocorrelation at lag k is:

ACF(k)=Cov(yt,ytk)Var(yt)ACF(k) = \frac{\text{Cov}(y_t, y_{t-k})}{\text{Var}(y_t)}

Which is just the Pearson correlation between the series and its k-period lagged version.

The PACF at lag k is the coefficient on y_(t-k) from a regression of y_t on y_(t-1), y_(t-2), ..., y_(t-k). By conditioning on the intermediate lags, PACF isolates the direct effect of y_(t-k) on y_t without the influence of the shorter lags carrying information.

The confidence bands on both plots are approximately ±1.96/√n, where n is the sample size. Bars that exceed these bands have autocorrelation significantly different from zero at the 5% level.

When to Use It and When Not To

Use ACF and PACF as the first diagnostic step after confirming stationarity in your data. They tell you what kind of ARIMA structure to try before running the full Auto-ARIMA selection. Use them after fitting any model to check the residuals; residuals from a well-specified model should have no significant autocorrelation in either the ACF or PACF plot.

If the residuals still show significant autocorrelation after fitting, the model has not captured all the structure in the data and its forecasts will be suboptimal.

ACF and PACF are less useful on raw price data (non-stationary) than on returns or differenced series. Always run stationarity tests first, difference if needed, then look at the ACF and PACF plots.

One caveat for financial data specifically; daily stock returns often show very little autocorrelation (efficient markets at work), but squared returns (a proxy for variance) often show strong autocorrelation, which is the volatility clustering that GARCH is designed to capture. Running ACF on squared returns is a useful diagnostic for deciding whether you need a GARCH model.

Try It

Go to fatnarwhal.com/autocorrelation and run ACF and PACF on any stock's daily returns, then again on the squared returns. The first chart will probably look mostly like noise; the second will likely show significant autocorrelation at many lags. That pattern is volatility clustering in action, and it is one of the most consistent patterns in all of financial data.

The plots are just pictures of correlation. But they are the right pictures to look at first.