不劳无获

在 R 中构建 GARCH 模型

Kris Boudt

Professor of finance and econometrics

均值含 GARCH 模型

  • 量化风险-回报权衡。
  • 风险:$\sigma^2_t$。回报:$\mu_t$。
  • 均值含 GARCH(GARCH-in-mean)模型:

$$ \mu_{t} = \mu + \lambda \sigma^2_{t} $$

$\lambda > 0$ 为风险/回报参数,表示单位方差风险带来的期望回报增量。

在 R 中构建 GARCH 模型

如何实现?

ugarchspec() 中的 mean.modellist(armaOrder = c(0, 0)) 改为 list(armaOrder = c(0, 0), archm = TRUE, archpow = 2)

garchspec <- ugarchspec(
              mean.model = list(armaOrder = c(0, 0)),
              variance.model = list(model = "gjrGARCH"),
              distribution.model = "sstd")
garchspec <- ugarchspec(
               mean.model = list(armaOrder = c(0, 0), archm = TRUE, archpow = 2),
               variance.model = list(model = "gjrGARCH"),
               distribution.model = "sstd")
在 R 中构建 GARCH 模型

应用于标普500日度收益

估计

garchfit <- ugarchfit(data = sp500ret, spec = garchspec)

查看均值的估计系数

round(coef(garchfit)[1:2], 4)
    mu  archm 
0.0002 1.9950

预测的均值收益

$$ \hat{\mu}_{t} = 0.0002 + 1.9950 \hat{\sigma}^2_{t} $$

在 R 中构建 GARCH 模型

预测收益的时间序列图

  • 在 R 中绘图
    plot(fitted(garchfit))
    
在 R 中构建 GARCH 模型

今日收益可预测明日收益

  • 均值含 GARCH 模型利用金融学的风险-回报权衡来构建条件均值模型。
  • 现在用统计理论构建一个利用今日与明日收益相关性的均值模型。
  • 最常用的是 AR(1) 模型:
    • AR(1) 表示一阶自回归模型。
    • 它用收益相对长期均值 $\mu$ 的偏差来预测下一期收益:

$$ \mu_{t} = \mu + \rho(R_{t-1} - \mu) $$

在 R 中构建 GARCH 模型

正的自回归系数

$$ \mu_{t} = \mu + \rho(R_{t-1} - \mu) $$

  • $\rho > 0$:
    • 高于(或低于)平均的收益后,下一期仍高于(或低于)平均。
    • 可能原因:市场对消息反应不足,因此收益存在动量。
  • $|\rho|<1$:均值回归:$R_t$ 相对 $\mu$ 的偏离是暂时的。
在 R 中构建 GARCH 模型

负的自回归系数

$$ \mu_{t} = \mu + \rho(R_{t-1} - \mu) $$

  • $\rho < 0$:
    • 高于(或低于)平均的收益后,下一期转为低于(或高于)平均。
    • 可能原因:市场对消息反应过度,因此收益出现反转。
在 R 中构建 GARCH 模型

应用于标普500日度收益

使用 sst 分布的 AR(1)-GJR GARCH 的设定与估计

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

AR(1) 模型估计值

round(coef(garchfit)[1:2], 4)
     mu     ar1     
 0.0003 -0.0292
在 R 中构建 GARCH 模型

MA(1) 与 ARMA(1,1) 模型

一阶移动平均模型 MA(1) 使用收益相对条件均值的偏差:

$$ \mu_{t} = \mu + \theta(R_{t-1} - \mu_{t-1}) $$

ARMA(1,1) 结合 AR(1) 与 MA(1):

$$ \mu_{t} = \mu + \rho(R_{t-1} - \mu) + \theta(R_{t-1} - \mu_{t-1}) $$

在 R 中构建 GARCH 模型

如何实现?

MA(1)

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

ARMA(1, 1)

garchspec <- ugarchspec( 
          mean.model = list(armaOrder = c(1, 1)),
          variance.model = list(model = "gjrGARCH"),
          distribution.model = "sstd")
在 R 中构建 GARCH 模型

轮到您修改 mean.model 参数

在 R 中构建 GARCH 模型

Preparing Video For Download...