开始使用免费开始使用

标准化收益

完整的 GARCH 模型需要对标准化收益的分布作出假设。模型估计完成后,您可以通过分析标准化收益来检验该假设。

在本练习中,您的工作从估计完成后开始。使用 ugarchfit() 估计 GARCH 模型的输出已在控制台以变量 garchfit 提供。被分析的收益序列以变量 ret 提供。

本练习是课程的一部分

在 R 中构建 GARCH 模型

查看课程

练习说明

  • 使用 residuals() 方法计算标准化收益。
  • 使用 fitted()sigma() 方法计算标准化收益,得到相同结果。
  • 加载 PerformanceAnalytics 包,并使用 chart.Histogram 绘制标准化收益的直方图,同时叠加正态密度和实际密度曲线。

交互式实操练习

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

# Compute the standardized returns
stdret <- ___(garchfit, ___ = ___)

# Compute the standardized returns using fitted() and sigma()
stdret <- (ret - ___(garchfit)) / ___

# Load the package PerformanceAnalytics and make the histogram
___
___(stdret, methods = c("add.normal","add.density" ), 
                colorset = c("gray","red","blue"))
编辑并运行代码