开始使用免费开始使用

对比 GJR-GARCH 与 EGARCH

此前,您已经对比特币收益时间序列拟合了 GJR-GARCH 和 EGARCH 模型。本练习中,您将通过绘图对比两个模型给出的条件波动率估计结果。

GJR-GARCH 模型的估计波动率已保存为 gjrgm_vol,EGARCH 模型的估计波动率已保存为 egarch_vol。您将把它们与实际的比特币收益观测一起绘制,其中实际收益可通过 bitcoin_data 中的列 "Return" 获取。

本练习是课程的一部分

Python 中的 GARCH 模型

查看课程

练习说明

  • 绘制实际的比特币收益。
  • 绘制 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()
编辑并运行代码