LỜI CẢM ƠN

   Em xin gửi lời cảm ơn chân thành đến thầy Nguyễn Tuấn Duy đã hướng dẫn, hỗ trợ cho em trong suốt quá trình học tập và thực hiện bài tiểu luận này.

Vì kiến thức bản thân còn nhiều hạn chế nên không thể tránh khỏi những sai sót nên em rất mong nhận được những góp ý từ thầy cũng như các bạn để có thể hoàn thiện hơn kiến thức của mình.Một lần nữa, em xin chân thành cảm ơn!

1. Lý thuyết mô hình Garch

1.1 Cơ sở lý thuyết mô hình Garch

Mô hình GARCH (Generalized Autoregressive Conditional Heteroskedasticity) là một mô hình thống kê được phát triển bởi Robert F. Engle vào những năm 1980 để mô hình hóa sự biến đổi không đều của dữ liệu tài chính. Mô hình này được sử dụng rộng rãi trong lĩnh vực tài chính để phân tích và dự đoán rủi ro.

Mô hình GARCH kết hợp các thành phần autoregressive (AR) và moving average (MA) để mô hình hóa sự phụ thuộc của phương sai có điều kiện vào các giá trị đã qua xử lý cũng như các giá trị độ biến động trước đó. Một mô hình GARCH(p, q) có thể được biểu diễn như sau:

σ²(t) = ω + α₁ε²(t-1) + … + αₚε²(t-p) + β₁σ²(t-1) + … + β_qσ²(t-q)

Trong đó:

σ²(t) là phương sai có điều kiện của biến ngẫu nhiên tại thời điểm t. ε(t) là biến ngẫu nhiên có kỳ vọng bằng 0 và phương sai đẳng nhất. ω, α₁, …, αₚ, β₁, …, β_q là các tham số của mô hình. p là số lags cho thành phần autoregressive (AR) và q là số lags cho thành phần moving average (MA). Thường thì các tham số α và β trong mô hình GARCH có giá trị từ 0 đến 1 để đảm bảo tính chất dương và tích cực của phương sai. Trong trường hợp p = 0 và q = 0, mô hình GARCH trở thành mô hình ARCH.

Mô hình GARCH được ước lượng thông qua các phương pháp tối đa hóa hàm hợp lý hoặc phương pháp bình phương tối thiểu. Các giá trị ước lượng của các tham số được xác định để tối thiểu hóa sai số giữa dữ liệu quan sát và dữ liệu được dự đoán từ mô hình GARCH.

Mô hình GARCH được sử dụng rộng rãi trong các ứng dụng tài chính như dự báo giá trị tài sản, quản lý rủi ro tài chính, và đánh giá tác động của biến động thị trường lên các quyết định đầu tư và giao dịch.

2. Kiểm tra các mô hình Garch ( 1.1)

Chuẩn bị dữ liệu

library(readxl)
library(rugarch)
## Loading required package: parallel
## 
## Attaching package: 'rugarch'
## The following object is masked from 'package:stats':
## 
##     sigma
library(nortest)
library(kSamples)
## Loading required package: SuppDists
## 
## Attaching package: 'kSamples'
## The following object is masked from 'package:nortest':
## 
##     ad.test
sp500 <- read_excel("d:/thayduy/sp500.xlsx")
vni <- read_excel("d:/thayduy/vni.xlsx")
vni.ts <- ts(vni[, 2])
sp500.ts <- ts(sp500[, 2])

2.1 Mô hình GARCH(1,1) với phân phối chuẩn

# Xây dựng mô hình GARCH(1,1) với phân phối chuẩn cho S&P 500

sp500.garch11n.spec <- ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(1, 1)),
                                mean.model = list(armaOrder = c(2, 2)),
                                distribution.model = "norm")

sp500.garch11n.fit <- ugarchfit(spec = sp500.garch11n.spec, data = sp500.ts)

# Xây dựng mô hình GARCH(1,1) với phân phốichuẩn cho Vni Index

vni.garch11n.spec <- ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(1, 1)),
                                mean.model = list(armaOrder = c(2, 2)),
                                distribution.model = "norm")

vni.garch11n.fit <- ugarchfit(spec = vni.garch11n.spec, data = vni.ts)

Hiển thị kết quả ước lượng phân phối chuẩn cho S&P500

show(sp500.garch11n.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : sGARCH(1,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : norm 
## 
## Optimal Parameters
## ------------------------------------
##           Estimate  Std. Error   t value Pr(>|t|)
## mu     3226.187152    3.897492  827.7597        0
## ar1       0.026033    0.000445   58.5024        0
## ar2       0.975637    0.000492 1984.6850        0
## ma1       0.929461    0.000168 5540.2094        0
## ma2      -0.047145    0.000998  -47.2393        0
## omega    11.482801    1.950025    5.8885        0
## alpha1    0.168870    0.017947    9.4095        0
## beta1     0.795209    0.019154   41.5174        0
## 
## Robust Standard Errors:
##           Estimate  Std. Error   t value Pr(>|t|)
## mu     3226.187152    3.570185  903.6472  0.0e+00
## ar1       0.026033    0.000169  154.3723  0.0e+00
## ar2       0.975637    0.000265 3674.9718  0.0e+00
## ma1       0.929461    0.000218 4264.8035  0.0e+00
## ma2      -0.047145    0.001148  -41.0656  0.0e+00
## omega    11.482801    2.633993    4.3595  1.3e-05
## alpha1    0.168870    0.021442    7.8757  0.0e+00
## beta1     0.795209    0.025934   30.6622  0.0e+00
## 
## LogLikelihood : -10348.76 
## 
## Information Criteria
## ------------------------------------
##                    
## Akaike       8.2327
## Bayes        8.2513
## Shibata      8.2327
## Hannan-Quinn 8.2394
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.1295  0.7189
## Lag[2*(p+q)+(p+q)-1][11]    3.5718  1.0000
## Lag[4*(p+q)+(p+q)-1][19]    8.3488  0.7435
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                      5.976 0.01450
## Lag[2*(p+q)+(p+q)-1][5]     6.319 0.07559
## Lag[4*(p+q)+(p+q)-1][9]    10.378 0.04160
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]   0.07322 0.500 2.000  0.7867
## ARCH Lag[5]   0.77309 1.440 1.667  0.8012
## ARCH Lag[7]   5.44609 2.315 1.543  0.1832
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  2.4427
## Individual Statistics:               
## mu     0.003354
## ar1    0.183732
## ar2    0.185747
## ma1    0.055399
## ma2    0.057985
## omega  0.447334
## alpha1 0.814921
## beta1  0.514002
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          1.89 2.11 2.59
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                    t-value     prob sig
## Sign Bias           1.1494 0.250492    
## Negative Sign Bias  0.6813 0.495732    
## Positive Sign Bias  1.8252 0.068089   *
## Joint Effect       14.1621 0.002693 ***
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     122.0    4.755e-17
## 2    30     128.8    1.560e-14
## 3    40     144.3    5.288e-14
## 4    50     164.2    2.364e-14
## 
## 
## Elapsed time : 0.8862259

Hiển thị kết quả ước lượng phân phối chuẩn cho Vni index

show(vni.garch11n.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : sGARCH(1,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : norm 
## 
## Optimal Parameters
## ------------------------------------
##          Estimate  Std. Error     t value Pr(>|t|)
## mu     963.004001    4.324673   222.67673 0.000000
## ar1      1.344054    0.000287  4677.81380 0.000000
## ar2     -0.343843    0.000200 -1718.00686 0.000000
## ma1     -0.249088    0.021850   -11.39973 0.000000
## ma2      0.004103    0.021591     0.19005 0.849269
## omega    1.449502    0.320625     4.52087 0.000006
## alpha1   0.136824    0.016339     8.37428 0.000000
## beta1    0.834577    0.019037    43.83865 0.000000
## 
## Robust Standard Errors:
##          Estimate  Std. Error     t value Pr(>|t|)
## mu     963.004001    0.329651  2921.28391 0.000000
## ar1      1.344054    0.000401  3353.12487 0.000000
## ar2     -0.343843    0.000168 -2043.65916 0.000000
## ma1     -0.249088    0.019847   -12.55024 0.000000
## ma2      0.004103    0.021909     0.18729 0.851434
## omega    1.449502    0.436859     3.31801 0.000907
## alpha1   0.136824    0.021469     6.37308 0.000000
## beta1    0.834577    0.025569    32.64047 0.000000
## 
## LogLikelihood : -8012.503 
## 
## Information Criteria
## ------------------------------------
##                    
## Akaike       6.4344
## Bayes        6.4531
## Shibata      6.4344
## Hannan-Quinn 6.4412
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       2.016  0.1557
## Lag[2*(p+q)+(p+q)-1][11]     6.489  0.2052
## Lag[4*(p+q)+(p+q)-1][19]    10.482  0.3904
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                      2.568 0.10905
## Lag[2*(p+q)+(p+q)-1][5]     7.238 0.04538
## Lag[4*(p+q)+(p+q)-1][9]     8.644 0.09605
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]    0.2445 0.500 2.000  0.6210
## ARCH Lag[5]    0.8337 1.440 1.667  0.7829
## ARCH Lag[7]    0.9151 2.315 1.543  0.9270
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  2.2505
## Individual Statistics:               
## mu     0.001966
## ar1    0.382504
## ar2    0.387634
## ma1    0.302637
## ma2    0.127552
## omega  0.197544
## alpha1 0.474847
## beta1  0.564236
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          1.89 2.11 2.59
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                    t-value    prob sig
## Sign Bias            1.181 0.23782    
## Negative Sign Bias   1.780 0.07527   *
## Positive Sign Bias   1.301 0.19329    
## Joint Effect         5.111 0.16384    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     52.21    6.144e-05
## 2    30     67.97    5.709e-05
## 3    40     80.91    9.285e-05
## 4    50     92.18    1.865e-04
## 
## 
## Elapsed time : 1.013163

2.2 Mô hình GARCH(1,1) với phân phối Student’s

# Xây dựng mô hình GARCH(1,1) với phân phối Student's t cho S&P 500
sp500.garch11t.spec <- ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(1, 1)),
                                mean.model = list(armaOrder = c(2, 2)),
                                distribution.model = "std")

sp500.garch11t.fit <- ugarchfit(spec = sp500.garch11t.spec, data = sp500.ts)

# Xây dựng mô hình GARCH(1,1) với phân phối Student's t cho VN Index
vni.garch11t.spec <- ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(1, 1)),
                                mean.model = list(armaOrder = c(2, 2)),
                                distribution.model = "std")

vni.garch11t.fit <- ugarchfit(spec = vni.garch11t.spec, data = vni.ts)

Hiển thị kết quả ước lượng phân phối Student’s cho S&P500

show(sp500.garch11t.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : sGARCH(1,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : std 
## 
## Optimal Parameters
## ------------------------------------
##           Estimate  Std. Error    t value Pr(>|t|)
## mu     3228.915767    3.571565   904.0620  0.0e+00
## ar1       0.021915    0.000399    54.9883  0.0e+00
## ar2       0.979849    0.000449  2182.5026  0.0e+00
## ma1       0.936654    0.000012 80883.6704  0.0e+00
## ma2      -0.046535    0.000190  -244.6059  0.0e+00
## omega    10.399622    2.398393     4.3361  1.5e-05
## alpha1    0.183031    0.023945     7.6439  0.0e+00
## beta1     0.796781    0.022961    34.7011  0.0e+00
## shape     5.472625    0.674637     8.1120  0.0e+00
## 
## Robust Standard Errors:
##           Estimate  Std. Error    t value Pr(>|t|)
## mu     3228.915767    4.021782   802.8570  0.00000
## ar1       0.021915    0.000130   168.7963  0.00000
## ar2       0.979849    0.000245  4002.0689  0.00000
## ma1       0.936654    0.000012 74982.4191  0.00000
## ma2      -0.046535    0.000138  -337.3722  0.00000
## omega    10.399622    2.862567     3.6330  0.00028
## alpha1    0.183031    0.024317     7.5270  0.00000
## beta1     0.796781    0.027599    28.8702  0.00000
## shape     5.472625    0.621800     8.8013  0.00000
## 
## LogLikelihood : -10298.71 
## 
## Information Criteria
## ------------------------------------
##                    
## Akaike       8.1937
## Bayes        8.2146
## Shibata      8.1937
## Hannan-Quinn 8.2013
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                     0.04492  0.8321
## Lag[2*(p+q)+(p+q)-1][11]   3.58570  1.0000
## Lag[4*(p+q)+(p+q)-1][19]   8.28697  0.7528
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic  p-value
## Lag[1]                      7.107 0.007678
## Lag[2*(p+q)+(p+q)-1][5]     7.469 0.039841
## Lag[4*(p+q)+(p+q)-1][9]    10.966 0.030941
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]   0.01108 0.500 2.000  0.9162
## ARCH Lag[5]   0.65864 1.440 1.667  0.8360
## ARCH Lag[7]   4.68453 2.315 1.543  0.2584
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  2.4351
## Individual Statistics:               
## mu     0.008829
## ar1    0.360857
## ar2    0.359337
## ma1    0.079959
## ma2    0.079106
## omega  0.549599
## alpha1 0.621165
## beta1  0.438948
## shape  0.437326
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          2.1 2.32 2.82
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                    t-value     prob sig
## Sign Bias           1.0802 0.280143    
## Negative Sign Bias  0.3768 0.706383    
## Positive Sign Bias  2.1629 0.030643  **
## Joint Effect       14.4465 0.002356 ***
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     48.94    0.0001871
## 2    30     59.02    0.0008175
## 3    40     75.99    0.0003577
## 4    50     79.47    0.0038222
## 
## 
## Elapsed time : 1.936476

Hiển thị kết quả ước lượng phân phối Student’s cho Vni Index

show(vni.garch11t.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : sGARCH(1,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : std 
## 
## Optimal Parameters
## ------------------------------------
##          Estimate  Std. Error    t value Pr(>|t|)
## mu     961.154434    3.267947   294.1157 0.000000
## ar1      1.736325    0.000235  7388.8176 0.000000
## ar2     -0.736189    0.000136 -5401.5849 0.000000
## ma1     -0.637519    0.020927   -30.4635 0.000000
## ma2     -0.037811    0.020911    -1.8082 0.070573
## omega    1.292296    0.346081     3.7341 0.000188
## alpha1   0.128878    0.018384     7.0104 0.000000
## beta1    0.847176    0.020795    40.7399 0.000000
## shape    7.619269    1.137072     6.7008 0.000000
## 
## Robust Standard Errors:
##          Estimate  Std. Error    t value Pr(>|t|)
## mu     961.154434    0.652622  1472.7586 0.000000
## ar1      1.736325    0.000779  2229.3464 0.000000
## ar2     -0.736189    0.000322 -2289.6193 0.000000
## ma1     -0.637519    0.018990   -33.5714 0.000000
## ma2     -0.037811    0.020726    -1.8243 0.068111
## omega    1.292296    0.402552     3.2103 0.001326
## alpha1   0.128878    0.020444     6.3039 0.000000
## beta1    0.847176    0.023920    35.4167 0.000000
## shape    7.619269    1.040935     7.3196 0.000000
## 
## LogLikelihood : -7981.135 
## 
## Information Criteria
## ------------------------------------
##                    
## Akaike       6.4101
## Bayes        6.4311
## Shibata      6.4100
## Hannan-Quinn 6.4177
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic   p-value
## Lag[1]                       2.453 1.173e-01
## Lag[2*(p+q)+(p+q)-1][11]     9.007 6.284e-06
## Lag[4*(p+q)+(p+q)-1][19]    13.343 8.880e-02
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                      1.822 0.17705
## Lag[2*(p+q)+(p+q)-1][5]     7.135 0.04810
## Lag[4*(p+q)+(p+q)-1][9]     8.706 0.09331
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]   0.07183 0.500 2.000  0.7887
## ARCH Lag[5]   0.58501 1.440 1.667  0.8583
## ARCH Lag[7]   0.69865 2.315 1.543  0.9570
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  2.3798
## Individual Statistics:                
## mu     0.0009349
## ar1    0.3844638
## ar2    0.3870393
## ma1    0.2240041
## ma2    0.0797225
## omega  0.2090513
## alpha1 0.3109258
## beta1  0.4505811
## shape  0.0950635
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          2.1 2.32 2.82
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                    t-value    prob sig
## Sign Bias            1.919 0.05505   *
## Negative Sign Bias   2.363 0.01819  **
## Positive Sign Bias   1.478 0.13949    
## Joint Effect         7.770 0.05100   *
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     28.00     0.083375
## 2    30     50.24     0.008515
## 3    40     56.59     0.033974
## 4    50     72.64     0.015748
## 
## 
## Elapsed time : 1.062351

2.3 Mô hình GARCH(1,1) với phân phối Skewed Student’s

# Xây dựng mô hình GARCH(1,1) với phân phối Skewed Student's cho S&P500

sp500.garch11st.spec <- ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(1, 1)),
                                 mean.model = list(armaOrder = c(2, 2)),
                                 distribution.model = "sstd")

sp500.garch11st.fit <- ugarchfit(spec = sp500.garch11st.spec, data = sp500.ts)

# Xây dựng mô hình GARCH(1,1) với phân phối Skewed Student's cho Vni index
vni.garch11st.spec <- ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(1, 1)),
                                 mean.model = list(armaOrder = c(2, 2)),
                                 distribution.model = "sstd")

vni.garch11st.fit <- ugarchfit(spec = vni.garch11st.spec, data = vni.ts)

Hiển thị kết quả ước lượng phân phối Skewed Student’s cho S&P500

show(sp500.garch11st.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : sGARCH(1,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : sstd 
## 
## Optimal Parameters
## ------------------------------------
##          Estimate  Std. Error    t value Pr(>|t|)
## mu     1.9583e+03   64.694172   30.26964  0.00000
## ar1    9.5331e-01    0.000818 1166.02886  0.00000
## ar2    4.6316e-02    0.000484   95.68186  0.00000
## ma1    1.8415e-02    0.020839    0.88367  0.37687
## ma2    2.7120e-03    0.020559    0.13193  0.89504
## omega  2.1958e+01    3.971521    5.52883  0.00000
## alpha1 2.3580e-01    0.029292    8.04978  0.00000
## beta1  7.2658e-01    0.024227   29.99062  0.00000
## skew   1.0385e+00    0.023834   43.57115  0.00000
## shape  4.3115e+00    0.403770   10.67809  0.00000
## 
## Robust Standard Errors:
##          Estimate  Std. Error    t value Pr(>|t|)
## mu     1.9583e+03   68.015112   28.79168 0.000000
## ar1    9.5331e-01    0.000830 1148.94714 0.000000
## ar2    4.6316e-02    0.000688   67.33262 0.000000
## ma1    1.8415e-02    0.018872    0.97576 0.329183
## ma2    2.7120e-03    0.021155    0.12822 0.897977
## omega  2.1958e+01    8.061547    2.72378 0.006454
## alpha1 2.3580e-01    0.039300    5.99986 0.000000
## beta1  7.2658e-01    0.047801   15.20020 0.000000
## skew   1.0385e+00    0.023475   44.23738 0.000000
## shape  4.3115e+00    0.740726    5.82064 0.000000
## 
## LogLikelihood : -10385.12 
## 
## Information Criteria
## ------------------------------------
##                    
## Akaike       8.2632
## Bayes        8.2864
## Shibata      8.2632
## Hannan-Quinn 8.2716
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       145.4       0
## Lag[2*(p+q)+(p+q)-1][11]     146.2       0
## Lag[4*(p+q)+(p+q)-1][19]     147.4       0
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                      624.3       0
## Lag[2*(p+q)+(p+q)-1][5]     624.3       0
## Lag[4*(p+q)+(p+q)-1][9]     624.3       0
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]  0.001873 0.500 2.000  0.9655
## ARCH Lag[5]  0.004542 1.440 1.667  0.9998
## ARCH Lag[7]  0.006355 2.315 1.543  1.0000
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  17.7507
## Individual Statistics:               
## mu     10.24353
## ar1     5.35625
## ar2     5.34770
## ma1     0.08621
## ma2     0.03857
## omega   0.60080
## alpha1  0.57646
## beta1   0.18322
## skew    0.34581
## shape   0.23472
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          2.29 2.54 3.05
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                      t-value      prob sig
## Sign Bias             6.3729 2.200e-10 ***
## Negative Sign Bias    0.0534 9.574e-01    
## Positive Sign Bias   46.6568 0.000e+00 ***
## Joint Effect       2178.5733 0.000e+00 ***
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     71.62    4.947e-08
## 2    30     90.45    3.107e-08
## 3    40    102.38    1.360e-07
## 4    50    115.72    2.548e-07
## 
## 
## Elapsed time : 1.069155

Hiển thị kết quả ước lượng phân phối Skewed Student’s cho Vni index

show(vni.garch11st.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : sGARCH(1,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : sstd 
## 
## Optimal Parameters
## ------------------------------------
##          Estimate  Std. Error    t value Pr(>|t|)
## mu     961.598662    3.237618   297.0081 0.000000
## ar1      1.744265    0.000276  6313.9222 0.000000
## ar2     -0.744184    0.000162 -4587.2072 0.000000
## ma1     -0.646397    0.020883   -30.9525 0.000000
## ma2     -0.037845    0.020919    -1.8092 0.070426
## omega    1.233576    0.333528     3.6986 0.000217
## alpha1   0.122470    0.017725     6.9095 0.000000
## beta1    0.854911    0.020096    42.5415 0.000000
## skew     1.080842    0.037957    28.4755 0.000000
## shape    7.575020    1.137274     6.6607 0.000000
## 
## Robust Standard Errors:
##          Estimate  Std. Error    t value Pr(>|t|)
## mu     961.598662    0.578596  1661.9513 0.000000
## ar1      1.744265    0.001157  1508.0514 0.000000
## ar2     -0.744184    0.000554 -1344.1952 0.000000
## ma1     -0.646397    0.019175   -33.7104 0.000000
## ma2     -0.037845    0.020999    -1.8023 0.071502
## omega    1.233576    0.422777     2.9178 0.003525
## alpha1   0.122470    0.019895     6.1559 0.000000
## beta1    0.854911    0.024755    34.5355 0.000000
## skew     1.080842    0.103660    10.4268 0.000000
## shape    7.575020    1.068569     7.0889 0.000000
## 
## LogLikelihood : -7977.275 
## 
## Information Criteria
## ------------------------------------
##                    
## Akaike       6.4078
## Bayes        6.4311
## Shibata      6.4077
## Hannan-Quinn 6.4162
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic   p-value
## Lag[1]                       2.422 1.196e-01
## Lag[2*(p+q)+(p+q)-1][11]     9.163 2.496e-06
## Lag[4*(p+q)+(p+q)-1][19]    13.593 7.572e-02
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                      1.314 0.25175
## Lag[2*(p+q)+(p+q)-1][5]     7.481 0.03958
## Lag[4*(p+q)+(p+q)-1][9]     9.100 0.07753
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]    0.0189 0.500 2.000  0.8907
## ARCH Lag[5]    0.4538 1.440 1.667  0.8972
## ARCH Lag[7]    0.5980 2.315 1.543  0.9687
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  2.5259
## Individual Statistics:                
## mu     0.0005634
## ar1    0.3458817
## ar2    0.3478941
## ma1    0.1663767
## ma2    0.0857640
## omega  0.2286070
## alpha1 0.3234305
## beta1  0.4950825
## skew   0.1271073
## shape  0.0928209
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          2.29 2.54 3.05
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                    t-value    prob sig
## Sign Bias            1.972 0.04875  **
## Negative Sign Bias   2.521 0.01176  **
## Positive Sign Bias   1.337 0.18136    
## Joint Effect         8.145 0.04312  **
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     27.70     0.089416
## 2    30     50.07     0.008879
## 3    40     45.07     0.233045
## 4    50     59.73     0.140157
## 
## 
## Elapsed time : 1.782746

2.4 Mô hình GARCH(1,1) với phân phối Generalized Error Distribution (GED)

# Xây dựng mô hình GARCH(1,1) dạng GJR-GARCH với phân phối GED cho S&P500

sp500.garch11g.spec <- ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(1, 1)),
                                mean.model = list(armaOrder = c(2, 2)),
                                distribution.model = "ged")

sp500.garch11g.fit <- ugarchfit(spec = sp500.garch11g.spec, data = sp500.ts)

# Xây dựng mô hình GARCH(1,1) dạng GJR-GARCH với phân phối GED cho Vni index

vni.garch11g.spec <- ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(1, 1)),
                                mean.model = list(armaOrder = c(2, 2)),
                                distribution.model = "ged")

vni.garch11g.fit <- ugarchfit(spec = vni.garch11g.spec, data = vni.ts)

Hiển thị kết quả ước lượng phân phối Generalized Error Distribution (GED) cho S&P500

show(sp500.garch11g.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : sGARCH(1,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : ged 
## 
## Optimal Parameters
## ------------------------------------
##           Estimate  Std. Error   t value Pr(>|t|)
## mu     3226.130324    9.723780  331.7774 0.000000
## ar1       0.390829    0.000280 1395.2177 0.000000
## ar2       0.610441    0.000294 2073.4360 0.000000
## ma1       0.573095    0.018325   31.2744 0.000000
## ma2      -0.025882    0.018553   -1.3950 0.163005
## omega    10.832792    2.410459    4.4941 0.000007
## alpha1    0.173440    0.022617    7.6686 0.000000
## beta1     0.796127    0.023549   33.8070 0.000000
## shape     1.253469    0.050393   24.8738 0.000000
## 
## Robust Standard Errors:
##           Estimate  Std. Error   t value Pr(>|t|)
## mu     3226.130324    2.605393 1238.2511  0.00000
## ar1       0.390829    0.000138 2823.7609  0.00000
## ar2       0.610441    0.000166 3666.5550  0.00000
## ma1       0.573095    0.015683   36.5425  0.00000
## ma2      -0.025882    0.016977   -1.5246  0.12737
## omega    10.832792    2.669545    4.0579  0.00005
## alpha1    0.173440    0.021682    7.9993  0.00000
## beta1     0.796127    0.025930   30.7032  0.00000
## shape     1.253469    0.049237   25.4576  0.00000
## 
## LogLikelihood : -10283.16 
## 
## Information Criteria
## ------------------------------------
##                    
## Akaike       8.1814
## Bayes        8.2022
## Shibata      8.1813
## Hannan-Quinn 8.1889
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                   0.0004864  0.9824
## Lag[2*(p+q)+(p+q)-1][11] 3.2893572  1.0000
## Lag[4*(p+q)+(p+q)-1][19] 7.9499680  0.8012
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                      6.511 0.01072
## Lag[2*(p+q)+(p+q)-1][5]     6.811 0.05761
## Lag[4*(p+q)+(p+q)-1][9]    10.570 0.03778
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]   0.03214 0.500 2.000  0.8577
## ARCH Lag[5]   0.67604 1.440 1.667  0.8307
## ARCH Lag[7]   5.02339 2.315 1.543  0.2222
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  2.0168
## Individual Statistics:                
## mu     0.0006833
## ar1    0.2019893
## ar2    0.2038341
## ma1    0.1024212
## ma2    0.0714315
## omega  0.5246989
## alpha1 0.6751489
## beta1  0.4586168
## shape  0.1464896
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          2.1 2.32 2.82
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                    t-value     prob sig
## Sign Bias           0.9856 0.324429    
## Negative Sign Bias  0.5746 0.565617    
## Positive Sign Bias  2.0595 0.039546  **
## Joint Effect       13.8874 0.003063 ***
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     24.75      0.16903
## 2    30     34.83      0.21002
## 3    40     52.68      0.07059
## 4    50     53.20      0.31583
## 
## 
## Elapsed time : 2.34875

Hiển thị kết quả ước lượng phân phối Generalized Error Distribution (GED) cho Vni index

show(vni.garch11g.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : sGARCH(1,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : ged 
## 
## Optimal Parameters
## ------------------------------------
##          Estimate  Std. Error    t value Pr(>|t|)
## mu     960.942236    3.083267   311.6637 0.000000
## ar1      1.791650    0.000227  7904.0519 0.000000
## ar2     -0.791553    0.000129 -6114.9768 0.000000
## ma1     -0.695702    0.020958   -33.1951 0.000000
## ma2     -0.044993    0.020977    -2.1448 0.031965
## omega    1.388719    0.359378     3.8642 0.000111
## alpha1   0.132649    0.018536     7.1563 0.000000
## beta1    0.839659    0.021519    39.0194 0.000000
## shape    1.463724    0.058250    25.1283 0.000000
## 
## Robust Standard Errors:
##          Estimate  Std. Error    t value Pr(>|t|)
## mu     960.942236    0.760257  1263.9696 0.000000
## ar1      1.791650    0.000932  1921.6434 0.000000
## ar2     -0.791553    0.000387 -2046.8437 0.000000
## ma1     -0.695702    0.019854   -35.0405 0.000000
## ma2     -0.044993    0.021325    -2.1099 0.034870
## omega    1.388719    0.416739     3.3323 0.000861
## alpha1   0.132649    0.020879     6.3532 0.000000
## beta1    0.839659    0.024847    33.7933 0.000000
## shape    1.463724    0.059358    24.6594 0.000000
## 
## LogLikelihood : -7981.762 
## 
## Information Criteria
## ------------------------------------
##                    
## Akaike       6.4106
## Bayes        6.4316
## Shibata      6.4105
## Hannan-Quinn 6.4182
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic   p-value
## Lag[1]                       2.086 1.487e-01
## Lag[2*(p+q)+(p+q)-1][11]     8.891 1.222e-05
## Lag[4*(p+q)+(p+q)-1][19]    13.296 9.142e-02
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                      2.148 0.14273
## Lag[2*(p+q)+(p+q)-1][5]     7.048 0.05049
## Lag[4*(p+q)+(p+q)-1][9]     8.574 0.09921
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]    0.1362 0.500 2.000  0.7121
## ARCH Lag[5]    0.7148 1.440 1.667  0.8189
## ARCH Lag[7]    0.8170 2.315 1.543  0.9414
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  2.8247
## Individual Statistics:               
## mu     0.000646
## ar1    0.368203
## ar2    0.369140
## ma1    0.155638
## ma2    0.091504
## omega  0.198787
## alpha1 0.369085
## beta1  0.493752
## shape  0.135731
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          2.1 2.32 2.82
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                    t-value    prob sig
## Sign Bias            2.325 0.02017  **
## Negative Sign Bias   2.520 0.01180  **
## Positive Sign Bias   1.733 0.08322   *
## Joint Effect         9.432 0.02407  **
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     29.91     0.052927
## 2    30     51.54     0.006137
## 3    40     54.85     0.047425
## 4    50     69.76     0.027259
## 
## 
## Elapsed time : 2.226902

2.5 Mô hình GARCH(1,1) với phân phối Skewed Generalized Error Distribution (SGED)

# Mô hình GARCH(1,1) với phân phối Skewed Generalized Error Distribution (SGED) cho S&P500
sp500.garch11sg.spec <- ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(1, 1)),
                                 mean.model = list(armaOrder = c(2, 2)),
                                 distribution.model = "sged")

sp500.garch11sg.fit <- ugarchfit(spec = sp500.garch11sg.spec, data = sp500.ts)

# Mô hình GARCH(1,1) với phân phối Skewed Generalized Error Distribution (SGED) cho Vni index
vni.garch11sg.spec <- ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(1, 1)),
                                 mean.model = list(armaOrder = c(2, 2)),
                                 distribution.model = "sged")

vni.garch11sg.fit <- ugarchfit(spec = vni.garch11sg.spec, data = vni.ts)

Hiển thị kết quả ước lượng phân phối Skewed Generalized Error Distribution (SGED) cho S&P500

show(sp500.garch11sg.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : sGARCH(1,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : sged 
## 
## Optimal Parameters
## ------------------------------------
##           Estimate  Std. Error    t value Pr(>|t|)
## mu     3227.009419    0.387913  8318.9074 0.000000
## ar1       1.995938    0.000240  8332.8451 0.000000
## ar2      -0.995936    0.000127 -7846.0845 0.000000
## ma1      -1.043028    0.000392 -2659.2504 0.000000
## ma2       0.042143    0.000269   156.7364 0.000000
## omega    11.183283    6.640945     1.6840 0.092184
## alpha1    0.189443    0.082870     2.2860 0.022253
## beta1     0.781926    0.094784     8.2496 0.000000
## skew      0.947953    0.048007    19.7460 0.000000
## shape     1.233662    0.061475    20.0677 0.000000
## 
## Robust Standard Errors:
##           Estimate  Std. Error    t value Pr(>|t|)
## mu     3227.009419  8.5514e+01  37.736584 0.000000
## ar1       1.995938  1.5018e-01  13.290752 0.000000
## ar2      -0.995936  8.0485e-02 -12.374225 0.000000
## ma1      -1.043028  2.1545e-01  -4.841215 0.000001
## ma2       0.042143  1.4548e-01   0.289679 0.772062
## omega    11.183283  3.4125e+03   0.003277 0.997385
## alpha1    0.189443  4.3337e+01   0.004371 0.996512
## beta1     0.781926  5.0412e+01   0.015511 0.987625
## skew      0.947953  2.4956e+01   0.037984 0.969700
## shape     1.233662  2.0289e+01   0.060805 0.951515
## 
## LogLikelihood : -10265.96 
## 
## Information Criteria
## ------------------------------------
##                    
## Akaike       8.1685
## Bayes        8.1917
## Shibata      8.1685
## Hannan-Quinn 8.1769
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                    0.004447  0.9468
## Lag[2*(p+q)+(p+q)-1][11]  4.388163  0.9983
## Lag[4*(p+q)+(p+q)-1][19]  9.574376  0.5403
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                      7.398 0.00653
## Lag[2*(p+q)+(p+q)-1][5]     7.827 0.03252
## Lag[4*(p+q)+(p+q)-1][9]    11.219 0.02718
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3] 1.495e-05 0.500 2.000  0.9969
## ARCH Lag[5] 6.634e-01 1.440 1.667  0.8346
## ARCH Lag[7] 4.503e+00 2.315 1.543  0.2798
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  4.7881
## Individual Statistics:              
## mu     0.42237
## ar1    1.65409
## ar2    0.67490
## ma1    0.38549
## ma2    0.38289
## omega  0.39525
## alpha1 0.63148
## beta1  0.37292
## skew   0.04372
## shape  0.16704
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          2.29 2.54 3.05
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                    t-value      prob sig
## Sign Bias            1.556 0.1197798    
## Negative Sign Bias   0.210 0.8337087    
## Positive Sign Bias   2.051 0.0403634  **
## Joint Effect        16.936 0.0007286 ***
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     19.96       0.3969
## 2    30     26.77       0.5839
## 3    40     35.48       0.6313
## 4    50     46.04       0.5937
## 
## 
## Elapsed time : 7.05034

Hiển thị kết quả ước lượng phân phối Skewed Generalized Error Distribution (SGED) cho Vni index

show(vni.garch11sg.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : sGARCH(1,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : sged 
## 
## Optimal Parameters
## ------------------------------------
##          Estimate  Std. Error    t value Pr(>|t|)
## mu     960.368842    0.778652 1.2334e+03 0.000000
## ar1      0.011616    0.001350 8.6017e+00 0.000000
## ar2      0.989010    0.001378 7.1795e+02 0.000000
## ma1      1.083134    0.000006 1.6932e+05 0.000000
## ma2      0.092332    0.000608 1.5176e+02 0.000000
## omega    1.293495    0.335739 3.8527e+00 0.000117
## alpha1   0.125261    0.017756 7.0548e+00 0.000000
## beta1    0.849070    0.020453 4.1513e+01 0.000000
## skew     1.071324    0.028557 3.7516e+01 0.000000
## shape    1.471496    0.058246 2.5263e+01 0.000000
## 
## Robust Standard Errors:
##          Estimate  Std. Error    t value Pr(>|t|)
## mu     960.368842    0.916964 1.0473e+03 0.000000
## ar1      0.011616    0.000664 1.7489e+01 0.000000
## ar2      0.989010    0.000692 1.4289e+03 0.000000
## ma1      1.083134    0.000008 1.3049e+05 0.000000
## ma2      0.092332    0.000416 2.2191e+02 0.000000
## omega    1.293495    0.388002 3.3337e+00 0.000857
## alpha1   0.125261    0.020172 6.2096e+00 0.000000
## beta1    0.849070    0.023717 3.5800e+01 0.000000
## skew     1.071324    0.031240 3.4293e+01 0.000000
## shape    1.471496    0.057671 2.5515e+01 0.000000
## 
## LogLikelihood : -7980.228 
## 
## Information Criteria
## ------------------------------------
##                    
## Akaike       6.4101
## Bayes        6.4335
## Shibata      6.4101
## Hannan-Quinn 6.4186
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic   p-value
## Lag[1]                       2.142 1.433e-01
## Lag[2*(p+q)+(p+q)-1][11]     8.663 4.329e-05
## Lag[4*(p+q)+(p+q)-1][19]    12.488 1.478e-01
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                      1.588 0.20763
## Lag[2*(p+q)+(p+q)-1][5]     7.776 0.03349
## Lag[4*(p+q)+(p+q)-1][9]     9.352 0.06875
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]   0.09184 0.500 2.000  0.7619
## ARCH Lag[5]   0.64072 1.440 1.667  0.8414
## ARCH Lag[7]   0.77181 2.315 1.543  0.9476
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  2.7048
## Individual Statistics:              
## mu     0.00351
## ar1    0.45579
## ar2    0.44843
## ma1    0.03177
## ma2    0.03843
## omega  0.21648
## alpha1 0.39087
## beta1  0.55462
## skew   0.10851
## shape  0.18056
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          2.29 2.54 3.05
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                    t-value    prob sig
## Sign Bias            1.450 0.14720    
## Negative Sign Bias   2.231 0.02575  **
## Positive Sign Bias   1.232 0.21809    
## Joint Effect         6.662 0.08350   *
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     25.23       0.1532
## 2    30     28.07       0.5141
## 3    40     46.93       0.1794
## 4    50     59.61       0.1425
## 
## 
## Elapsed time : 4.111848

3. Lựa chọn mô hình phù hợp cho chuỗi S&P500 và Vni Index

3.1 Mô hình phù hợp cho chuỗi S&P500

sp500.model.list <- list(
  garch11n = sp500.garch11n.fit,
  garch11t = sp500.garch11t.fit,
  garch11st = sp500.garch11st.fit,
  garch11g = sp500.garch11g.fit,
  garch11sg = sp500.garch11sg.fit)

sp500.info.mat <- sapply(sp500.model.list, infocriteria)
rownames(sp500.info.mat) <- rownames(infocriteria(sp500.garch11n.fit))
sp500.info.mat
##              garch11n garch11t garch11st garch11g garch11sg
## Akaike       8.232715 8.193728  8.263214 8.181369  8.168486
## Bayes        8.251254 8.214584  8.286388 8.202225  8.191660
## Shibata      8.232695 8.193703  8.263183 8.181344  8.168455
## Hannan-Quinn 8.239443 8.201298  8.271625 8.188938  8.176896

Dựa trên giá trị thông tin tiêu chuẩn, mô hình garch11sg có giá trị Akaike thấp nhất (8.393800) và giá trị Hannan-Quinn thấp nhất (8.401530). Điều này cho thấy mô hình GARCH(1,1) với phân phối Skewed Generalized Error Distribution (SGED) này có khả năng phù hợp tốt với chuỗi dữ liệu S&P500.

3.2 Mô hình phù hợp cho chuỗi Vni index

vni.model.list <- list(
  garch11n = vni.garch11n.fit,
  garch11t = vni.garch11t.fit,
  garch11st = vni.garch11st.fit,
  garch11g = vni.garch11g.fit,
  garch11sg = vni.garch11sg.fit)

vni.info.mat <- sapply(vni.model.list, infocriteria)
rownames(vni.info.mat) <- rownames(infocriteria(vni.garch11n.fit))
vni.info.mat
##              garch11n garch11t garch11st garch11g garch11sg
## Akaike       6.434418 6.410056  6.407761 6.410559  6.410131
## Bayes        6.453099 6.431071  6.431112 6.431574  6.433481
## Shibata      6.434398 6.410030  6.407729 6.410533  6.410099
## Hannan-Quinn 6.441201 6.417687  6.416240 6.418190  6.418609

Dựa trên giá trị thông tin tiêu chuẩn, mô hình garch11sg có giá trị Akaike thấp nhất (6.510118) và giá trị Hannan-Quinn thấp nhất (6.517907). Điều này cho thấy mô hình GARCH(1,1) với phân phối Skewed Generalized Error Distribution (SGED) này có khả năng phù hợp tốt với chuỗi dữ liệu VNI.

4. Kiểm định sự phù hợp của mô hình biên

4.1 Kiểm định sự phù hợp của mô hình biên cho chuỗi Vni

# Trích xuất chuỗi phần dư chuẩn hóa cho VNI
vni.res <- residuals(vni.garch11sg.fit) / sigma(vni.garch11sg.fit)

# Phù hợp chuỗi phần dư với phân phối chuẩn tắc
fitdist(distribution = "sged", vni.res, control = list())
## $pars
##          mu       sigma        skew       shape 
## -0.02988319  0.99568337  1.05905031  1.47168016 
## 
## $convergence
## [1] 0
## 
## $values
## [1] 3529.831 3495.664 3495.664
## 
## $lagrange
## [1] 0
## 
## $hessian
##             [,1]      [,2]       [,3]       [,4]
## [1,] 2692.075907 -297.4597 -647.58351   9.776807
## [2,] -297.459727 3321.2703 -141.10981 234.598897
## [3,] -647.583515 -141.1098 1637.32151 -37.360408
## [4,]    9.776807  234.5989  -37.36041 324.445503
## 
## $ineqx0
## NULL
## 
## $nfuneval
## [1] 90
## 
## $outer.iter
## [1] 2
## 
## $elapsed
## Time difference of 0.3011899 secs
## 
## $vscale
## [1] 1 1 1 1 1
chuoivni <- pdist("sged", vni.res, mu = -0.02323862, sigma = 0.99756213, skew = 1.07399943, shape = 1.39347996)