繪製動態預測
該來把你的預測畫出來了。記住,動態預測的意思是模型在之後的時間點不再用觀測值修正預測,和一步預測不同。這有點像現在先對未來 30 天做預測,然後等結果出來,再回頭比較你的預測表現如何。
在你的環境中,已提供 lower_limits、upper_limits、amazon 這些 DataFrame,以及你在上一個練習建立的平均預測 mean_forecast。
本練習屬於課程
Python 中的 ARIMA 模型
練習說明
- 使用
amazon的索引日期作為 x 座標、其數值作為 y 座標,繪製amazon資料。 - 以相同方式繪製
mean_forecast的預測結果。 - 在信賴區間的
lower_limits與upper_limits之間繪製陰影區。使用其中任一個 DataFrame 的索引作為 x 座標。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# plot the amazon data
plt.plot(____, ____, label='observed')
# plot your mean forecast
plt.plot(____, ____, color='r', label='forecast')
# shade the area between your confidence limits
plt.____(____, ____,
____, color='pink')
# set labels, legends and show plot
plt.xlabel('Date')
plt.ylabel('Amazon Stock Price - Close USD')
plt.legend()
plt.show()