Introduction
Welcome to our next lesson. In our previous session, we established a rigorous framework for diagnosing stationarity using the ADF and KPSS tests. You learned how to interpret their results, even when they conflict, to determine if a series has a stochastic or deterministic trend. This diagnostic step is crucial because, as you'll see, the tools we are about to study only work their magic on stationary data.
Today, we shift from diagnosing a series's stability to understanding its internal structure. We will explore two of the most fundamental tools in the time series toolkit: the Autocorrelation Function (ACF) and the Partial Autocorrelation Function (PACF). These functions allow us to quantify how past values of a series relate to its present value. Mastering their interpretation is essential for building sophisticated forecasting models like ARIMA, which we will tackle in the next module. By the end of this lesson, you will be able to compute these functions and, more importantly, read their plots to uncover the underlying patterns in your demand data.
What is Autocorrelation?
At its core, "autocorrelation" is simply correlation with self. Whereas in standard regression you might calculate the correlation between sales and advertising spend, in time series analysis, we are often interested in the correlation between sales today and sales some number of days in the past. This "past" is referred to as a lag.
The Autocorrelation Function (ACF) measures this relationship systematically for a whole range of lags. For a given lag , the ACF tells us the correlation between the time series and a version of itself shifted by time steps.
To build a solid intuition for this, let's watch a short video that explains the concept of lags and how the ACF is constructed.
Plotting for Data Analysis - Interpreting ACF and PACF plots (2022)
This video from the AiML Mastery Club provides a clear, foundational explanation of lags and the Autocorrelation Function.
Please watch the following two segments: The first section (creating lags) demonstrates how lagged versions of a series are created. This is conceptually similar to creating lag features for a machine learning model. The next part (explaining ACF) defines the ACF plot and explains how to interpret its basic components, such as the significance lines.
As the video explains, an ACF plot visualizes these correlations. The x-axis represents the lag number (k=1, 2, 3, ...), and the y-axis shows the correlation at that lag. The shaded blue area represents a confidence interval. Any correlation "spike" that extends beyond this area is considered statistically significant.
The following infographic provides a simple, intuitive summary of the ACF.

The key thing to remember about ACF is that it measures the total correlation—both the direct effect of a lag and any indirect effects mediated by intermediate lags. For example, the correlation at lag 2 (corr(Y_t, Y_{t-2})) is influenced by the fact that Y_t is related to Y_{t-1} and Y_{t-1} is related to Y_{t-2}. This "chain reaction" of correlations can make ACF plots for some processes difficult to interpret, which brings us to our next tool.
The Partial Autocorrelation Function (PACF)
What if we want to isolate the direct relationship between Y_t and a specific lag, say Y_{t-k}, removing the confounding effects of the intermediate lags (Y_{t-1}, Y_{t-2}, ... Y_{t-k+1})? This is precisely what the Partial Autocorrelation Function (PACF) measures.
The PACF at lag k gives the unique, direct contribution of that lag to the current observation, after accounting for the influence of all shorter lags. The infographic above captures this perfectly with its question for PACF: "How much does it usually rain two days after it rains, but taking into account how much it rained the day in between?". That "taking into account" is the key.
Given your background, an effective way to think about this is through the lens of linear regression. The PACF at lag 3 can be thought of as the coefficient for the lag 3 feature in a regression model where you predict Y_t using lag 1, lag 2, and lag 3. It's the unique contribution of that third lag.
The same video we just watched provides an excellent explanation of this.
Plotting for Data Analysis - Interpreting ACF and PACF plots (2022)
The AiML Mastery Club video continues with a very intuitive explanation of PACF.
Please watch the segment on Partial Autocorrelation. Pay close attention to how the narrator frames the calculation of each PACF value as finding the coefficient of the newest lag in an expanding linear regression model. This is a powerful and correct intuition.
For those who appreciate the underlying mathematics, the formal definition of PACF involves regressing the time series on its lags and analyzing the residuals. The following resource provides a more formal, mathematical treatment. While you don't need to work through all the equations, understanding the core idea deepens your knowledge.
Partial Autocorrelation Function, PACF
These slides from the University of Toronto give a formal definition of PACF.
Focus on these two parts: The Definition shows that the PACF is the correlation between the residuals of two regressions, which is the formal way of "removing the effect" of intermediate lags. The conceptual explanation that follows provides a clear, qualitative description and walks through the calculation for an AR(1) process, showing mathematically why the PACF is zero for all lags greater than 1 in that case.
Interpreting ACF and PACF Plots for Model Identification
Now that we understand what ACF and PACF are, how do we use them in practice? Their primary role in classical forecasting is to help identify the order of Autoregressive (AR) and Moving Average (MA) models. For a stationary time series, their plots exhibit characteristic patterns.
- An Autoregressive (AR) process of order
p, denoted AR(p), is one where the current valueY_tis a linear combination of the previouspvalues. - A Moving Average (MA) process of order
q, denoted MA(q), is one where the current valueY_tis a linear combination of the previousqforecast errors.
The key to interpreting the plots is to look for two types of behavior:
- Cuts off: The correlations become insignificant (drop inside the blue band) abruptly after a certain lag.
- Tails off: The correlations decrease gradually towards zero, often in an exponential or sine-wave pattern.
Here is the general guide for identifying AR and MA processes:
| Process | ACF Behavior | PACF Behavior |
|---|---|---|
| AR(p) | Tails off | Cuts off after lag p |
| MA(q) | Cuts off after lag q |
Tails off |
| ARMA(p,q) | Tails off | Tails off |
The following video provides an excellent walkthrough of applying these rules to various example plots. It will solidify your ability to translate these theoretical patterns into practical model identification.
Interpreting ACF PACF Plots in Time Series Forecasting - order of AR and MA Model - TeKnowledGeek
This video from TeKnowledGeeK is a great practical guide to reading ACF/PACF plots.
Please watch the following segments to see these rules in action: Plot Characteristics: A quick review of how to read the plots. Interpretation Rules: The speaker presents the same rules as the table above. Interpretation Examples: This is the most important part. Watch as the speaker interprets plots for white noise, AR(1), AR(2), MA(2), and seasonal AR models. Try to guess the model yourself before the answer is revealed. Non-Stationary Example: This final segment is crucial. Notice how the ACF for a non-stationary series decays very slowly and doesn't cut off. This is a classic signature of non-stationarity and highlights why the tests from our previous lesson are a mandatory first step.
The key takeaway is that you use the plot that cuts off to identify the model order.
- If the PACF cuts off at lag
p, it suggests an AR(p) model. - If the ACF cuts off at lag
q, it suggests an MA(q) model.
Conclusion
In this lesson, we've added two powerful diagnostic tools to our arsenal. You've learned how to compute and, more critically, how to interpret ACF and PACF plots to understand the correlation structure of a time series.
Here are the key takeaways:
- The Autocorrelation Function (ACF) measures the total correlation between a series and its lags, including all direct and indirect effects. It is primarily used to identify the order
qof an MA process, where its plot will "cut off". - The Partial Autocorrelation Function (PACF) measures the direct correlation between a series and a specific lag, after removing the effects of intermediate lags. It is primarily used to identify the order
pof an AR process, where its plot will "cut off". - These plots are only meaningfully interpretable for stationary time series. A slowly decaying ACF is a strong indicator of non-stationarity, reinforcing the importance of the tests and transformations we have discussed.
You now possess the fundamental skills to look at a stationary time series and diagnose its underlying AR or MA structure. However, we've repeatedly stressed that these tools require stationarity. In our next lesson, we will focus on the "how-to" of achieving stationarity, covering essential techniques like differencing, seasonal differencing, and variance-stabilizing transformations like the log or Box-Cox transform. This will bridge the gap between diagnosing a series and preparing it for modeling.