分配假設

Python 中的 GARCH 模型

Chelsea Yang

Data Science Instructor

為何要做假設

  • 波動率無法直接觀察

  • GARCH 模型以殘差作為波動衝擊 $$ r_t = \mu_t + \epsilon_t $$

  • 波動率與殘差相關: $$ \epsilon_t = \sigma_t * \zeta (WhiteNoise)$$

Python 中的 GARCH 模型

標準化殘差

  • 殘差 = 實際報酬 − 平均報酬 $$ residuals = \epsilon_t = r_t - \mu_t $$
  • 標準化殘差 = 殘差 ÷ 報酬波動率 $$ std\,Resid = \frac{\epsilon_t}{\sigma_t} $$
Python 中的 GARCH 模型

GARCH 中的殘差

gm_std_resid = gm_result.resid / gm_result.conditional_volatility
plt.hist(gm_std_resid, facecolor = 'orange',label = 'standardized residuals')

標準化殘差的長條圖

Python 中的 GARCH 模型

肥尾(Fat tails)

  • 與常態分配相比,觀察到報酬絕對值很大(正或負)的機率更高

肥尾範例

Python 中的 GARCH 模型

偏態(Skewness)

  • 機率分配偏斜程度的量測

偏態範例

Python 中的 GARCH 模型

Student's t 分配

t 分配範例

Student's t 分配的 $\nu$ 參數決定其形狀

Python 中的 GARCH 模型

採用 t 分配的 GARCH

arch_model(my_data, p = 1, q = 1,
           mean = 'constant', vol = 'GARCH', 
           dist = 't')
                              Distribution                              
========================================================================
                 coef    std err          t      P>|t|  95.0% Conf. Int.
.-----------------------------------------------------------------------
nu             4.9249      0.507      9.709  2.768e-22 [  3.931,  5.919]
========================================================================
Python 中的 GARCH 模型

採用偏態 t 分配的 GARCH

arch_model(my_data, p = 1, q = 1,
           mean = 'constant', vol = 'GARCH', 
           dist = 'skewt')
                                Distribution                               
===========================================================================
                 coef    std err          t      P>|t|     95.0% Conf. Int.
.--------------------------------------------------------------------------
nu             5.2437      0.575      9.118  7.681e-20    [  4.117,  6.371]
lambda        -0.0822  2.541e-02     -3.235  1.216e-03 [ -0.132,-3.241e-02]
===========================================================================
Python 中的 GARCH 模型

一起來練習吧!

Python 中的 GARCH 模型

Preparing Video For Download...