開始使用免費開始

比較 GJR-GARCH 與 EGARCH

先前你已對 Bitcoin 報酬的時間序列擬合了 GJR-GARCH 與 EGARCH 模型。這一題中,你會透過繪圖來比較兩個模型所估計的條件波動度。

GJR-GARCH 模型的預估波動度已儲存在 gjrgm_vol,EGARCH 模型的預估波動度已儲存在 egarch_vol。你將把它們與實際的 Bitcoin 報酬觀測值一起繪出;實際報酬可由 bitcoin_data 中的欄位 "Return" 取得。

本練習屬於課程

Python 中的 GARCH 模型

檢視課程

練習說明

  • 繪製實際的 Bitcoin 報酬。
  • 繪製 GJR-GARCH 的預估波動度。
  • 繪製 EGARCH 的預估波動度。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Plot the actual Bitcoin returns
plt.plot(bitcoin_data['____'], color = 'grey', alpha = 0.4, label = 'Price Returns')

# Plot GJR-GARCH estimated volatility
plt.plot(____, color = 'gold', label = 'GJR-GARCH Volatility')

# Plot EGARCH  estimated volatility
plt.plot(____, color = 'red', label = 'EGARCH Volatility')

plt.legend(loc = 'upper right')
plt.show()
編輯並執行程式碼