博克斯-詹金斯法

Python 中的 ARIMA 模型

James Fulton

Climate informatics researcher

博克斯-詹金斯方法

从原始数据$\rightarrow$生产模型

  • 识别
  • 估计
  • 模型诊断
Python 中的 ARIMA 模型

识别

  • 序列是否平稳?
  • 需要何种差分使其平稳?
  • 需要何种变换使其平稳?
  • 哪些 p、q 值最有前景?

Python 中的 ARIMA 模型

识别工具

  • 绘制时间序列
    • df.plot()
  • 使用扩展Dickey-Fuller检验
    • adfuller()
  • 使用变换和/或差分
    • df.diff(), np.log(), np.sqrt()
  • 绘制 ACF/PACF
    • plot_acf(), plot_pacf()

Python 中的 ARIMA 模型

估计

  • 用数据训练模型系数
  • model.fit()为我们完成
  • 用 AIC 和 BIC 在模型间选择
    • results.aic, results.bic

Python 中的 ARIMA 模型

模型诊断

  • 残差是否不相关
  • 残差是否服从正态分布
    • results.plot_diagnostics()
    • results.summary()

Python 中的 ARIMA 模型

决策

Python 中的 ARIMA 模型

重复

  • 基于更多信息再次执行流程
  • 找到更优模型

Python 中的 ARIMA 模型

生产部署

  • 可进行预测
    • results.get_forecast()

Python 中的 ARIMA 模型

博克斯-詹金斯

Python 中的 ARIMA 模型

¡Vamos a practicar!

Python 中的 ARIMA 模型

Preparing Video For Download...