市场上涨如爬楼梯,下跌如坐电梯

在 R 中构建 GARCH 模型

Kris Boudt

Professor of finance and econometrics

如何操作?

ugarchspec()distribution.model"norm" 改为 "sstd"

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

$$ \downarrow$$

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

正态 GARCH 模型

在模型假设下

$$ R_{t} = \mu_{t} + e_{t} $$ $$ e_{t} \sim N(0, \sigma^{2}_{t}) $$

可得

$$ \frac{R_{t} - \mu_{t}}{\sigma_{t}} \sim N(0, 1) $$

在 R 中构建 GARCH 模型

开始检验

  • 注意:标准化收益的正态性源于一种假设
  • 计算标准化收益,并检验该假设是否成立。
在 R 中构建 GARCH 模型

估计的标准化收益

  • 公式

$$ Z_{t} = \frac{R_{t} - \hat{\mu_{t}}}{ \hat{\sigma_{t}}} $$

在 R 中计算

# Obtain standardized returns
stdret <- residuals(garchfit, standardize = TRUE)
在 R 中构建 GARCH 模型

检验正态性假设

library(PerformanceAnalytics)
chart.Histogram(sp500ret, methods = c("add.normal", "add.density"),
          colorset = c("gray", "red", "blue"))
在 R 中构建 GARCH 模型

在 R 中构建 GARCH 模型

tails

在 R 中构建 GARCH 模型

解决方案

  • 因此,一个更现实的分布需能体现:

    • 肥尾:相较正态,更大幅(正/负)收益的概率更高
    • 偏度:收益分布不对称
  • rugarch 中可用偏斜学生t分布实现:

garchspec <- ugarchspec(distribution.model = "sstd")
在 R 中构建 GARCH 模型

偏斜学生t分布的参数

  • 与正态相比,偏斜学生t分布多两个参数:

    • 自由度参数 $\nu$(在 rugarch 中为 shape):$\nu$ 越小,尾部越肥。
    • 偏度参数 $\xi$(在 rugarch 中为 skew):$\xi=1$ 为对称;$\xi<1$ 负偏;$\xi>1$ 正偏。
  • 特例:

    • 当 $\nu=\infty$ 且 $\xi=1$:正态分布。
    • 当 $\xi=1$:学生t分布。
在 R 中构建 GARCH 模型

在 R 中构建 GARCH 模型

在 R 中构建 GARCH 模型

在 R 中构建 GARCH 模型

在 R 中构建 GARCH 模型

偏斜学生t的 GARCH 模型估计

将参数 distribution.model 设为 "sstd"

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
在 R 中构建 GARCH 模型

¡Vamos a practicar!

在 R 中构建 GARCH 模型

Preparing Video For Download...