Compare GJR-GARCH with EGARCH
Previously you have fitted a GJR-GARCH and EGARCH model with Bitcoin return time series. In this exercise, you will compare the estimated conditional volatility from the two models by plotting their results.
The GJR-GARCH model estimated volatility is saved in gjrgm_vol
, and EGARCH model estimated volatility is saved in egarch_vol
. You will plot them together with actual Bitcoin return observations, which can be accessed by column ”Return”
in bitcoin_data
.
This exercise is part of the course
GARCH Models in Python
Exercise instructions
- Plot the actual Bitcoin returns.
- Plot GJR-GARCH estimated volatility.
- Plot EGARCH estimated volatility.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# 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()