Intro to ACF and PACF

Modelli ARIMA in Python

James Fulton

Climate informatics researcher

Motivation

Modelli ARIMA in Python

ACF and PACF

  • ACF - Autocorrelation Function
  • PACF - Partial autocorrelation function
Modelli ARIMA 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})$
Modelli ARIMA in Python

What is the ACF

Modelli ARIMA in Python

What is the PACF

Modelli ARIMA in Python

Using ACF and PACF to choose model order

  • AR(2) model $\rightarrow$

Modelli ARIMA in Python

Using ACF and PACF to choose model order

  • MA(2) model $\rightarrow$

Modelli ARIMA in Python

Using ACF and PACF to choose model order

Modelli ARIMA in Python

Using ACF and PACF to choose model order

Modelli ARIMA 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()
Modelli ARIMA in Python

Implementation in Python

Modelli ARIMA in Python

Over/under differencing and ACF and PACF

Modelli ARIMA in Python

Over/under differencing and ACF and PACF

Modelli ARIMA in Python

Let's practice!

Modelli ARIMA in Python

Preparing Video For Download...