標準化報酬
一個完整的 GARCH 模型需要對「標準化報酬」的分配做出假設。模型估計完成後,你可以透過分析標準化報酬來檢驗這個假設。
在這個練習中,你的工作從估計完成之後開始。使用 ugarchfit() 估計 GARCH 模型所得到的輸出,已經以變數 garchfit 提供在主控台中。被分析的報酬時間序列則以變數 ret 提供。
本練習屬於課程
R 的 GARCH 模型
練習說明
- 使用
residuals()方法計算標準化報酬。 - 再分別使用
fitted()與sigma()方法,計算標準化報酬並做出相同結果的驗證。 - 載入套件
PerformanceAnalytics,並使用chart.Histogram繪製標準化報酬的直方圖,同時疊加常態與實際密度曲線。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Compute the standardized returns
stdret <- ___(garchfit, ___ = ___)
# Compute the standardized returns using fitted() and sigma()
stdret <- (ret - ___(garchfit)) / ___
# Load the package PerformanceAnalytics and make the histogram
___
___(stdret, methods = c("add.normal","add.density" ),
colorset = c("gray","red","blue"))