ACF 与 PACF 简介

Python 中的 ARIMA 模型

James Fulton

Climate informatics researcher

动机

Python 中的 ARIMA 模型

ACF 与 PACF

  • ACF:自相关函数
  • PACF:偏自相关函数
Python 中的 ARIMA 模型

什么是 ACF

  • 滞后1自相关 $\rightarrow$ $corr(y_t, y_{t-1})$
  • 滞后2自相关 $\rightarrow$ $corr(y_t, y_{t-2})$
  • ...
  • 滞后n自相关 $\rightarrow$ $corr(y_t, y_{t-n})$
Python 中的 ARIMA 模型

什么是 ACF

Python 中的 ARIMA 模型

什么是 PACF

Python 中的 ARIMA 模型

用 ACF 和 PACF 选模型阶数

  • AR(2) 模型 $\rightarrow$

Python 中的 ARIMA 模型

用 ACF 和 PACF 选模型阶数

  • MA(2) 模型 $\rightarrow$

Python 中的 ARIMA 模型

用 ACF 和 PACF 选模型阶数

Python 中的 ARIMA 模型

用 ACF 和 PACF 选模型阶数

Python 中的 ARIMA 模型

Python 实现

from statsmodels.graphics.tsaplots import plot_acf, plot_pacf
# 创建图形
fig, (ax1, ax2) = plt.subplots(2,1, figsize=(8,8))

# 绘制 ACF 图 plot_acf(df, lags=10, zero=False, ax=ax1)
# 绘制 PACF 图 plot_pacf(df, lags=10, zero=False, ax=ax2) plt.show()
Python 中的 ARIMA 模型

Python 实现

Python 中的 ARIMA 模型

过度/欠差分与 ACF、PACF

Python 中的 ARIMA 模型

过度/欠差分与 ACF、PACF

Python 中的 ARIMA 模型

¡Vamos a practicar!

Python 中的 ARIMA 模型

Preparing Video For Download...