模型风险:使用了错误的模型

在 R 中构建 GARCH 模型

Kris Boudt

Professor of finance and econometrics

模型风险来源与解决方案

来源:

  • 建模选择
  • 优化的起始值
  • 收益序列中的离群值

解决:用稳健方法防护

  • 模型平均:对多个模型的预测取平均
  • 试多组起始值,选择似然最高者
  • 清洗数据
在 R 中构建 GARCH 模型

模型平均

variance.models <- c("sGARCH", "gjrGARCH")
distribution.models <- c("norm", "std", "sstd")
c <- 1
for (var.model in variance.models) {
    for (dist.model in distribution.models) {
        garchspec <- ugarchspec(mean.model = list(armaOrder = c(0, 0)),
         variance.model = list(model = var.model), distribution.model = dist.model)
        garchfit <- ugarchfit(data = msftret, spec = garchspec)
        if (c==1) { msigma <- sigma(garchfit)
        } else { msigma <- merge(msigma, sigma(garchfit))} 
        c <- c + 1 }
}
在 R 中构建 GARCH 模型

在 R 中构建 GARCH 模型

平均波动率预测

avesigma <- xts(rowMeans(msigma), order.by = time(msigma))

Beta 的定义

在 R 中构建 GARCH 模型

对起始值的稳健性

coef(garchfit)
          mu        omega       alpha1        beta1         skew        shape 
5.669200e-04 6.281258e-07 7.462984e-02 9.223701e-01 9.436331e-01 6.318621e+00 
  • 这些估计来自对似然函数的复杂优化
  • 数值迭代优化:逐步改进,可能对起始值敏感
  • rugarch 提供获取合理起始值的默认方法
  • 可对 ugarchspec() 的 GARCH 规格应用 setstart() 指定自定义起始值
在 R 中构建 GARCH 模型

使用默认起始值估计

garchspec <- ugarchspec(mean.model = list(armaOrder = c(0,0)),
                        variance.model = list(model = "sGARCH"),
                        distribution.model = "sstd")

garchfit <- ugarchfit(data = sp500ret, spec = garchspec)
coef(garchfit)
          mu        omega       alpha1        beta1         skew        shape 
5.669200e-04 6.281258e-07 7.462984e-02 9.223701e-01 9.436331e-01 6.318621e+00 
likelihood(garchfit)
24280.33
在 R 中构建 GARCH 模型

使用修改后的起始值估计

garchspec <- ugarchspec(mean.model = list(armaOrder = c(0, 0)),
  variance.model = list(model = "sGARCH"), distribution.model = "sstd")
setstart(garchspec) <- list(alpha1 = 0.05, beta1 = 0.9, shape = 8)
garchfit <- ugarchfit(data = sp500ret, spec = garchspec)
coef(garchfit)
          mu        omega       alpha1        beta1         skew        shape 
5.638002e-04 6.303949e-07 7.466503e-02 9.224117e-01 9.438978e-01 6.309185e+00
likelihood(garchfit) # returns 24280.33
在 R 中构建 GARCH 模型

数据清洗

  • 避免离群值扭曲波动率预测
  • 方法:Winsorization。用 PerformanceAnalytics 包的 Return.clean()method = "boudt",将收益的极端值压到可接受水平:
# 清洗收益序列
library(PerformanceAnalytics)
clmsftret <- Return.clean(msftret, method = "boudt")
# 叠加绘图
plotret <- plot(msftret, col = "red")
plotret <- addSeries(clmsftret, col = "blue", on = 1)
在 R 中构建 GARCH 模型

Beta 的定义

在 R 中构建 GARCH 模型

清洗对波动率预测的影响

使用原始与清洗后的微软收益率进行波动率预测

garchspec <- ugarchspec(mean.model = list(armaOrder = c(1, 0)),
     variance.model = list(model = "gjrGARCH"), distribution.model = "sstd")
garchfit <- ugarchfit(data = msftret, spec = garchspec)
clgarchfit <- ugarchfit(data = clmsftret, spec = garchspec)

在时间序列图中比较

plotvol <- plot(abs(msftret), col = "gray")
plotvol <- addSeries(sigma(garchfit), col = "red", on = 1)
plotvol <- addSeries(sigma(clgarchfit), col = "blue", on = 1)
plotvol
在 R 中构建 GARCH 模型

Beta 的定义

在 R 中构建 GARCH 模型

做个"稳健派":宁可大致正确,不要精确错误

在 R 中构建 GARCH 模型

Preparing Video For Download...