开始使用免费开始使用

指定并品味 GARCH 模型的不同"口味"

在接下来的章节中,您会看到 GARCH 模型有许多"口味"。因此,您需要先指定要使用的均值模型、方差模型以及误差分布。最佳模型是因应用而异的。一个现实的 GARCH 分析通常需要对多种 GARCH 模型进行设定、估计与检验。

在 R 中,这很简单,多亏了 Alexios Ghalanos 的 rugarch 包。该包已为您加载。您将用它来分析 sp500ret 中的日收益率。

本练习是课程的一部分

在 R 中构建 GARCH 模型

查看课程

练习说明

  • 使用 ugarchspec() 指定要估计具有常数均值、预测误差服从正态分布的标准 GARCH(1,1) 模型。
  • 使用 ugarchfit() 通过极大似然估计该模型。
  • 使用方法 sigma() 提取估计的波动率。
  • 绘制 2017 年的波动率预测。

交互式实操练习

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

# Specify a standard GARCH model with constant mean
garchspec <- ___(mean.model = list(armaOrder = ___),
                 variance.model = list(model = "___"), 
                 distribution.model = "___")

# Estimate the model
garchfit <- ___(data = ___, spec = ___)

# Use the method sigma to retrieve the estimated volatilities 
garchvol <- ___ 

# Plot the volatility for 2017
___(___["2017"])
编辑并运行代码