Intro to ACF and PACF

ARIMA Models in Python

James Fulton

Climate informatics researcher

Motivation

ARIMA Models in Python

ACF and PACF

  • ACF - Autocorrelation Function
  • PACF - Partial autocorrelation function
ARIMA Models in Python

What is the ACF

  • lag-1 autocorrelation $\rightarrow$ $corr(y_t, y_{t-1})$
  • lag-2 autocorrelation $\rightarrow$ $corr(y_t, y_{t-2})$
  • ...
  • lag-n autocorrelation $\rightarrow$ $corr(y_t, y_{t-n})$
ARIMA Models in Python

What is the ACF

ARIMA Models in Python

What is the PACF

ARIMA Models in Python

Using ACF and PACF to choose model order

  • AR(2) model $\rightarrow$

ARIMA Models in Python

Using ACF and PACF to choose model order

  • MA(2) model $\rightarrow$

ARIMA Models in Python

Using ACF and PACF to choose model order

ARIMA Models in Python

Using ACF and PACF to choose model order

ARIMA Models in Python

Implementation in Python

from statsmodels.graphics.tsaplots import plot_acf, plot_pacf
# Create figure
fig, (ax1, ax2) = plt.subplots(2,1, figsize=(8,8))

# Make ACF plot plot_acf(df, lags=10, zero=False, ax=ax1)
# Make PACF plot plot_pacf(df, lags=10, zero=False, ax=ax2) plt.show()
ARIMA Models in Python

Implementation in Python

ARIMA Models in Python

Over/under differencing and ACF and PACF

ARIMA Models in Python

Over/under differencing and ACF and PACF

ARIMA Models in Python

Let's practice!

ARIMA Models in Python

Preparing Video For Download...