不吃苦,難有收穫

R 的 GARCH 模型

Kris Boudt

Professor of finance and econometrics

GARCH-in-mean 模型

  • 量化風險與報酬的權衡。
  • 風險:$\sigma^2_t$。報酬:$\mu_t$。
  • GARCH-in-mean 模型:

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

$\lambda > 0$ 為風險/報酬參數,表示每單位變異數風險帶來的期望報酬增量。

R 的 GARCH 模型

怎麼做?

把 ugarchspec() 的 mean.model 參數,從 list(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 模型

應用於 S&P 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-in-mean 以風險—報酬權衡的金融理論建立條件平均模型。
  • 現在改用統計理論,建立能利用今日報酬與明日報酬相關性的平均模型。
  • 最常見的是 AR(1) 模型:
    • AR(1) 指的是 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 模型

應用於 S&P 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) 模型

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 模型

Your turn to change the mean.model argument

R 的 GARCH 模型

Preparing Video For Download...