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