开始使用免费开始使用

更改估计样本

拒绝 GARCH 模型有效性可能有多种原因:均值、方差或分布的假设不正确,或者收益率时间序列无法用同一组 GARCH 参数来描述。事实上,鉴于金融市场具有动态性,GARCH 模型参数随时间变化是合理的预期。因此,我们不再基于全部 4961 个收益做分析,而是改为在最近的 2500 个 EUR/USD 收益上重新估计 GARCH 模型。

本练习是课程的一部分

在 R 中构建 GARCH 模型

查看课程

练习说明

  • 使用函数 tail() 在最后 2500 个观测值上估计 GARCH 模型。
  • 计算标准化收益。
  • 进行 Ljung-Box 检验,检验 1,…,22 阶自相关是否全为 0。

交互式实操练习

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

# Estimate the model on the last 2500 observations
tgarchspec <- ___( mean.model = list(armaOrder = c(0,0)),
                        variance.model = list(model = "sGARCH"),
                        distribution.model = "std")
tgarchfit <- ___( data = ___(EURUSDret, ___) , spec = tgarchspec)

# Compute standardized returns
stdEURUSDret <- ___(tgarchfit, standardize = TRUE)

# Do the Ljung-Box test on the absolute standardized returns
___(abs(stdEURUSDret), 22, type = "Ljung-Box")
编辑并运行代码