AR 还是 MA
在本练习中,您将使用 ACF 和 PACF 来判断某组数据更适合 MA 模型还是 AR 模型。请记住,选择合适的模型阶数对预测非常重要。
请记住,对于不同类型的模型,我们在 ACF 和 PACF 中期望看到如下行为:
环境中已为您提供一个属性未知的时间序列 df。
本练习是课程的一部分
Python 中的 ARIMA 模型
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Import
from statsmodels.graphics.tsaplots import ____, ____
# Create figure
fig, (ax1, ax2) = plt.subplots(2,1, figsize=(12,8))
# Plot the ACF of df
____(____, lags=____, zero=False, ax=ax1)
# Plot the PACF of df
____(____, lags=____, zero=____, ax=ax2)
plt.show()