Intro till ACF och PACF

ARIMA-modeller i Python

James Fulton

Climate informatics researcher

Motivation

ARIMA-modeller i Python

ACF och PACF

  • ACF – autokorrelationsfunktion
  • PACF – partiell autokorrelationsfunktion
ARIMA-modeller i Python

Vad är ACF?

  • lag-1-autokorrelation $\rightarrow$ $corr(y_t, y_{t-1})$
  • lag-2-autokorrelation $\rightarrow$ $corr(y_t, y_{t-2})$
  • ...
  • lag-n-autokorrelation $\rightarrow$ $corr(y_t, y_{t-n})$
ARIMA-modeller i Python

Vad är ACF?

ARIMA-modeller i Python

Vad är PACF?

ARIMA-modeller i Python

Välja modellordning med ACF och PACF

  • AR(2)-modell $\rightarrow$

ARIMA-modeller i Python

Välja modellordning med ACF och PACF

  • MA(2)-modell $\rightarrow$

ARIMA-modeller i Python

Välja modellordning med ACF och PACF

ARIMA-modeller i Python

Välja modellordning med ACF och PACF

ARIMA-modeller i Python

Implementering i 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-modeller i Python

Implementering i Python

ARIMA-modeller i Python

För/underdifferensiering och ACF och PACF

ARIMA-modeller i Python

För/underdifferensiering och ACF och PACF

ARIMA-modeller i Python

Nu kör vi en övning!

ARIMA-modeller i Python

Preparing Video For Download...