均方预测误差
GJR GARCH 模型是 GARCH 模型的推广,因此在均方误差(MSE)更低的意义上应当拟合得更好。我们用微软收益率 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
___