🎉 75% of content is free forever — Unlock Premium from $10/mo →
CW
Search courses…
💼 Servicesℹ️ About✉️ ContactView Pricing Plansfrom $10

ACF and PACF — Identifying ARIMA Orders

StatisticsTime Series Analysis🟢 Free Lesson

Advertisement

ACF and PACF — Identifying ARIMA Orders

Statistics

Reading the Signature of Time Series Dependence

ACF and PACF plots reveal the autocorrelation structure needed to specify ARIMA models. The ACF shows total correlation at each lag, while the PACF isolates direct correlation after removing intermediate effects.

  • Economic Forecasting — Determine AR and MA orders for GDP growth models

  • Demand Planning — Identify seasonal lags in retail sales patterns

  • Sensor Networks — Detect temporal dependencies in IoT data streams

The cutoff patterns in these plots tell you exactly which lags matter.


The Autocorrelation Function (ACF) and Partial Autocorrelation Function (PACF) are essential tools for identifying the orders of ARIMA models.

DfAutocorrelation (ACF)

The correlation between a time series and its lagged version. The ACF at lag kk measures the linear dependence between YtY_t and YtkY_{t-k}.

Autocorrelation Function

ρ(k)=γ(k)γ(0)\rho(k) = \frac{\gamma(k)}{\gamma(0)}

Here,

  • ρ(k)\rho(k)=Autocorrelation at lag k
  • γ(k)\gamma(k)=Autocovariance at lag k: $\text{Cov}(Y_t, Y_{t-k})$
  • γ(0)\gamma(0)=Variance of the series

Sample ACF

The sample ACF is estimated as: ρ^(k)=t=k+1T(YtYˉ)(YtkYˉ)t=1T(YtYˉ)2\hat{\rho}(k) = \frac{\sum_{t=k+1}^{T}(Y_t - \bar{Y})(Y_{t-k} - \bar{Y})}{\sum_{t=1}^{T}(Y_t - \bar{Y})^2}. For a white noise series, ρ^(k)0±2T\hat{\rho}(k) \approx 0 \pm \frac{2}{\sqrt{T}}.


Partial Autocorrelation (PACF)

The PACF measures the correlation between YtY_t and YtkY_{t-k} after removing the linear effect of intermediate lags.

DfPartial Autocorrelation

The PACF at lag kk is the coefficient ϕkk\phi_{kk} in the regression:

Yt=ϕ1Yt1+ϕ2Yt2++ϕkYtk+εtY_t = \phi_{1}Y_{t-1} + \phi_{2}Y_{t-2} + \cdots + \phi_{k}Y_{t-k} + \varepsilon_t

Identification Rules

The ACF and PACF patterns help determine the orders (p, d, q) of an ARIMA(p,d,q) model:

| Model | ACF Pattern | PACF Pattern |

|-------|------------|--------------|

| AR(p) | Tails off (exponential/sinusoidal decay) | Cuts off after lag p |

| MA(q) | Cuts off after lag q | Tails off |

| ARMA(p,q) | Tails off | Tails off |

Quick Guide

  • AR: Look at PACF for the order (where it cuts off)

  • MA: Look at ACF for the order (where it cuts off)

  • ARMA: Both tail off — use information criteria (AIC/BIC)


Confidence Bands

For a white noise series, approximately 95% of sample ACF values should fall within ±2T\pm \frac{2}{\sqrt{T}}.

Significance Threshold

Bounds=±2T\text{Bounds} = \pm \frac{2}{\sqrt{T}}

Here,

  • TT=Length of the time series

Values outside these bounds are considered statistically significant at the 5% level.


Worked Examples

AR(1) Process

AR(1): $Y_t = 0.7Y_{t-1} + \varepsilon_t$

  • ACF: Exponential decay: ρ(k)=0.7k\rho(k) = 0.7^k

  • PACF: Spike at lag 1 (ϕ110.7\phi_{11} \approx 0.7), then cuts off

This pattern clearly identifies an AR(1) model.

MA(1) Process

MA(1): $Y_t = \varepsilon_t + 0.5\varepsilon_{t-1}$

  • ACF: Spike at lag 1 (ρ(1)=0.51+0.520.4\rho(1) = \frac{0.5}{1+0.5^2} \approx 0.4), then cuts off

  • PACF: Exponential decay

This pattern clearly identifies an MA(1) model.


Python Implementation


import numpy as np

import matplotlib.pyplot as plt

from statsmodels.graphics.tsaplots import plot_acf, plot_pacf

from statsmodels.tsa.arima_process import ArmaProcess



np.random.seed(42)



# AR(1) process

ar_params = np.array([1, -0.7])

ma_params = np.array([1])

ar1 = ArmaProcess(ar_params, ma_params)

y_ar1 = ar1.generate_sample(n=200)



# MA(1) process

ar_params_ma = np.array([1])

ma_params = np.array([1, 0.5])

ma1 = ArmaProcess(ar_params_ma, ma_params)

y_ma1 = ma1.generate_sample(n=200)



fig, axes = plt.subplots(2, 2, figsize=(12, 8))



plot_acf(y_ar1, ax=axes[0, 0], lags=20)

axes[0, 0].set_title('ACF - AR(1)')



plot_pacf(y_ar1, ax=axes[0, 1], lags=20)

axes[0, 1].set_title('PACF - AR(1)')



plot_acf(y_ma1, ax=axes[1, 0], lags=20)

axes[1, 0].set_title('ACF - MA(1)')



plot_pacf(y_ma1, ax=axes[1, 1], lags=20)

axes[1, 1].set_title('PACF - MA(1)')



plt.tight_layout()

plt.show()

Partial Autocorrelation via Durbin-Levinson

Durbin-Levinson Recursion

ϕkk=ρ(k)j=1k1ϕk1,jρ(kj)1j=1k1ϕk1,jρ(j)\phi_{kk} = \frac{\rho(k) - \sum_{j=1}^{k-1}\phi_{k-1,j}\rho(k-j)}{1 - \sum_{j=1}^{k-1}\phi_{k-1,j}\rho(j)}

Here,

  • ϕkk\phi_{kk}=PACF at lag k
  • ρ(k)\rho(k)=ACF at lag k
  • ϕk1,j\phi_{k-1,j}=Previous order coefficients

Key Takeaways

Summary: ACF and PACF

  • ACF measures total correlation between YtY_t and YtkY_{t-k}

  • PACF measures direct correlation after removing intermediate effects

  • AR(p): PACF cuts off at lag p; ACF tails off

  • MA(q): ACF cuts off at lag q; PACF tails off

  • ARMA(p,q): Both ACF and PACF tail off

  • Use significance bounds ±2/T\pm 2/\sqrt{T} to identify significant lags

  • Combine ACF/PACF analysis with AIC/BIC for model selection


Related Topics

Premium Content

ACF and PACF — Identifying ARIMA Orders

Unlock this lesson and 900+ advanced tutorials with a Premium plan.

🎯End-to-end Projects
💼Interview Prep
📜Certificates
🤝Community Access

Already a member? Log in

Need Expert Statistics Help?

Get personalized tutoring, project support, or professional consulting.

Advertisement