开始使用免费开始使用

固定 GARCH 参数

GARCH 模型的参数通过极大似然法估计。由于抽样不确定性,估计得到的参数一定存在估计误差。如果我们知道参数的真实取值,最好的做法就是直接施加该取值,而不是再去估计。

现在请针对控制台中名为 EURUSDret 的变量(包含 EUR/USD 日度收益率)来完成这一点。该数据已基于偏度学生 t 分布估计了一个 AR(1)-GARCH 模型,并以 flexgarchfit 命名的 ugarchfit 对象提供。

本练习是课程的一部分

在 R 中构建 GARCH 模型

查看课程

练习说明

  • 输出 flexgarchfit 的系数估计值。
  • 使用 setfixed() 方法设定参数约束:ar1 = 0skew = 1
  • 在该参数约束下重新估计模型。
  • 补全代码以绘制两条波动率序列,并留意它们的相似性。

交互式实操练习

通过完成这段示例代码来试试这个练习。

# Print the flexible GARCH parameters
___

# Restrict the flexible GARCH model by impose a fixed ar1 and skew parameter
rflexgarchspec <- flexgarchspec
___(rflexgarchspec) <- list(___ = ___, ___ = ___)

# Estimate the restricted GARCH model
rflexgarchfit <- ugarchfit(data = ___,  spec = ___)

# Compare the volatility of the unrestricted and restriced GARCH models
plotvol <- plot(abs(EURUSDret), col = "grey")
plotvol <- addSeries(___(flexgarchfit), col = "black", lwd = 4, on=1 )
plotvol <- addSeries(___(rflexgarchfit), col = "red", on=1)
plotvol
编辑并运行代码