GJR-GARCH 模型的估計
和任何 GARCH 模型一樣,GJR-GARCH 模型用來預測波動度。現在我們用這個模型來預測 Microsoft 每日報酬在 1999 到 2017 年期間的波動度。
這些報酬已經以變數 msftret 載入到主控台。我們也替你先計算好了標準 GARCH 的波動度預測,存放在物件 sgarchvol 中。
本練習屬於課程
R 的 GARCH 模型
練習說明
- 指定使用偏態 student t 分配的 GJR-GARCH 模型。
- 估計該模型。
- 將 GJR-GARCH 的波動度與
sgarchvol比較。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Specify the GJR GARCH model
garchspec <- ___(mean.model = list(armaOrder = c(0,0)),
___ = list(model = ___),
___ = ___)
# Estimate the model and compute volatility
gjrgarchfit <- ___(data = ___, spec = ___)
gjrgarchvol <- ___(___)
# Compare volatility
plotvol <- plot(abs(msftret), col = "grey")
plotvol <- addSeries(___, col = "red", on=1)
plotvol <- addSeries(sgarchvol, col = "blue", on=1)
plotvol