MA 模型的估计与预测

Python 中的时间序列分析

Rob Reider

Adjunct Professor, NYU-Courant Consultant, Quantopian

估计 MA 模型

  • 与估计 AR 模型相同(但使用 order=(0,0,1)
    from statsmodels.tsa.arima.model import ARIMA
    mod = ARIMA(simulated_data, order=(0,0,1))
    result = mod.fit()
    
Python 中的时间序列分析

预测 MA 模型

from statsmodels.graphics.tsaplots import plot_predict
fig, ax = plt.subplots()
data.plot(ax=ax)
plot_predict(res, start='2012-09-27', end='2012-10-06', ax=ax)
plt.show()

Python 中的时间序列分析

让我们来练习!

Python 中的时间序列分析

Preparing Video For Download...