Contents
- What is autocorrelation?
- How is the PACF different from the ACF?
- How to identify seasonality from ACF and PACF
- Does differencing change the conclusion?
- From ACF and PACF to a SARIMA specification
- Plotting ACF and PACF in Python
- A worked example: monthly food prices
- Common mistakes when reading ACF and PACF
- Frequently asked questions
- What does “cut off” mean in an ACF or PACF plot?
- How many lags should be displayed?
- Why are all ACF lags significant?
- Which matters more for an AR model, the ACF or the PACF?
- Can ACF and PACF be used for monthly data?
- References
Versi bahasa Indonesia: Memahami Pola ACF dan PACF di SARIMA
Short answer: the autocorrelation function (ACF) measures the correlation between a time series and its own past values at each lag, while the partial autocorrelation function (PACF) measures the same correlation after removing the influence of the intermediate lags. A PACF that cuts off after lag p suggests an AR(p) model; an ACF that cuts off after lag q suggests an MA(q) model; both decaying slowly suggests a mixed ARMA model. Significant spikes that repeat at lags s, 2s, 3s, and so on reveal seasonality with period s, which calls for SARIMA.
ARIMA and SARIMA are close relatives: SARIMA is simply ARIMA with an additional seasonal component. Both are identified by reading two plots, the ACF and the PACF, and deciding whether each pattern “cuts off” or “dies down”. However, many explanations stop at the non-seasonal part and leave the seasonal lag unexplained. This article covers both.
What is autocorrelation?
Autocorrelation is the correlation between observations in the same time series that are separated by k periods, called the lag. At lag 2, the value at time t is correlated with the value at time t+2, so the first observation is paired with the third, the second with the fourth, and so forth. Formally, the autocorrelation at lag k is corr(Xt, Xt+k).
Software such as Minitab, EViews, R, and Python computes the ACF for lag 1, 2, 3, and onward, then plots each value as a bar with a confidence band of approximately ±1.96/√n. Bars outside the band are statistically significant. However, when the series contains a trend, nearly every lag is significant because all values move in the same direction. Consequently, the ACF becomes uninformative until the trend is removed by differencing and the series becomes stationary.
How is the PACF different from the ACF?
The PACF also measures the correlation between Xt and Xt+k. The difference lies in the word “partial”: the PACF first removes the linear effect of the values in between, namely Xt+1 through Xt+k-1. IBM’s SPSS documentation describes the PACF at lag k as the correlation between values k intervals apart, accounting for the values of the intervals between. Put simply, the ACF captures direct and indirect links together, while the PACF isolates the direct link at that lag.
| Pattern | ACF | PACF | Suggested model |
|---|---|---|---|
| Autoregressive | Dies down gradually | Cuts off after lag p | AR(p) |
| Moving average | Cuts off after lag q | Dies down gradually | MA(q) |
| Mixed | Dies down | Dies down | ARMA(p, q) |
| Trend present | Very slow decay, all lags significant | Large spike at lag 1 | Difference first (d ≥ 1) |
| Seasonal | Spikes at lags s, 2s, 3s | Spike at lag s | SARIMA with period s |
How to identify seasonality from ACF and PACF
Two simulated series illustrate the difference. Both show an upward trend. However, the first series repeats a pattern roughly every four periods, while the second fluctuates randomly around its trend.


A visual reading suggests that Series 1 is seasonal and should be modeled with SARIMA, while Series 2 is non-seasonal and suits ARIMA. Both require differencing to remove the trend. The ACF and PACF confirm the visual impression.

For Series 1, the ACF and PACF are significant at lag 1, not significant at lags 2 and 3, and significant again at lag 4 and lag 8. The repeated spikes every four lags indicate a seasonal cycle of length four, for example quarterly data with an annual pattern.

For Series 2, only lag 1 is significant, and the remaining lags stay inside the confidence band. Thus, no repeating cycle exists in the data.
Does differencing change the conclusion?
A reasonable objection is that both series still contain a trend. After first differencing, the conclusion remains the same: Series 1 still shows significant ACF and PACF values at lags 4 and 8, whereas Series 2 shows no repeating spikes. Consequently, Series 1 requires a seasonal model with period s = 4.

From ACF and PACF to a SARIMA specification
A SARIMA model is written as ARIMA(p, d, q)(P, D, Q)s. The lowercase terms describe the short lags, and the uppercase terms describe the seasonal lags. The identification follows four steps: (1) difference the series (d) until the trend disappears; (2) if seasonal spikes persist, apply seasonal differencing (D = 1) at lag s; (3) read the short lags (1, 2, 3) to choose p and q using the table above; and (4) read the seasonal lags (s, 2s) in the same way to choose P and Q. Candidate models are then compared with AIC or BIC, and the residuals of the final model should behave like white noise, which is checked with the Ljung-Box test.
Plotting ACF and PACF in Python
import pandas as pd
import matplotlib.pyplot as plt
from statsmodels.graphics.tsaplots import plot_acf, plot_pacf
y = pd.read_csv("data.csv")["value"]
dy = y.diff().dropna() # first difference removes the trend
fig, ax = plt.subplots(2, 1, figsize=(8, 6))
plot_acf(dy, lags=16, ax=ax[0])
plot_pacf(dy, lags=16, ax=ax[1], method="ywm")
plt.tight_layout()
plt.show()
The shaded area in each plot is the confidence band. For seasonal data with s = 4, attention should focus on lags 4, 8, 12, and 16. When reading the plots becomes subjective, an automated search such as auto_arima in the pmdarima package can test many specifications and select the one with the lowest information criterion.
A worked example: monthly food prices
Consider a monthly series of retail shallot prices over eight years (96 observations). Prices rise every year before major religious holidays and fall after the main harvest, so a yearly pattern is expected. The ACF of the raw series decays very slowly, with significant spikes up to lag 20. This slow decay is the signature of a non-stationary series, so the first step is not to read the AR or MA order but to difference the data.
After first differencing, the ACF shows a single significant spike at lag 1 and another at lag 12, while the PACF shows a spike at lag 1 that tails off and a further spike at lag 12. The lag 1 pattern suggests a non-seasonal MA(1) or AR(1) component; the lag 12 spike in both plots signals a seasonal component with period s = 12. A reasonable candidate set is therefore SARIMA(0,1,1)(0,1,1)12 and SARIMA(1,1,0)(1,1,0)12. The candidates are then compared using AIC and the Ljung-Box test on residuals. Thus, the ACF and PACF narrow the search to a few sensible models rather than delivering a single final answer.
The story behind such a series is familiar in many producing countries. A trader in a regional market notices that prices climb in the same month every year, yet each year the rise feels like a surprise. The lag 12 spike in the ACF is simply that memory written in numbers: what happened twelve months ago strongly predicts what happens now.
Common mistakes when reading ACF and PACF
Three mistakes appear repeatedly in student theses. Firstly, the order is read from a non-stationary series, which produces a long chain of significant lags and an inflated AR order. Secondly, a single spike that barely crosses the confidence band at a distant lag (for example lag 17) is treated as meaningful; with 95% confidence bands, about one lag in twenty is expected to cross by chance. Thirdly, seasonal lags are ignored because only the first few lags are displayed. Displaying at least two or three full seasonal cycles (24 to 36 lags for monthly data) prevents this error. Consequently, the residual ACF of the final model should show no significant spikes at all, which is the practical confirmation that the identification was correct.
Related guides on Catatan Budi: Granger causality test, Google Earth Engine tutorial, Auto ARIMA in Python.
Frequently asked questions
What does “cut off” mean in an ACF or PACF plot?
Cut off means the correlations are significant up to a certain lag and then drop abruptly inside the confidence band. Dying down means the correlations shrink gradually over many lags.
How many lags should be displayed?
A common rule is to display about n/4 lags, and at least three or four full seasonal cycles when seasonality is suspected, for example 16 lags for quarterly data.
Why are all ACF lags significant?
All lags become significant when the series has a trend or is otherwise non-stationary. Differencing the series once, or twice in rare cases, usually solves the problem.
Which matters more for an AR model, the ACF or the PACF?
The PACF matters more, because an AR(p) process produces a PACF that cuts off after lag p, while its ACF decays gradually.
Can ACF and PACF be used for monthly data?
Yes. For monthly data with an annual cycle, seasonal spikes appear at lags 12, 24, and 36, so the seasonal period is s = 12.
References
- Box, G. E. P., Jenkins, G. M., Reinsel, G. C., and Ljung, G. M. (2015). Time Series Analysis: Forecasting and Control (5th ed.). Wiley.
- Hyndman, R. J., and Athanasopoulos, G. (2021). Forecasting: Principles and Practice (3rd ed.). OTexts.
- IBM SPSS Statistics documentation: Autocorrelations and partial autocorrelations.
Discussion
No comments yet. Have a question about this topic? Write it below and I will do my best to answer.