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()