起始值
估计 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
___
___