起始值
估計 GARCH 模型必須最佳化概似函數。若起始值不佳,這個最佳化可能會失敗。所幸 rugarch 套件作者 Alexios Ghalanos 已經把最佳化的預設設定得很好,因此在多數情況下結果都相當精準。若你有疑慮,可以使用 setstart() 方法自行設定起始值,並檢查估計參數與概似值是否得到相近的結果。
在這裡,你可以用 EURUSDret 中的每日 EUR/USD 報酬率來測試,並假設常數平均的標準 GARCH 模型,且誤差分配為 Student t 分配。模型規格已在主控台提供為 garchspec。
本練習屬於課程
R 的 GARCH 模型
練習說明
- 使用預設起始值來估計
garchspec模型。 - 印出估計參數與概似值。
- 設定其他起始值並重新估計。
- 再次印出估計參數與概似值。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Estimate using default starting values
garchfit <- ___
# Print the estimated parameters and the likelihood
___
___
# Set other starting values and re-estimate
___(garchspec) <- ___(alpha1 = 0.05, beta1 = 0.9, shape = 6)
garchfit <- ___
# Print the estimated parameters and the likelihood
___
___