開始使用免費開始

均方預測誤差

GJR GARCH 模型是 GARCH 模型的推廣版,因此在均方誤差(MSE)較低的意義下,理論上應該有更好的擬合表現。讓我們在 Microsoft 報酬 msftret 上驗證這點;其中 garchfit 對應標準 GARCH(1,1) 模型的估計結果,而 gjrfit 則是使用 GJR 模型的估計結果。記得你可以用 residuals() 方法計算平均數的預測誤差向量 $e$。變異數的預測誤差等於 \(e^2\) 與預測的 GARCH 變異數之差。

本練習屬於課程

R 的 GARCH 模型

檢視課程

練習說明

  • 使用 residuals() 方法計算平均數的預測誤差向量。
  • 完成 garchfit 估計結果的 MSE 計算程式碼。
  • 計算 gjrfit 估計結果的 MSE。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Compute prediction errors
garcherrors <- ___(garchfit)
gjrerrors  <- ___(gjrfit)

# Compute MSE for variance prediction of garchfit model
___((___(garchfit)___ - garcherrors^2)___)

# Compute MSE for variance prediction of gjrfit model
___
編輯並執行程式碼