library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.2 ✔ readr 2.1.4
## ✔ forcats 1.0.0 ✔ stringr 1.5.0
## ✔ ggplot2 3.4.2 ✔ tibble 3.2.1
## ✔ lubridate 1.9.2 ✔ tidyr 1.3.0
## ✔ purrr 1.0.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(readxl)
library(rugarch)
## Warning: package 'rugarch' was built under R version 4.3.1
## Loading required package: parallel
##
## Attaching package: 'rugarch'
##
## The following object is masked from 'package:purrr':
##
## reduce
##
## The following object is masked from 'package:stats':
##
## sigma
library(VineCopula)
## Warning: package 'VineCopula' was built under R version 4.3.1
library(goftest)
data <- read_excel('C:/Users/Thanh Lan/Documents/data.xlsx')
databf <- data %>% filter(Ngày < ymd(20200101))
SGXbf <- ts(databf$SGX)
VNIbf <- ts(databf$VNI)
autoarfima(SGXbf, ar.max = 2, ma.max = 2, criterion = "AIC", method = "full")
## Warning in .makearfimafitmodel(f = .arfimaLLH, T = T, m = m, timer = timer, :
## rugarch-->warning: failed to invert hessian
## $fit
##
## *----------------------------------*
## * ARFIMA Model Fit *
## *----------------------------------*
## Mean Model : ARFIMA(0,0,2)
## Distribution : norm
##
## Optimal Parameters
## ------------------------------------
## Estimate Std. Error t value Pr(>|t|)
## mu 7.70361 0.034725 221.847 0
## ma1 0.00000 NA NA NA
## ma2 0.32023 0.048062 6.663 0
## sigma 0.51888 0.018627 27.857 0
##
## Robust Standard Errors:
## Estimate Std. Error t value Pr(>|t|)
## mu 7.70361 0.034658 222.2726 0
## ma1 0.00000 NA NA NA
## ma2 0.32023 0.053601 5.9744 0
## sigma 0.51888 0.017451 29.7333 0
##
## LogLikelihood : -295.9882
##
## Information Criteria
## ------------------------------------
##
## Akaike 1.5412
## Bayes 1.5718
## Shibata 1.5411
## Hannan-Quinn 1.5533
##
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 0.5681 0.4510
## Lag[2*(p+q)+(p+q)-1][5] 1.3814 0.9993
## Lag[4*(p+q)+(p+q)-1][9] 6.0063 0.2555
##
## H0 : No serial correlation
##
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 28.80 8.017e-08
## Lag[2*(p+q)+(p+q)-1][2] 35.70 3.419e-10
## Lag[4*(p+q)+(p+q)-1][5] 41.12 2.217e-11
##
##
## ARCH LM Tests
## ------------------------------------
## Statistic DoF P-Value
## ARCH Lag[2] 34.62 2 3.035e-08
## ARCH Lag[5] 40.36 5 1.262e-07
## ARCH Lag[10] 40.78 10 1.232e-05
##
## Nyblom stability test
## ------------------------------------
## Joint Statistic: 0.7478
## Individual Statistics:
## mu 0.4022
## ma2 0.1688
## sigma 0.3550
##
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic: 0.846 1.01 1.35
## Individual Statistic: 0.35 0.47 0.75
##
##
## Elapsed time : 0.01550698
##
##
## $rank.matrix
## ar1 ar2 ma1 ma2 im arf AIC converged
## 1 0 0 0 1 1 0 1.541176 1
## 2 0 0 1 1 1 0 1.544345 1
## 3 1 0 0 1 1 0 1.544859 1
## 4 0 1 0 1 1 0 1.546064 1
## 5 0 1 1 1 1 0 1.549018 1
## 6 1 0 1 1 1 0 1.549355 1
## 7 1 1 0 1 1 0 1.549607 1
## 8 1 1 1 1 1 0 1.553850 1
## 9 0 1 0 0 1 0 1.556789 1
## 10 0 1 1 0 1 0 1.559850 1
## 11 1 1 0 0 1 0 1.560980 1
## 12 1 1 1 0 1 0 1.563942 1
## 13 1 0 1 0 1 0 1.623796 1
## 14 1 0 0 0 1 0 1.631975 1
## 15 0 0 1 0 1 0 1.632443 1
## 16 1 0 1 1 0 0 2.282486 1
## 17 1 0 1 0 0 0 2.317816 1
## 18 1 1 0 0 0 0 2.418912 1
## 19 1 1 0 1 0 0 2.422460 1
## 20 1 1 1 1 0 0 2.422843 1
## 21 1 0 0 1 0 0 2.495282 1
## 22 0 1 0 1 0 0 2.514709 1
## 23 0 1 0 0 0 0 2.522562 1
## 24 1 0 0 0 0 0 2.560982 1
## 25 0 0 1 1 0 0 4.971708 1
## 26 0 0 0 1 0 0 5.725967 1
## 27 0 0 1 0 0 0 5.779554 1
## 28 0 0 0 0 1 0 36.847510 1
## 29 0 1 1 1 0 0 108.124214 1
## 30 0 1 1 0 0 0 111.416377 1
## 31 1 1 1 0 0 0 NA 0
autoarfima(VNIbf, ar.max = 2, ma.max = 2, criterion = "AIC", method = "full")
## $fit
##
## *----------------------------------*
## * ARFIMA Model Fit *
## *----------------------------------*
## Mean Model : ARFIMA(2,0,2)
## Distribution : norm
##
## Optimal Parameters
## ------------------------------------
## Estimate Std. Error t value Pr(>|t|)
## mu 990.34373 3.602374 274.914 0
## ar1 0.57512 0.046903 12.262 0
## ar2 -0.83493 0.076387 -10.930 0
## ma1 -0.51317 0.024790 -20.701 0
## ma2 0.94451 0.065482 14.424 0
## sigma 62.48679 2.245776 27.824 0
##
## Robust Standard Errors:
## Estimate Std. Error t value Pr(>|t|)
## mu 990.34373 3.294170 300.6353 0e+00
## ar1 0.57512 0.068607 8.3828 0e+00
## ar2 -0.83493 0.178309 -4.6825 3e-06
## ma1 -0.51317 0.023906 -21.4660 0e+00
## ma2 0.94451 0.170616 5.5359 0e+00
## sigma 62.48679 2.951970 21.1678 0e+00
##
## LogLikelihood : -2154.917
##
## Information Criteria
## ------------------------------------
##
## Akaike 11.139
## Bayes 11.200
## Shibata 11.138
## Hannan-Quinn 11.163
##
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 0.05385 0.8165
## Lag[2*(p+q)+(p+q)-1][11] 3.62225 1.0000
## Lag[4*(p+q)+(p+q)-1][19] 9.29956 0.5874
##
## H0 : No serial correlation
##
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 3.904e-05 0.99501
## Lag[2*(p+q)+(p+q)-1][2] 4.843e+00 0.04482
## Lag[4*(p+q)+(p+q)-1][5] 8.889e+00 0.01765
##
##
## ARCH LM Tests
## ------------------------------------
## Statistic DoF P-Value
## ARCH Lag[2] 9.552 2 0.0084312
## ARCH Lag[5] 12.553 5 0.0279427
## ARCH Lag[10] 29.831 10 0.0009127
##
## Nyblom stability test
## ------------------------------------
## Joint Statistic: 1.4105
## Individual Statistics:
## mu 0.24871
## ar1 0.32465
## ar2 0.18671
## ma1 0.08352
## ma2 0.23598
## sigma 0.19886
##
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic: 1.49 1.68 2.12
## Individual Statistic: 0.35 0.47 0.75
##
##
## Elapsed time : 0.1012959
##
##
## $rank.matrix
## ar1 ar2 ma1 ma2 im arf AIC converged
## 1 1 1 1 1 1 0 11.13875 1
## 2 1 1 0 1 1 0 11.17810 1
## 3 0 1 0 1 1 0 11.17997 1
## 4 0 0 1 1 1 0 11.18294 1
## 5 1 0 0 1 1 0 11.18483 1
## 6 0 0 0 1 1 0 11.18522 1
## 7 1 0 1 1 1 0 11.18587 1
## 8 0 1 1 0 1 0 11.18751 1
## 9 0 1 0 0 1 0 11.18787 1
## 10 1 1 0 0 1 0 11.18877 1
## 11 0 0 0 0 1 0 11.19000 1
## 12 1 1 1 0 1 0 11.19013 1
## 13 1 0 0 0 1 0 11.19021 1
## 14 0 0 1 0 1 0 11.19096 1
## 15 1 0 1 0 1 0 11.19405 1
## 16 1 0 1 1 0 0 11.94942 1
## 17 1 0 1 0 0 0 11.95142 1
## 18 1 0 0 1 0 0 12.06440 1
## 19 1 0 0 0 0 0 12.07435 1
## 20 1 1 0 0 0 0 12.15148 1
## 21 1 1 0 1 0 0 12.15420 1
## 22 0 1 0 1 0 0 12.29227 1
## 23 0 1 0 0 0 0 12.31056 1
## 24 0 0 1 1 0 0 14.57198 1
## 25 0 0 1 0 0 0 15.44917 1
## 26 0 0 0 1 0 0 15.45803 1
## 27 0 1 1 1 1 0 115.82558 1
## 28 0 1 1 1 0 0 117.91496 1
## 29 1 1 1 1 0 0 118.52105 1
## 30 0 1 1 0 0 0 119.69332 1
## 31 1 1 1 0 0 0 121.10410 1
# PHÂN PHỐI CHUẨN
sgxbf11n.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'norm')
sgxbf11n <- ugarchfit(spec = sgxbf11n.spec, SGXbf)
# PHÂN PHỐI STUDENT
sgxbf11std.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'std')
sgxbf11std <- ugarchfit(sgxbf11std.spec, SGXbf)
# PHÂN PHỐI ĐỐI XỨNG (sstd)
sgxbf11sstd.spec <- ugarchspec(variance.model = list( model = 'gjrGARCH', garchOrder = c(1,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sstd')
sgxbf11sstd <- ugarchfit(sgxbf11sstd.spec, SGXbf)
# PHÂN PHỐI Generalized Error Distribution (ged)
sgxbf11ged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)), mean.model = list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "ged")
sgxbf11ged <- ugarchfit(sgxbf11ged.spec, SGXbf)
# PHÂN PHỐI Generalized Error Distribution đối xứng (sged)
sgxbf11sged.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sged')
sgxbf11sged <- ugarchfit(sgxbf11sged.spec, SGXbf)
# PHÂN PHỐI CHUẨN
sgxbf12n.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'norm')
sgxbf12n <- ugarchfit(sgxbf12n.spec, SGXbf)
# PHÂN PHỐI STUDENT
sgxbf12std.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'std')
sgxbf12std <- ugarchfit(sgxbf12std.spec, SGXbf)
# PHÂN PHỐI ĐỐI XỨNG (sstd)
sgxbf12sstd.spec <- ugarchspec(variance.model = list( model = 'gjrGARCH', garchOrder = c(1,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sstd')
sgxbf12sstd <- ugarchfit(sgxbf12sstd.spec, SGXbf)
# PHÂN PHỐI Generalized Error Distribution (ged)
sgxbf12ged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = "ged")
sgxbf12ged <- ugarchfit(sgxbf12ged.spec, SGXbf)
# PHÂN PHỐI Generalized Error Distribution đối xứng (sged)
sgxbf12sged.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sged')
sgxbf12sged <- ugarchfit(sgxbf12sged.spec, SGXbf)
# PHÂN PHỐI CHUẨN
sgxbf21n.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'norm')
sgxbf21n <- ugarchfit(sgxbf21n.spec, SGXbf)
# PHÂN PHỐI STUDENT
sgxbf21std.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'std')
sgxbf21std <- ugarchfit(sgxbf21std.spec, SGXbf)
# PHÂN PHỐI ĐỐI XỨNG (sstd)
sgxbf21sstd.spec <- ugarchspec(variance.model = list( model = 'gjrGARCH', garchOrder = c(2,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sstd')
sgxbf21sstd <- ugarchfit(sgxbf21sstd.spec, SGXbf)
# PHÂN PHỐI Generalized Error Distribution (ged)
sgxbf21ged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = "ged")
sgxbf21ged <- ugarchfit(sgxbf21ged.spec, SGXbf)
# PHÂN PHỐI Generalized Error Distribution đối xứng (sged)
sgxbf21sged.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sged')
sgxbf21sged <- ugarchfit(sgxbf21sged.spec, SGXbf)
# PHÂN PHỐI CHUẨN
sgxbf22n.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'norm')
sgxbf22n <- ugarchfit(sgxbf22n.spec, SGXbf)
# PHÂN PHỐI STUDENT
sgxbf22std.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'std')
sgxbf22std <- ugarchfit(sgxbf22std.spec, SGXbf)
# PHÂN PHỐI ĐỐI XỨNG (sstd)
sgxbf22sstd.spec <- ugarchspec(variance.model = list( model = 'gjrGARCH', garchOrder = c(2,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sstd')
sgxbf22sstd <- ugarchfit(sgxbf22sstd.spec, SGXbf)
# PHÂN PHỐI Generalized Error Distribution (ged)
sgxbf22ged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = "ged")
sgxbf22ged <- ugarchfit(sgxbf22ged.spec, SGXbf)
# PHÂN PHỐI Generalized Error Distribution đối xứng (sged)
sgxbf22sged.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sged')
sgxbf22sged <- ugarchfit(sgxbf22sged.spec, SGXbf)
# PHÂN PHỐI CHUẨN
vnibf11n.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,1)), mean.model = list(armaOrder = c(1,1), include.mean = TRUE), distribution.model = 'norm')
vnibf11n <- ugarchfit(vnibf11n.spec, VNIbf)
# PHÂN PHỐI STUDENT
vnibf11std.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,1)), mean.model = list(armaOrder = c(1,1), include.mean = TRUE), distribution.model = 'std')
vnibf11std <- ugarchfit(spec = vnibf11std.spec, data = VNIbf)
# PHÂN PHỐI ĐỐI XỨNG (sstd)
vnibf11sstd.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,1)), mean.model = list(armaOrder = c(1,1), include.mean = TRUE), distribution.model = 'sstd')
vnibf11sstd <- ugarchfit(vnibf11sstd.spec, VNIbf)
# PHÂN PHỐI Generalized Error Distribution (ged)
vnibf11ged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1,1)), mean.model = list(armaOrder = c(1,1), include.mean = TRUE), distribution.model = "ged")
vnibf11ged <- ugarchfit(vnibf11ged.spec, VNIbf)
# PHÂN PHỐI Generalized Error Distribution đối xứng (sged)
vnibf11sged.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,1)), mean.model = list(armaOrder = c(1,1), include.mean = TRUE), distribution.model = 'sged')
vnibf11sged <- ugarchfit(vnibf11sged.spec, VNIbf)
# PHÂN PHỐI CHUẨN
vnibf12n.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,2)), mean.model = list(armaOrder = c(1,1), include.mean = TRUE), distribution.model = 'norm')
vnibf12n <- ugarchfit(vnibf12n.spec, VNIbf)
# PHÂN PHỐI STUDENT
vnibf12std.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,2)), mean.model = list(armaOrder = c(1,1), include.mean = TRUE), distribution.model = 'std')
vnibf12std <- ugarchfit(vnibf12std.spec, VNIbf)
# PHÂN PHỐI ĐỐI XỨNG (sstd)
vnibf12sstd.spec <- ugarchspec(variance.model = list( model = 'gjrGARCH', garchOrder = c(1,2)), mean.model = list(armaOrder = c(1,1), include.mean = TRUE), distribution.model = 'sstd')
vnibf12sstd <- ugarchfit(vnibf12sstd.spec, VNIbf)
# PHÂN PHỐI Generalized Error Distribution (ged)
vnibf12ged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1,2)), mean.model = list(armaOrder = c(1,1), include.mean = TRUE), distribution.model = "ged")
vnibf12ged <- ugarchfit(vnibf12ged.spec, VNIbf)
# PHÂN PHỐI Generalized Error Distribution đối xứng (sged)
vnibf12sged.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,2)), mean.model = list(armaOrder = c(1,1), include.mean = TRUE), distribution.model = 'sged')
vnibf12sged <- ugarchfit(vnibf12sged.spec, VNIbf)
# PHÂN PHỐI CHUẨN
vnibf21n.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,1)), mean.model = list(armaOrder = c(1,1), include.mean = TRUE), distribution.model = 'norm')
vnibf21n <- ugarchfit(vnibf21n.spec, VNIbf)
# PHÂN PHỐI STUDENT
vnibf21std.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,1)), mean.model = list(armaOrder = c(1,1), include.mean = TRUE), distribution.model = 'std')
vnibf21std <- ugarchfit(vnibf21std.spec, VNIbf)
# PHÂN PHỐI ĐỐI XỨNG (sstd)
vnibf21sstd.spec <- ugarchspec(variance.model = list( model = 'gjrGARCH', garchOrder = c(2,1)), mean.model = list(armaOrder = c(1,1), include.mean = TRUE), distribution.model = 'sstd')
vnibf21sstd <- ugarchfit(vnibf21sstd.spec, VNIbf)
# PHÂN PHỐI Generalized Error Distribution (ged)
vnibf21ged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2,1)), mean.model = list(armaOrder = c(1,1), include.mean = TRUE), distribution.model = "ged")
vnibf21ged <- ugarchfit(vnibf21ged.spec, VNIbf)
# PHÂN PHỐI Generalized Error Distribution đối xứng (sged)
vnibf21sged.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,1)), mean.model = list(armaOrder = c(1,1), include.mean = TRUE), distribution.model = 'sged')
vnibf21sged <- ugarchfit(vnibf21sged.spec, VNIbf)
# PHÂN PHỐI CHUẨN
vnibf22n.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,2)), mean.model = list(armaOrder = c(1,1), include.mean = TRUE), distribution.model = 'norm')
vnibf22n <- ugarchfit(vnibf22n.spec, VNIbf)
# PHÂN PHỐI STUDENT
vnibf22std.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,2)), mean.model = list(armaOrder = c(1,1), include.mean = TRUE), distribution.model = 'std')
vnibf22std <- ugarchfit(vnibf22std.spec, VNIbf)
# PHÂN PHỐI ĐỐI XỨNG (sstd)
vnibf22sstd.spec <- ugarchspec(variance.model = list( model = 'gjrGARCH', garchOrder = c(2,2)), mean.model = list(armaOrder = c(1,1), include.mean = TRUE), distribution.model = 'sstd')
vnibf22sstd <- ugarchfit(vnibf22sstd.spec, VNIbf)
# PHÂN PHỐI Generalized Error Distribution (ged)
vnibf22ged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2,2)), mean.model = list(armaOrder = c(1,1), include.mean = TRUE), distribution.model = "ged")
vnibf22ged <- ugarchfit(vnibf22ged.spec, VNIbf)
# PHÂN PHỐI Generalized Error Distribution đối xứng (sged)
vnibf22sged.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,2)), mean.model = list(armaOrder = c(1,1), include.mean = TRUE), distribution.model = 'sged')
vnibf22sged <- ugarchfit(vnibf22sged.spec, VNIbf)
sgxbf.model.list <- list(garch11n = sgxbf11n,
garch11std = sgxbf11std,
garch11sstd = sgxbf11sstd,
garch11ged = sgxbf11ged,
garch11sged = sgxbf11sged,
garch12n = sgxbf12n,
garch12std = sgxbf12std,
garch12ged = sgxbf12ged,
garch12sged = sgxbf12sged,
garch21n = sgxbf21n,
garch21std = sgxbf21std,
garch21ged = sgxbf21ged,
garch21sged = sgxbf21sged,
garch22n = sgxbf22n,
garch22std = sgxbf22std,
garch22ged = sgxbf22ged,
garch22sged = sgxbf22sged)
sgxbf.info.mat <- sapply(sgxbf.model.list, infocriteria)
rownames(sgxbf.info.mat) <- rownames(infocriteria(sgxbf11n))
sgxbf.info.mat
## garch11n garch11std garch11sstd garch11ged garch11sged garch12n
## Akaike 1.449807 1.457062 1.259317 1.418217 1.222724 1.527606
## Bayes 1.541686 1.559150 1.371614 1.520304 1.335021 1.629694
## Shibata 1.448763 1.455777 1.257768 1.416932 1.221175 1.526322
## Hannan-Quinn 1.486236 1.497538 1.303841 1.458693 1.267248 1.568082
## garch12std garch12ged garch12sged garch21n garch21std garch21ged
## Akaike 1.462217 1.423371 1.207130 1.443512 1.453384 1.424325
## Bayes 1.574513 1.535667 1.329635 1.555809 1.575889 1.546831
## Shibata 1.460667 1.421822 1.205292 1.441963 1.451546 1.422488
## Hannan-Quinn 1.506740 1.467895 1.255701 1.488036 1.501955 1.472897
## garch21sged garch22n garch22std garch22ged garch22sged
## Akaike 1.222331 1.448892 1.514619 1.427189 1.193328
## Bayes 1.355045 1.571397 1.647333 1.559903 1.336251
## Shibata 1.220182 1.447055 1.512469 1.425039 1.190843
## Hannan-Quinn 1.274950 1.497464 1.567238 1.479808 1.249994
sgxbf.inds <- which(sgxbf.info.mat == min(sgxbf.info.mat), arr.ind = TRUE)
colnames(sgxbf.info.mat)[sgxbf.inds[,2]]
## [1] "garch22sged"
sgxbf22sged
##
## *---------------------------------*
## * GARCH Model Fit *
## *---------------------------------*
##
## Conditional Variance Dynamics
## -----------------------------------
## GARCH Model : gjrGARCH(2,2)
## Mean Model : ARFIMA(2,0,2)
## Distribution : sged
##
## Optimal Parameters
## ------------------------------------
## Estimate Std. Error t value Pr(>|t|)
## mu 7.765948 0.001955 3.9722e+03 0.00000
## ar1 0.683852 0.000183 3.7397e+03 0.00000
## ar2 0.259330 0.000069 3.7391e+03 0.00000
## ma1 -0.812270 0.000204 -3.9837e+03 0.00000
## ma2 -0.064938 0.000027 -2.4014e+03 0.00000
## omega 0.026264 0.000009 2.9010e+03 0.00000
## alpha1 0.000000 0.000001 8.0580e-03 0.99357
## alpha2 0.000000 0.000000 3.7550e-03 0.99700
## beta1 0.329526 0.000091 3.6305e+03 0.00000
## beta2 0.709833 0.000194 3.6622e+03 0.00000
## gamma1 0.046864 0.000026 1.7739e+03 0.00000
## gamma2 -0.435156 0.000145 -3.0011e+03 0.00000
## skew 2.394568 0.165993 1.4426e+01 0.00000
## shape 0.986148 0.054421 1.8121e+01 0.00000
##
## Robust Standard Errors:
## Estimate Std. Error t value Pr(>|t|)
## mu 7.765948 3.095933 2.508435 0.012127
## ar1 0.683852 0.017422 39.251964 0.000000
## ar2 0.259330 0.018229 14.226149 0.000000
## ma1 -0.812270 0.034836 -23.317127 0.000000
## ma2 -0.064938 0.011579 -5.608434 0.000000
## omega 0.026264 0.004536 5.789798 0.000000
## alpha1 0.000000 0.000037 0.000124 0.999901
## alpha2 0.000000 0.000204 0.000005 0.999996
## beta1 0.329526 0.013120 25.116329 0.000000
## beta2 0.709833 0.022989 30.877593 0.000000
## gamma1 0.046864 0.009581 4.891540 0.000001
## gamma2 -0.435156 0.025355 -17.162203 0.000000
## skew 2.394568 138.003677 0.017351 0.986156
## shape 0.986148 23.479212 0.042001 0.966498
##
## LogLikelihood : -217.5056
##
## Information Criteria
## ------------------------------------
##
## Akaike 1.1933
## Bayes 1.3363
## Shibata 1.1908
## Hannan-Quinn 1.2500
##
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 1.071 3.008e-01
## Lag[2*(p+q)+(p+q)-1][11] 21.271 0.000e+00
## Lag[4*(p+q)+(p+q)-1][19] 31.501 9.275e-10
## d.o.f=4
## H0 : No serial correlation
##
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 5.645 1.750e-02
## Lag[2*(p+q)+(p+q)-1][11] 20.637 3.879e-04
## Lag[4*(p+q)+(p+q)-1][19] 41.236 1.696e-07
## d.o.f=4
##
## Weighted ARCH LM Tests
## ------------------------------------
## Statistic Shape Scale P-Value
## ARCH Lag[5] 0.9272 0.500 2.000 0.3356
## ARCH Lag[7] 2.6798 1.473 1.746 0.3718
## ARCH Lag[9] 3.7731 2.402 1.619 0.4322
##
## Nyblom stability test
## ------------------------------------
## Joint Statistic: 1.7048
## Individual Statistics:
## mu 0.53716
## ar1 0.02326
## ar2 0.08347
## ma1 0.04145
## ma2 0.06693
## omega 0.07367
## alpha1 0.05586
## alpha2 0.06146
## beta1 0.11187
## beta2 0.03855
## gamma1 0.06719
## gamma2 0.07165
## skew 0.16326
## shape 0.13660
##
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic: 3.08 3.34 3.9
## Individual Statistic: 0.35 0.47 0.75
##
## Sign Bias Test
## ------------------------------------
## t-value prob sig
## Sign Bias 1.724 0.085470 *
## Negative Sign Bias 2.035 0.042540 **
## Positive Sign Bias 1.684 0.092915 *
## Joint Effect 15.467 0.001458 ***
##
##
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
## group statistic p-value(g-1)
## 1 20 39.63 0.0036596
## 2 30 58.44 0.0009609
## 3 40 63.75 0.0074313
## 4 50 64.81 0.0645967
##
##
## Elapsed time : 24.27698
vnibf.model.list <- list(vnibf11n = vnibf11n,
vnibf11std = vnibf11std,
vnibf11sstd = vnibf11sstd,
vnibf11ged = vnibf11ged,
vnibf11sged = vnibf11sged,
vnibf12n = vnibf12n,
vnibf12std = vnibf12std,
vnibf12sstd = vnibf12sstd,
vnibf12ged = vnibf12ged,
vnibf12sged = vnibf12sged,
vnibf21n = vnibf21n,
vnibf21std = vnibf21std,
vnibf21sstd = vnibf21sstd,
vnibf21ged = vnibf21ged,
vnibf21sged = vnibf21sged,
vnibf22n = vnibf22n,
vnibf22std = vnibf22std,
vnibf22sstd = vnibf22sstd,
vnibf22ged = vnibf22ged,
vnibf22sged = vnibf22sged)
vnibf.info.mat <- sapply(vnibf.model.list, infocriteria)
rownames(vnibf.info.mat) <- rownames(infocriteria(vnibf11n))
vnibf.info.mat
## vnibf11n vnibf11std vnibf11sstd vnibf11ged vnibf11sged vnibf12n
## Akaike 11.13337 10.97582 10.94274 10.94851 10.89153 11.19793
## Bayes 11.20483 11.05749 11.03461 11.03018 10.98341 11.27960
## Shibata 11.13273 10.97499 10.94169 10.94769 10.89049 11.19711
## Hannan-Quinn 11.16170 11.00820 10.97916 10.98090 10.92796 11.23031
## vnibf12std vnibf12sstd vnibf12ged vnibf12sged vnibf21n vnibf21std
## Akaike 10.98155 10.98224 10.97369 10.90932 11.10297 11.03331
## Bayes 11.07343 11.08433 11.06557 11.01141 11.19484 11.13540
## Shibata 10.98050 10.98096 10.97265 10.90804 11.10192 11.03203
## Hannan-Quinn 11.01797 11.02272 11.01012 10.94980 11.13939 11.07379
## vnibf21sstd vnibf21ged vnibf21sged vnibf22n vnibf22std vnibf22sstd
## Akaike 10.94594 10.97902 10.91871 11.21478 11.02865 10.98158
## Bayes 11.05824 11.08111 11.03101 11.31687 11.14094 11.10408
## Shibata 10.94439 10.97773 10.91716 11.21349 11.02710 10.97974
## Hannan-Quinn 10.99047 11.01950 10.96323 11.25526 11.07317 11.03015
## vnibf22ged vnibf22sged
## Akaike 10.97199 10.92581
## Bayes 11.08429 11.04831
## Shibata 10.97044 10.92397
## Hannan-Quinn 11.01652 10.97438
vnibf.inds <- which(vnibf.info.mat == min(vnibf.info.mat), arr.ind = TRUE)
model.vnibf <- colnames(vnibf.info.mat)[vnibf.inds[,2]]
model.vnibf
## [1] "vnibf11sged"
vnibf11sged
##
## *---------------------------------*
## * GARCH Model Fit *
## *---------------------------------*
##
## Conditional Variance Dynamics
## -----------------------------------
## GARCH Model : gjrGARCH(1,1)
## Mean Model : ARFIMA(1,0,1)
## Distribution : sged
##
## Optimal Parameters
## ------------------------------------
## Estimate Std. Error t value Pr(>|t|)
## mu 988.714326 0.355520 2.7810e+03 0
## ar1 0.160254 0.012484 1.2837e+01 0
## ma1 -0.074931 0.006503 -1.1523e+01 0
## omega 275.884809 2.965239 9.3040e+01 0
## alpha1 0.000000 0.000106 1.0000e-06 1
## beta1 0.986632 0.000021 4.6346e+04 0
## gamma1 -0.173955 0.001933 -8.9992e+01 0
## skew 1.296253 0.018067 7.1745e+01 0
## shape 0.843160 0.047930 1.7591e+01 0
##
## Robust Standard Errors:
## Estimate Std. Error t value Pr(>|t|)
## mu 988.714326 0.529845 1.8660e+03 0
## ar1 0.160254 0.005799 2.7635e+01 0
## ma1 -0.074931 0.001484 -5.0495e+01 0
## omega 275.884809 1.858572 1.4844e+02 0
## alpha1 0.000000 0.000058 2.0000e-06 1
## beta1 0.986632 0.000009 1.0710e+05 0
## gamma1 -0.173955 0.001500 -1.1597e+02 0
## skew 1.296253 0.007071 1.8331e+02 0
## shape 0.843160 0.048758 1.7293e+01 0
##
## LogLikelihood : -2103.957
##
## Information Criteria
## ------------------------------------
##
## Akaike 10.892
## Bayes 10.983
## Shibata 10.890
## Hannan-Quinn 10.928
##
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 0.4899 4.840e-01
## Lag[2*(p+q)+(p+q)-1][5] 8.2111 3.406e-09
## Lag[4*(p+q)+(p+q)-1][9] 13.0988 3.448e-04
## d.o.f=2
## H0 : No serial correlation
##
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 0.5097 0.47525
## Lag[2*(p+q)+(p+q)-1][5] 6.1656 0.08220
## Lag[4*(p+q)+(p+q)-1][9] 9.4074 0.06694
## d.o.f=2
##
## Weighted ARCH LM Tests
## ------------------------------------
## Statistic Shape Scale P-Value
## ARCH Lag[3] 2.338 0.500 2.000 0.1262
## ARCH Lag[5] 4.169 1.440 1.667 0.1593
## ARCH Lag[7] 5.266 2.315 1.543 0.1990
##
## Nyblom stability test
## ------------------------------------
## Joint Statistic: 3.7029
## Individual Statistics:
## mu 0.1025
## ar1 0.6322
## ma1 0.7396
## omega 0.1804
## alpha1 0.2354
## beta1 0.1707
## gamma1 0.2067
## skew 0.2636
## shape 0.1124
##
## 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.2021 0.2301
## Negative Sign Bias 1.5318 0.1264
## Positive Sign Bias 0.6378 0.5240
## Joint Effect 3.7472 0.2901
##
##
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
## group statistic p-value(g-1)
## 1 20 48.70 2.030e-04
## 2 30 63.55 2.192e-04
## 3 40 67.05 3.447e-03
## 4 50 96.02 6.883e-05
##
##
## Elapsed time : 5.948096
sgxbf.res <- residuals(sgxbf22sged)/sigma(sgxbf22sged)
fitdist(distribution = 'sged' , sgxbf.res, control = list())$pars
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## mu sigma skew shape
## -0.0556471 0.8727493 2.3250682 1.1319179
sb <- pdist(distribution = 'sged' , q = sgxbf.res, mu = -0.0556471 , sigma = 0.8727493, skew = 2.3250682, shape = 1.1319179 )
vnibf.res <- residuals(vnibf11sged)/sigma(vnibf11sged)
fitdist(distribution = 'sged' , vnibf.res, control = list())$pars
## mu sigma skew shape
## 0.01372573 1.00252933 1.31294857 0.84664142
vb <- pdist(distribution = 'sged' , q = vnibf.res, mu = 0.01372573 , sigma = 1.00252933, skew = 1.31294857, shape = 0.84664142)
# Kiểm định Anderson-Darling
ad.test(sb, 'punif')
##
## Anderson-Darling test of goodness-of-fit
## Null hypothesis: uniform distribution
## Parameters assumed to be fixed
##
## data: sb
## An = 1.8441, p-value = 0.1121
ad.test(vb, 'punif')
##
## Anderson-Darling test of goodness-of-fit
## Null hypothesis: uniform distribution
## Parameters assumed to be fixed
##
## data: vb
## An = 1.5565, p-value = 0.1635
# Kiểm định Cramer-von Mises
cvm.test(sb, 'punif')
##
## Cramer-von Mises test of goodness-of-fit
## Null hypothesis: uniform distribution
## Parameters assumed to be fixed
##
## data: sb
## omega2 = 0.33001, p-value = 0.1115
cvm.test(vb, 'punif')
##
## Cramer-von Mises test of goodness-of-fit
## Null hypothesis: uniform distribution
## Parameters assumed to be fixed
##
## data: vb
## omega2 = 0.20474, p-value = 0.2585
# Kiểm định ks-test
ks.test(sb, 'punif')
##
## Asymptotic one-sample Kolmogorov-Smirnov test
##
## data: sb
## D = 0.064881, p-value = 0.07627
## alternative hypothesis: two-sided
ks.test(vb, 'punif')
##
## Asymptotic one-sample Kolmogorov-Smirnov test
##
## data: vb
## D = 0.05836, p-value = 0.1422
## alternative hypothesis: two-sided
BiCopSelect(sb, vb, familyset = 1:9, selectioncrit = 'AIC' , indeptest = FALSE , level = 0.05)
## Bivariate copula: Clayton (par = 0.46, tau = 0.19)
hehe <- BiCopEst(sb,vb, family = 3, method = 'mle', se = T, max.df = 10)
summary(hehe)
## Family
## ------
## No: 3
## Name: Clayton
##
## Parameter(s)
## ------------
## par: 0.46 (SE = 0.08)
##
## Dependence measures
## -------------------
## Kendall's tau: 0.19 (empirical = 0.2, p value < 0.01)
## Upper TD: 0
## Lower TD: 0.22
##
## Fit statistics
## --------------
## logLik: 22.18
## AIC: -42.37
## BIC: -38.41
dataing <- data %>% filter(Ngày > ymd(20200101), Ngày < ymd(20220101))
SGXing <- ts(dataing$SGX)
VNIing <- ts(dataing$VNI)
autoarfima(SGXing, ar.max = 2, ma.max = 2, criterion = "AIC", method = "full")
## Warning in .makearfimafitmodel(f = .arfimaLLH, T = T, m = m, timer = timer, :
## rugarch-->warning: failed to invert hessian
## $fit
##
## *----------------------------------*
## * ARFIMA Model Fit *
## *----------------------------------*
## Mean Model : ARFIMA(2,0,1)
## Distribution : norm
##
## Optimal Parameters
## ------------------------------------
## Estimate Std. Error t value Pr(>|t|)
## mu 9.14264 0.387855 23.5723 0
## ar1 0.64863 0.046777 13.8664 0
## ar2 0.33809 0.049144 6.8797 0
## ma1 -0.87952 0.018020 -48.8084 0
## sigma 0.77397 0.027405 28.2417 0
##
## Robust Standard Errors:
## Estimate Std. Error t value Pr(>|t|)
## mu 9.14264 0.810066 11.2863 0
## ar1 0.64863 0.072798 8.9099 0
## ar2 0.33809 0.059067 5.7239 0
## ma1 -0.87952 0.037154 -23.6724 0
## sigma 0.77397 0.034742 22.2779 0
##
## LogLikelihood : -462.7613
##
## Information Criteria
## ------------------------------------
##
## Akaike 2.3506
## Bayes 2.4006
## Shibata 2.3502
## Hannan-Quinn 2.3704
##
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 0.09769 0.75461
## Lag[2*(p+q)+(p+q)-1][8] 5.46563 0.06413
## Lag[4*(p+q)+(p+q)-1][14] 10.22362 0.10310
##
## H0 : No serial correlation
##
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 7.532 0.006062
## Lag[2*(p+q)+(p+q)-1][2] 8.067 0.006208
## Lag[4*(p+q)+(p+q)-1][5] 9.917 0.009672
##
##
## ARCH LM Tests
## ------------------------------------
## Statistic DoF P-Value
## ARCH Lag[2] 7.947 2 0.01880
## ARCH Lag[5] 11.352 5 0.04484
## ARCH Lag[10] 22.550 10 0.01253
##
## Nyblom stability test
## ------------------------------------
## Joint Statistic: 4.5777
## Individual Statistics:
## mu 0.3671
## ar1 0.4058
## ar2 0.1556
## ma1 1.2742
## sigma 0.6417
##
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic: 1.28 1.47 1.88
## Individual Statistic: 0.35 0.47 0.75
##
##
## Elapsed time : 0.14744
##
##
## $rank.matrix
## ar1 ar2 ma1 ma2 im arf AIC converged
## 1 1 1 1 0 1 0 2.350560 1
## 2 1 1 1 1 1 0 2.350782 1
## 3 1 0 1 1 1 0 2.368002 1
## 4 0 1 1 1 1 0 2.424272 1
## 5 0 1 0 1 1 0 2.428046 1
## 6 1 1 0 1 1 0 2.430206 1
## 7 0 1 1 0 1 0 2.442672 1
## 8 1 1 0 0 1 0 2.451012 1
## 9 0 1 0 0 1 0 2.451025 1
## 10 0 0 1 1 1 0 2.458287 1
## 11 1 0 0 1 1 0 2.461940 1
## 12 0 0 0 1 1 0 2.465680 1
## 13 1 0 1 0 1 0 2.519677 1
## 14 1 0 0 0 1 0 2.545799 1
## 15 0 0 1 0 1 0 2.549300 1
## 16 1 0 1 1 0 0 2.979826 1
## 17 1 1 1 0 0 0 3.031119 1
## 18 1 1 1 1 0 0 3.035821 1
## 19 1 0 1 0 0 0 3.041383 1
## 20 1 1 0 1 0 0 3.052211 1
## 21 1 1 0 0 0 0 3.076637 1
## 22 0 1 0 1 0 0 3.122738 1
## 23 0 1 0 0 0 0 3.190042 1
## 24 1 0 0 1 0 0 3.378390 1
## 25 1 0 0 0 0 0 3.450480 1
## 26 0 0 1 1 0 0 5.508727 1
## 27 0 0 0 1 0 0 6.161018 1
## 28 0 0 1 0 0 0 6.288814 1
## 29 0 0 0 0 1 0 36.847251 1
## 30 0 1 1 1 0 0 108.164488 1
## 31 0 1 1 0 0 0 NA 0
autoarfima(VNIing, ar.max = 2, ma.max = 2, criterion = 'AIC', method = 'full')
## $fit
##
## *----------------------------------*
## * ARFIMA Model Fit *
## *----------------------------------*
## Mean Model : ARFIMA(2,0,2)
## Distribution : norm
##
## Optimal Parameters
## ------------------------------------
## Estimate Std. Error t value Pr(>|t|)
## mu 971.63794 359.778497 2.7007 0.006920
## ar1 0.31206 0.085598 3.6457 0.000267
## ar2 0.67132 0.079103 8.4867 0.000000
## ma1 -0.41291 0.103045 -4.0071 0.000061
## ma2 -0.38649 0.076806 -5.0320 0.000000
## sigma 205.52504 7.280759 28.2285 0.000000
##
## Robust Standard Errors:
## Estimate Std. Error t value Pr(>|t|)
## mu 971.63794 2.0214e+03 0.48067 0.630755
## ar1 0.31206 1.5295e-01 2.04032 0.041318
## ar2 0.67132 2.3855e-01 2.81414 0.004891
## ma1 -0.41291 9.9028e-02 -4.16967 0.000031
## ma2 -0.38649 3.3440e-01 -1.15576 0.247780
## sigma 205.52504 9.3249e+00 22.04055 0.000000
##
## LogLikelihood : -2684.319
##
## Information Criteria
## ------------------------------------
##
## Akaike 13.519
## Bayes 13.579
## Shibata 13.519
## Hannan-Quinn 13.543
##
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 0.6288 4.278e-01
## Lag[2*(p+q)+(p+q)-1][11] 14.4512 0.000e+00
## Lag[4*(p+q)+(p+q)-1][19] 26.7771 2.736e-07
##
## H0 : No serial correlation
##
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 1.469 2.254e-01
## Lag[2*(p+q)+(p+q)-1][2] 10.261 1.630e-03
## Lag[4*(p+q)+(p+q)-1][5] 24.925 8.376e-07
##
##
## ARCH LM Tests
## ------------------------------------
## Statistic DoF P-Value
## ARCH Lag[2] 19.03 2 7.374e-05
## ARCH Lag[5] 32.84 5 4.045e-06
## ARCH Lag[10] 41.32 10 9.921e-06
##
## Nyblom stability test
## ------------------------------------
## Joint Statistic: 8.133
## Individual Statistics:
## mu 0.2194
## ar1 0.4826
## ar2 0.2034
## ma1 1.8932
## ma2 0.7487
## sigma 3.1884
##
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic: 1.49 1.68 2.12
## Individual Statistic: 0.35 0.47 0.75
##
##
## Elapsed time : 0.2017891
##
##
## $rank.matrix
## ar1 ar2 ma1 ma2 im arf AIC converged
## 1 1 1 1 1 1 0 13.51919 1
## 2 1 1 1 0 1 0 13.53733 1
## 3 0 1 0 0 1 0 13.54919 1
## 4 1 1 0 0 1 0 13.55209 1
## 5 0 1 0 1 1 0 13.55292 1
## 6 0 1 1 0 1 0 13.55391 1
## 7 1 1 0 1 1 0 13.55471 1
## 8 0 1 1 1 1 0 13.55764 1
## 9 1 0 1 1 1 0 13.56699 1
## 10 0 0 0 1 1 0 13.57027 1
## 11 1 0 0 1 1 0 13.57440 1
## 12 0 0 1 1 1 0 13.57513 1
## 13 1 0 1 0 1 0 13.59352 1
## 14 1 1 1 1 0 0 13.68171 1
## 15 1 1 1 0 0 0 13.68431 1
## 16 1 1 0 1 0 0 13.70366 1
## 17 1 0 1 1 0 0 13.71985 1
## 18 1 1 0 0 0 0 13.75257 1
## 19 1 0 0 0 1 0 13.76386 1
## 20 0 0 0 0 1 0 13.76595 1
## 21 0 0 1 0 1 0 13.76720 1
## 22 0 1 0 1 0 0 13.76759 1
## 23 1 0 1 0 0 0 13.76912 1
## 24 0 1 1 1 0 0 13.76962 1
## 25 0 1 1 0 0 0 13.89017 1
## 26 0 1 0 0 0 0 13.89088 1
## 27 1 0 0 1 0 0 14.20725 1
## 28 1 0 0 0 0 0 14.35911 1
## 29 0 0 1 1 0 0 15.46359 1
## 30 0 0 0 1 0 0 15.84457 1
## 31 0 0 1 0 0 0 16.08317 1
# PHÂN PHỐI CHUẨN
sgxing11n.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'norm')
sgxing11n <- ugarchfit(spec = sgxing11n.spec, SGXing)
# PHÂN PHỐI STUDENT
sgxing11std.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'std')
sgxing11std <- ugarchfit(sgxing11std.spec, SGXing)
# PHÂN PHỐI ĐỐI XỨNG (sstd)
sgxing11sstd.spec <- ugarchspec(variance.model = list( model = 'gjrGARCH', garchOrder = c(1,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sstd')
sgxing11sstd <- ugarchfit(sgxing11sstd.spec, SGXing)
# PHÂN PHỐI Generalized Error Distribution (ged)
sgxing11ged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)), mean.model = list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "ged")
sgxing11ged <- ugarchfit(sgxing11ged.spec, SGXing)
# PHÂN PHỐI Generalized Error Distribution đối xứng (sged)
sgxing11sged.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sged')
sgxing11sged <- ugarchfit(sgxing11sged.spec, SGXing)
# PHÂN PHỐI CHUẨN
sgxing12n.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'norm')
sgxing12n <- ugarchfit(sgxing12n.spec, SGXing)
# PHÂN PHỐI STUDENT
sgxing12std.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'std')
sgxing12std <- ugarchfit(sgxing12std.spec, SGXing)
# PHÂN PHỐI ĐỐI XỨNG (sstd)
sgxing12sstd.spec <- ugarchspec(variance.model = list( model = 'gjrGARCH', garchOrder = c(1,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sstd')
sgxing12sstd <- ugarchfit(sgxing12sstd.spec, SGXing)
# PHÂN PHỐI Generalized Error Distribution (ged)
sgxing12ged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = "ged")
sgxing12ged <- ugarchfit(sgxing12ged.spec, SGXing)
# PHÂN PHỐI Generalized Error Distribution đối xứng (sged)
sgxing12sged.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sged')
sgxing12sged <- ugarchfit(sgxing12sged.spec, SGXing)
# PHÂN PHỐI CHUẨN
sgxing21n.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'norm')
sgxing21n <- ugarchfit(sgxing21n.spec, SGXing)
# PHÂN PHỐI STUDENT
sgxing21std.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'std')
sgxing21std <- ugarchfit(sgxing21std.spec, SGXing)
# PHÂN PHỐI ĐỐI XỨNG (sstd)
sgxing21sstd.spec <- ugarchspec(variance.model = list( model = 'gjrGARCH', garchOrder = c(2,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sstd')
sgxing21sstd <- ugarchfit(sgxing21sstd.spec, SGXing)
# PHÂN PHỐI Generalized Error Distribution (ged)
sgxing21ged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = "ged")
sgxing21ged <- ugarchfit(sgxing21ged.spec, SGXing)
# PHÂN PHỐI Generalized Error Distribution đối xứng (sged)
sgxing21sged.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sged')
sgxing21sged <- ugarchfit(sgxing21sged.spec, SGXing)
# PHÂN PHỐI CHUẨN
sgxing22n.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'norm')
sgxing22n <- ugarchfit(sgxing22n.spec, SGXing)
# PHÂN PHỐI STUDENT
sgxing22std.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'std')
sgxing22std <- ugarchfit(sgxing22std.spec, SGXing)
# PHÂN PHỐI ĐỐI XỨNG (sstd)
sgxing22sstd.spec <- ugarchspec(variance.model = list( model = 'gjrGARCH', garchOrder = c(2,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sstd')
sgxing22sstd <- ugarchfit(sgxing22sstd.spec, SGXing)
# PHÂN PHỐI Generalized Error Distribution (ged)
sgxing22ged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = "ged")
sgxing22ged <- ugarchfit(sgxing22ged.spec, SGXing)
# PHÂN PHỐI Generalized Error Distribution đối xứng (sged)
sgxing22sged.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sged')
sgxing22sged <- ugarchfit(sgxing22sged.spec, SGXing)
# PHÂN PHỐI CHUẨN
vniing11n.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'norm')
vniing11n <- ugarchfit(vniing11n.spec, VNIing)
# PHÂN PHỐI STUDENT
vniing11std.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'std')
vniing11std <- ugarchfit(vniing11std.spec, VNIing)
# PHÂN PHỐI ĐỐI XỨNG (sstd)
vniing11sstd.spec <- ugarchspec(variance.model = list( model = 'gjrGARCH', garchOrder = c(1,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sstd')
vniing11sstd <- ugarchfit(vniing11sstd.spec, VNIing)
# PHÂN PHỐI Generalized Error Distribution (ged)
vniing11ged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)), mean.model = list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "ged")
vniing11ged <- ugarchfit(vniing11ged.spec, VNIing)
# PHÂN PHỐI Generalized Error Distribution đối xứng (sged)
vniing11sged.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sged')
vniing11sged <- ugarchfit(vniing11sged.spec, VNIing)
# PHÂN PHỐI CHUẨN
vniing12n.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'norm')
vniing12n <- ugarchfit(vniing12n.spec, VNIing)
# PHÂN PHỐI STUDENT
vniing12std.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'std')
vniing12std <- ugarchfit(vniing12std.spec, VNIing)
# PHÂN PHỐI ĐỐI XỨNG (sstd)
vniing12sstd.spec <- ugarchspec(variance.model = list( model = 'gjrGARCH', garchOrder = c(1,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sstd')
vniing12sstd <- ugarchfit(vniing12sstd.spec, VNIing)
# PHÂN PHỐI Generalized Error Distribution (ged)
vniing12ged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = "ged")
vniing12ged <- ugarchfit(vniing12ged.spec, VNIing)
# PHÂN PHỐI Generalized Error Distribution đối xứng (sged)
vniing12sged.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sged')
vniing12sged <- ugarchfit(vniing12sged.spec, VNIing)
# PHÂN PHỐI CHUẨN
vniing21n.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'norm')
vniing21n <- ugarchfit(vniing21n.spec, VNIing)
# PHÂN PHỐI STUDENT
vniing21std.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'std')
vniing21std <- ugarchfit(vniing21std.spec, VNIing)
# PHÂN PHỐI ĐỐI XỨNG (sstd)
vniing21sstd.spec <- ugarchspec(variance.model = list( model = 'gjrGARCH', garchOrder = c(2,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sstd')
vniing21sstd <- ugarchfit(vniing21sstd.spec, VNIing)
# PHÂN PHỐI Generalized Error Distribution (ged)
vniing21ged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = "ged")
vniing21ged <- ugarchfit(vniing21ged.spec, VNIing)
# PHÂN PHỐI Generalized Error Distribution đối xứng (sged)
vniing21sged.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sged')
vniing21sged <- ugarchfit(vniing21sged.spec, VNIing)
# PHÂN PHỐI CHUẨN
vniing22n.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'norm')
vniing22n <- ugarchfit(vniing22n.spec, VNIing)
# PHÂN PHỐI STUDENT
vniing22std.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'std')
vniing22std <- ugarchfit(vniing22std.spec, VNIing)
# PHÂN PHỐI ĐỐI XỨNG (sstd)
vniing22sstd.spec <- ugarchspec(variance.model = list( model = 'gjrGARCH', garchOrder = c(2,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sstd')
vniing22sstd <- ugarchfit(vniing22sstd.spec, VNIing)
# PHÂN PHỐI Generalized Error Distribution (ged)
vniing22ged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = "ged")
vniing22ged <- ugarchfit(sgxing22ged.spec, VNIing)
# PHÂN PHỐI Generalized Error Distribution đối xứng (sged)
vniing22sged.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sged')
vniing22sged <- ugarchfit(sgxing22sged.spec, VNIing)
sgxing.model.list <- list(garch11n = sgxing11n,
garch11std = sgxing11std,
garch11sstd = sgxing11sstd,
garch11ged = sgxing11ged,
garch11sged = sgxing11sged,
garch12n = sgxing12n,
garch12std = sgxing12std,
garch12sstd = sgxing12sstd,
garch12ged = sgxing12ged,
garch12sged = sgxing12sged,
garch21n = sgxing21n,
garch21std = sgxing21std,
garch21sstd = sgxing21sstd,
garch21ged = sgxing21ged,
garch21sged = sgxing21sged,
garch22n = sgxing22n,
garch22std = sgxing22std,
garch22ged = sgxing22ged,
garch22sged = sgxing22sged)
sgxing.info.mat <- sapply(sgxing.model.list, infocriteria)
rownames(sgxing.info.mat) <- rownames(infocriteria(sgxing11n))
sgxing.info.mat
## garch11n garch11std garch11sstd garch11ged garch11sged garch12n
## Akaike 2.315027 2.315286 2.278917 2.314224 2.271654 2.305811
## Bayes 2.405173 2.415448 2.389095 2.414386 2.381832 2.405973
## Shibata 2.314034 2.314064 2.277443 2.313002 2.270180 2.304589
## Hannan-Quinn 2.350733 2.354959 2.322557 2.353897 2.315294 2.345485
## garch12std garch12sstd garch12ged garch12sged garch21n garch21std
## Akaike 2.308604 2.270689 2.307649 2.265448 2.324093 2.324923
## Bayes 2.418782 2.390883 2.417827 2.385643 2.434272 2.445117
## Shibata 2.307130 2.268940 2.306175 2.263700 2.322620 2.323174
## Hannan-Quinn 2.352245 2.318297 2.351289 2.313056 2.367734 2.372531
## garch21sstd garch21ged garch21sged garch22n garch22std garch22ged
## Akaike 2.284514 2.323986 2.277663 2.313825 2.317144 2.316265
## Bayes 2.414725 2.444180 2.407874 2.434019 2.447355 2.446476
## Shibata 2.282469 2.322238 2.275618 2.312076 2.315099 2.314220
## Hannan-Quinn 2.336090 2.371594 2.329238 2.361433 2.368719 2.367841
## garch22sged
## Akaike 2.274006
## Bayes 2.414233
## Shibata 2.271641
## Hannan-Quinn 2.329548
sgxing.inds <- which(sgxing.info.mat == min(sgxing.info.mat), arr.ind = TRUE)
model.sgxing <- colnames(sgxing.info.mat)[sgxing.inds[,2]]
model.sgxing
## [1] "garch12sged"
sgxing12sged
##
## *---------------------------------*
## * GARCH Model Fit *
## *---------------------------------*
##
## Conditional Variance Dynamics
## -----------------------------------
## GARCH Model : gjrGARCH(1,2)
## Mean Model : ARFIMA(2,0,2)
## Distribution : sged
##
## Optimal Parameters
## ------------------------------------
## Estimate Std. Error t value Pr(>|t|)
## mu 8.707052 0.278809 31.22946 0.000000
## ar1 1.380137 0.003523 391.72386 0.000000
## ar2 -0.381342 0.003193 -119.42668 0.000000
## ma1 -1.567772 0.000284 -5527.62691 0.000000
## ma2 0.619080 0.000515 1201.83748 0.000000
## omega 0.022103 0.025221 0.87637 0.380829
## alpha1 0.142276 0.055065 2.58380 0.009772
## beta1 0.235193 0.151412 1.55333 0.120345
## beta2 0.523044 0.136220 3.83969 0.000123
## gamma1 0.179310 0.100790 1.77904 0.075233
## skew 1.347861 0.096630 13.94863 0.000000
## shape 1.600843 0.194992 8.20980 0.000000
##
## Robust Standard Errors:
## Estimate Std. Error t value Pr(>|t|)
## mu 8.707052 0.271101 32.11743 0.000000
## ar1 1.380137 0.002556 539.95212 0.000000
## ar2 -0.381342 0.001841 -207.18022 0.000000
## ma1 -1.567772 0.000522 -3000.69052 0.000000
## ma2 0.619080 0.001062 582.67517 0.000000
## omega 0.022103 0.050211 0.44019 0.659797
## alpha1 0.142276 0.067451 2.10933 0.034917
## beta1 0.235193 0.133239 1.76520 0.077531
## beta2 0.523044 0.109551 4.77445 0.000002
## gamma1 0.179310 0.087476 2.04981 0.040383
## skew 1.347861 0.125812 10.71326 0.000000
## shape 1.600843 0.222722 7.18764 0.000000
##
## LogLikelihood : -438.8242
##
## Information Criteria
## ------------------------------------
##
## Akaike 2.2654
## Bayes 2.3856
## Shibata 2.2637
## Hannan-Quinn 2.3131
##
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 0.1848 6.673e-01
## Lag[2*(p+q)+(p+q)-1][11] 11.0677 4.738e-12
## Lag[4*(p+q)+(p+q)-1][19] 18.6683 1.365e-03
## d.o.f=4
## H0 : No serial correlation
##
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 4.097 0.04295
## Lag[2*(p+q)+(p+q)-1][8] 6.589 0.18202
## Lag[4*(p+q)+(p+q)-1][14] 12.013 0.09194
## d.o.f=3
##
## Weighted ARCH LM Tests
## ------------------------------------
## Statistic Shape Scale P-Value
## ARCH Lag[4] 0.006962 0.500 2.000 0.9335
## ARCH Lag[6] 1.809596 1.461 1.711 0.5341
## ARCH Lag[8] 3.697459 2.368 1.583 0.4219
##
## Nyblom stability test
## ------------------------------------
## Joint Statistic: 6.3684
## Individual Statistics:
## mu 0.008579
## ar1 0.106473
## ar2 0.080843
## ma1 0.773766
## ma2 0.515131
## omega 0.764865
## alpha1 0.057311
## beta1 0.324182
## beta2 0.358387
## gamma1 0.143957
## skew 0.127474
## shape 0.811380
##
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic: 2.69 2.96 3.51
## Individual Statistic: 0.35 0.47 0.75
##
## Sign Bias Test
## ------------------------------------
## t-value prob sig
## Sign Bias 2.7712 0.005851 ***
## Negative Sign Bias 2.1984 0.028502 **
## Positive Sign Bias 0.1351 0.892581
## Joint Effect 11.0670 0.011369 **
##
##
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
## group statistic p-value(g-1)
## 1 20 28.63 0.07198
## 2 30 47.18 0.01787
## 3 40 57.28 0.02964
## 4 50 72.85 0.01511
##
##
## Elapsed time : 4.10824
vniing.model.list <- list(vniing11n = vniing11n,
vniing11std = vniing11std,
vniing11sstd = vniing11sstd,
vniing11ged = vniing11ged,
vniing11sged = vniing11sged,
vniing12n = vniing12n,
vniing12std = vniing12std,
vniing12sstd = vniing12sstd,
vniing12ged = vniing12ged,
vniing12sged = vniing12sged,
vniing21n = vniing21n,
vniing21std = vniing21std,
vniing21sstd = vniing21sstd,
vniing21ged = vniing21ged,
vniing21sged = vniing21sged,
vniing22n = vniing22n,
vniing22std = vniing22std,
vniing22sstd = vniing22sstd,
vniing22ged = vniing22ged,
vniing22sged = vniing22sged)
vniing.info.mat <- sapply(vniing.model.list, infocriteria)
rownames(vniing.info.mat) <- rownames(infocriteria(vniing11n))
vniing.info.mat
## vniing11n vniing11std vniing11sstd vniing11ged vniing11sged
## Akaike 13.36470 13.37061 13.37472 13.34884 13.35384
## Bayes 13.45484 13.47077 13.48490 13.44901 13.46402
## Shibata 13.36371 13.36939 13.37325 13.34762 13.35236
## Hannan-Quinn 13.40040 13.41028 13.41836 13.38852 13.39748
## vniing12n vniing12std vniing12sstd vniing12ged vniing12sged
## Akaike 13.36972 13.37563 13.37975 13.35637 13.35887
## Bayes 13.46989 13.48581 13.49994 13.46655 13.47906
## Shibata 13.36850 13.37416 13.37800 13.35490 13.35712
## Hannan-Quinn 13.40940 13.41927 13.42735 13.40001 13.40648
## vniing21n vniing21std vniing21sstd vniing21ged vniing21sged
## Akaike 13.37462 13.38058 13.38206 13.38799 13.38001
## Bayes 13.48480 13.50077 13.51227 13.50818 13.51022
## Shibata 13.37314 13.37883 13.38001 13.38624 13.37796
## Hannan-Quinn 13.41826 13.42819 13.43363 13.43559 13.43158
## vniing22n vniing22std vniing22sstd vniing22ged vniing22sged
## Akaike 13.37964 13.38565 13.38706 13.39266 13.38313
## Bayes 13.49983 13.51586 13.52728 13.52287 13.52336
## Shibata 13.37789 13.38361 13.38469 13.39062 13.38077
## Hannan-Quinn 13.42724 13.43723 13.44260 13.44424 13.43867
vniing.inds <- which(vniing.info.mat == min(vniing.info.mat), arr.ind = TRUE)
model.vniing <- colnames(vniing.info.mat)[vniing.inds[,2]]
model.vniing
## [1] "vniing11ged"
vniing11ged
##
## *---------------------------------*
## * GARCH Model Fit *
## *---------------------------------*
##
## Conditional Variance Dynamics
## -----------------------------------
## GARCH Model : gjrGARCH(1,1)
## Mean Model : ARFIMA(2,0,2)
## Distribution : ged
##
## Optimal Parameters
## ------------------------------------
## Estimate Std. Error t value Pr(>|t|)
## mu 904.96046 57.873869 15.6368 0.000000
## ar1 0.39208 0.069527 5.6392 0.000000
## ar2 0.60674 0.069412 8.7412 0.000000
## ma1 -0.33614 0.056985 -5.8988 0.000000
## ma2 -0.49564 0.050989 -9.7206 0.000000
## omega 1136.19550 443.799029 2.5602 0.010462
## alpha1 0.25984 0.067963 3.8232 0.000132
## beta1 0.77624 0.040338 19.2435 0.000000
## gamma1 -0.11613 0.075726 -1.5335 0.125141
## shape 2.89836 0.364791 7.9453 0.000000
##
## Robust Standard Errors:
## Estimate Std. Error t value Pr(>|t|)
## mu 904.96046 27.096279 33.3980 0.000000
## ar1 0.39208 0.013459 29.1322 0.000000
## ar2 0.60674 0.014034 43.2330 0.000000
## ma1 -0.33614 0.069966 -4.8043 0.000002
## ma2 -0.49564 0.056605 -8.7561 0.000000
## omega 1136.19550 749.549405 1.5158 0.129560
## alpha1 0.25984 0.074519 3.4869 0.000489
## beta1 0.77624 0.046004 16.8733 0.000000
## gamma1 -0.11613 0.085214 -1.3628 0.172946
## shape 2.89836 0.497271 5.8285 0.000000
##
## LogLikelihood : -2646.42
##
## Information Criteria
## ------------------------------------
##
## Akaike 13.349
## Bayes 13.449
## Shibata 13.348
## Hannan-Quinn 13.389
##
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 2.036 1.536e-01
## Lag[2*(p+q)+(p+q)-1][11] 21.624 0.000e+00
## Lag[4*(p+q)+(p+q)-1][19] 30.169 4.802e-09
## d.o.f=4
## H0 : No serial correlation
##
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 0.6009 0.4382
## Lag[2*(p+q)+(p+q)-1][5] 2.4512 0.5163
## Lag[4*(p+q)+(p+q)-1][9] 3.6227 0.6533
## d.o.f=2
##
## Weighted ARCH LM Tests
## ------------------------------------
## Statistic Shape Scale P-Value
## ARCH Lag[3] 0.005305 0.500 2.000 0.9419
## ARCH Lag[5] 2.875935 1.440 1.667 0.3083
## ARCH Lag[7] 3.187438 2.315 1.543 0.4789
##
## Nyblom stability test
## ------------------------------------
## Joint Statistic: 6.5592
## Individual Statistics:
## mu 0.01331
## ar1 0.15816
## ar2 0.07755
## ma1 2.32195
## ma2 0.43271
## omega 0.09933
## alpha1 0.10297
## beta1 0.47445
## gamma1 0.08988
## shape 0.94084
##
## 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 0.3971 0.69153
## Negative Sign Bias 0.5069 0.61250
## Positive Sign Bias 2.1836 0.02958 **
## Joint Effect 5.9281 0.11516
##
##
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
## group statistic p-value(g-1)
## 1 20 42.30 0.0016135
## 2 30 65.27 0.0001309
## 3 40 63.51 0.0078549
## 4 50 81.90 0.0022243
##
##
## Elapsed time : 4.613852
sgxing.res <- residuals(sgxing12sged)/sigma(sgxing12sged)
fitdist(distribution = 'sged' , sgxing.res, control = list())$pars
## mu sigma skew shape
## 0.04938603 1.01685861 1.37146143 1.61290186
si <- pdist(distribution = 'sged' , q = sgxing.res, mu = 0.04938603, sigma = 1.01685861, skew = 1.37146143, shape = 1.61290186)
vniing.res <- residuals(vniing11ged)/sigma(vniing11ged)
fitdist(distribution = 'ged' , vniing.res, control = list())$pars
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## mu sigma shape
## 0.03126604 0.99451798 2.88562145
vi <- pdist(distribution = 'norm' , q = vniing.res, mu = 0.03126604 , sigma = 0.99451798, shape = 2.88562145)
# Kiểm định Anderson-Darling
ad.test(si, 'punif')
##
## Anderson-Darling test of goodness-of-fit
## Null hypothesis: uniform distribution
## Parameters assumed to be fixed
##
## data: si
## An = 0.42692, p-value = 0.8216
ad.test(vi, 'punif')
##
## Anderson-Darling test of goodness-of-fit
## Null hypothesis: uniform distribution
## Parameters assumed to be fixed
##
## data: vi
## An = 2.8048, p-value = 0.03444
# Kiểm định Cramer-von Mises
cvm.test(si, 'punif')
##
## Cramer-von Mises test of goodness-of-fit
## Null hypothesis: uniform distribution
## Parameters assumed to be fixed
##
## data: si
## omega2 = 0.064008, p-value = 0.7891
cvm.test(vi, 'punif')
##
## Cramer-von Mises test of goodness-of-fit
## Null hypothesis: uniform distribution
## Parameters assumed to be fixed
##
## data: vi
## omega2 = 0.47511, p-value = 0.04604
# Kiểm định ks-test
ks.test(si, 'punif')
##
## Asymptotic one-sample Kolmogorov-Smirnov test
##
## data: si
## D = 0.036879, p-value = 0.6512
## alternative hypothesis: two-sided
ks.test(vi, 'punif')
##
## Asymptotic one-sample Kolmogorov-Smirnov test
##
## data: vi
## D = 0.96196, p-value < 2.2e-16
## alternative hypothesis: two-sided
BiCopSelect(si, vi, familyset = 1:9, selectioncrit = 'AIC' , indeptest = FALSE , level = 0.05)
## Bivariate copula: t (par = 0.49, par2 = 4.06, tau = 0.32)
yeah <- BiCopEst(si, vi, family = 2, method = 'mle', se = T, max.df = 10)
summary(yeah)
## Family
## ------
## No: 2
## Name: t
##
## Parameter(s)
## ------------
## par: 0.49 (SE = 0.04)
## par2: 4.06 (SE = 1.06)
## Dependence measures
## -------------------
## Kendall's tau: 0.32 (empirical = 0.31, p value < 0.01)
## Upper TD: 0.24
## Lower TD: 0.24
##
## Fit statistics
## --------------
## logLik: 57.85
## AIC: -111.7
## BIC: -103.73
dataaft <- data %>% filter(Ngày > ymd(20211231))
SGXaft <- ts(dataaft$SGX)
VNIaft <- ts(dataaft$VNI)
autoarfima(SGXaft, ar.max = 2, ma.max = 2, criterion = "AIC", method = "full")
## Warning in .makearfimafitmodel(f = .arfimaLLH, T = T, m = m, timer = timer, :
## rugarch-->warning: failed to invert hessian
## $fit
##
## *----------------------------------*
## * ARFIMA Model Fit *
## *----------------------------------*
## Mean Model : ARFIMA(2,0,2)
## Distribution : norm
##
## Optimal Parameters
## ------------------------------------
## Estimate Std. Error t value Pr(>|t|)
## mu 9.44528 0.022760 414.9883 0e+00
## ar1 1.25790 0.111756 11.2557 0e+00
## ar2 -0.84665 0.106792 -7.9280 0e+00
## ma1 -1.16379 0.156126 -7.4542 0e+00
## ma2 0.67951 0.152726 4.4492 9e-06
## sigma 0.38243 0.018357 20.8327 0e+00
##
## Robust Standard Errors:
## Estimate Std. Error t value Pr(>|t|)
## mu 9.44528 0.025227 374.4184 0.00000
## ar1 1.25790 0.137917 9.1207 0.00000
## ar2 -0.84665 0.139505 -6.0690 0.00000
## ma1 -1.16379 0.191731 -6.0699 0.00000
## ma2 0.67951 0.193315 3.5150 0.00044
## sigma 0.38243 0.019117 20.0044 0.00000
##
## LogLikelihood : -99.32661
##
## Information Criteria
## ------------------------------------
##
## Akaike 0.97075
## Bayes 1.06421
## Shibata 0.96928
## Hannan-Quinn 1.00850
##
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 1.040 0.30777
## Lag[2*(p+q)+(p+q)-1][11] 7.069 0.04363
## Lag[4*(p+q)+(p+q)-1][19] 12.766 0.12598
##
## H0 : No serial correlation
##
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 1.567 0.2106
## Lag[2*(p+q)+(p+q)-1][2] 1.668 0.3244
## Lag[4*(p+q)+(p+q)-1][5] 4.072 0.2452
##
##
## ARCH LM Tests
## ------------------------------------
## Statistic DoF P-Value
## ARCH Lag[2] 1.594 2 0.45068
## ARCH Lag[5] 9.661 5 0.08545
## ARCH Lag[10] 20.661 10 0.02358
##
## Nyblom stability test
## ------------------------------------
## Joint Statistic: 1.8233
## Individual Statistics:
## mu 0.08904
## ar1 0.16519
## ar2 0.22415
## ma1 0.27318
## ma2 0.34204
## sigma 0.38790
##
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic: 1.49 1.68 2.12
## Individual Statistic: 0.35 0.47 0.75
##
##
## Elapsed time : 0.03864908
##
##
## $rank.matrix
## ar1 ar2 ma1 ma2 im arf AIC converged
## 1 1 1 1 1 1 0 0.9707522 1
## 2 1 1 0 1 1 0 0.9852806 1
## 3 1 1 1 0 1 0 0.9866914 1
## 4 0 1 1 1 1 0 0.9892395 1
## 5 1 1 0 0 1 0 0.9965384 1
## 6 0 0 1 0 1 0 0.9965854 1
## 7 1 0 0 0 1 0 1.0018813 1
## 8 1 0 0 1 1 0 1.0026800 1
## 9 1 0 1 1 1 0 1.0029571 1
## 10 0 1 1 0 1 0 1.0032773 1
## 11 0 0 1 1 1 0 1.0055765 1
## 12 1 0 1 0 1 0 1.0057489 1
## 13 0 0 0 1 1 0 1.0304772 1
## 14 0 1 0 0 1 0 1.0324507 1
## 15 0 1 0 1 1 0 1.0371491 1
## 16 1 0 0 0 0 0 2.4606673 1
## 17 1 0 1 0 0 0 2.4642127 1
## 18 1 0 0 1 0 0 2.4664591 1
## 19 1 0 1 1 0 0 2.4700747 1
## 20 1 1 0 0 0 0 2.9683491 1
## 21 1 1 0 1 0 0 2.9762971 1
## 22 0 1 0 0 0 0 3.0700273 1
## 23 0 1 0 1 0 0 3.0700772 1
## 24 0 0 1 1 0 0 5.1762396 1
## 25 0 0 1 0 0 0 6.0709992 1
## 26 0 0 0 0 1 0 36.8556341 1
## 27 0 1 1 1 0 0 109.0823774 1
## 28 1 1 1 1 0 0 109.3079241 1
## 29 0 1 1 0 0 0 109.8637604 1
## 30 0 0 0 1 0 0 110.8879250 1
## 31 1 1 1 0 0 0 NA 0
autoarfima(VNIaft, ar.max = 2, ma.max = 2, criterion = 'AIC', method = 'full')
## $fit
##
## *----------------------------------*
## * ARFIMA Model Fit *
## *----------------------------------*
## Mean Model : ARFIMA(2,0,1)
## Distribution : norm
##
## Optimal Parameters
## ------------------------------------
## Estimate Std. Error t value Pr(>|t|)
## mu 1240.46791 11.168541 111.0680 0.000000
## ar1 0.76092 0.163954 4.6411 0.000003
## ar2 -0.32155 0.068499 -4.6942 0.000003
## ma1 -0.45465 0.163810 -2.7755 0.005512
## sigma 168.93312 8.109624 20.8312 0.000000
##
## Robust Standard Errors:
## Estimate Std. Error t value Pr(>|t|)
## mu 1240.46791 11.217128 110.5869 0.000000
## ar1 0.76092 0.119942 6.3441 0.000000
## ar2 -0.32155 0.076589 -4.1983 0.000027
## ma1 -0.45465 0.135340 -3.3593 0.000781
## sigma 168.93312 4.397783 38.4132 0.000000
##
## LogLikelihood : -1421.002
##
## Information Criteria
## ------------------------------------
##
## Akaike 13.143
## Bayes 13.221
## Shibata 13.142
## Hannan-Quinn 13.174
##
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 0.002129 0.9632
## Lag[2*(p+q)+(p+q)-1][8] 2.959520 0.9977
## Lag[4*(p+q)+(p+q)-1][14] 8.129104 0.3499
##
## H0 : No serial correlation
##
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 0.9341 3.338e-01
## Lag[2*(p+q)+(p+q)-1][2] 1.2688 4.187e-01
## Lag[4*(p+q)+(p+q)-1][5] 17.5761 8.933e-05
##
##
## ARCH LM Tests
## ------------------------------------
## Statistic DoF P-Value
## ARCH Lag[2] 1.504 2 4.715e-01
## ARCH Lag[5] 30.702 5 1.073e-05
## ARCH Lag[10] 38.373 10 3.267e-05
##
## Nyblom stability test
## ------------------------------------
## Joint Statistic: 1.2625
## Individual Statistics:
## mu 0.1474
## ar1 0.2046
## ar2 0.1953
## ma1 0.2931
## sigma 0.1836
##
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic: 1.28 1.47 1.88
## Individual Statistic: 0.35 0.47 0.75
##
##
## Elapsed time : 0.02621293
##
##
## $rank.matrix
## ar1 ar2 ma1 ma2 im arf AIC converged
## 1 1 1 1 0 1 0 13.14287 1
## 2 0 1 1 1 1 0 13.14414 1
## 3 1 1 0 1 1 0 13.14684 1
## 4 1 1 1 1 1 0 13.14727 1
## 5 1 1 0 0 1 0 13.15233 1
## 6 0 0 1 0 1 0 13.15690 1
## 7 1 0 0 1 1 0 13.16320 1
## 8 1 0 1 1 1 0 13.16500 1
## 9 0 0 1 1 1 0 13.16568 1
## 10 1 0 1 0 1 0 13.16597 1
## 11 0 1 1 0 1 0 13.17035 1
## 12 1 0 0 0 1 0 13.17322 1
## 13 0 0 0 1 1 0 13.24228 1
## 14 0 1 0 0 1 0 13.24459 1
## 15 0 0 0 0 1 0 13.24482 1
## 16 0 1 0 1 1 0 13.24871 1
## 17 1 0 1 1 0 0 13.66565 1
## 18 1 0 1 0 0 0 13.72892 1
## 19 1 0 0 1 0 0 13.77879 1
## 20 1 0 0 0 0 0 13.79857 1
## 21 1 1 0 1 0 0 13.86567 1
## 22 1 1 1 1 0 0 13.87400 1
## 23 1 1 0 0 0 0 13.93991 1
## 24 0 1 0 0 0 0 14.26785 1
## 25 0 0 1 1 0 0 15.34053 1
## 26 0 0 1 0 0 0 15.99916 1
## 27 0 0 0 1 0 0 16.13086 1
## 28 0 1 1 1 0 0 118.33002 1
## 29 0 1 0 1 0 0 121.92775 1
## 30 0 1 1 0 0 0 1083.90573 1
## 31 1 1 1 0 0 0 NA 0
# PHÂN PHỐI CHUẨN
sgxaft11n.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'norm')
sgxaft11n <- ugarchfit(spec = sgxaft11n.spec, SGXaft)
# PHÂN PHỐI STUDENT
sgxaft11std.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'std')
sgxaft11std <- ugarchfit(sgxaft11std.spec, SGXaft)
# PHÂN PHỐI ĐỐI XỨNG (sstd)
sgxaft11sstd.spec <- ugarchspec(variance.model = list( model = 'gjrGARCH', garchOrder = c(1,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sstd')
sgxaft11sstd <- ugarchfit(sgxaft11sstd.spec, SGXaft)
# PHÂN PHỐI Generalized Error Distribution (ged)
sgxaft11ged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)), mean.model = list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "ged")
sgxaft11ged <- ugarchfit(sgxaft11ged.spec, SGXaft)
# PHÂN PHỐI Generalized Error Distribution đối xứng (sged)
sgxaft11sged.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sged')
sgxaft11sged <- ugarchfit(sgxaft11sged.spec, SGXaft)
# PHÂN PHỐI CHUẨN
sgxaft12n.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'norm')
sgxaft12n <- ugarchfit(sgxaft12n.spec, SGXaft)
# PHÂN PHỐI STUDENT
sgxaft12std.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'std')
sgxaft12std <- ugarchfit(sgxaft12std.spec, SGXaft)
# PHÂN PHỐI ĐỐI XỨNG (sstd)
sgxaft12sstd.spec <- ugarchspec(variance.model = list( model = 'gjrGARCH', garchOrder = c(1,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sstd')
sgxaft12sstd <- ugarchfit(sgxaft12sstd.spec, SGXaft)
# PHÂN PHỐI Generalized Error Distribution (ged)
sgxaft12ged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = "ged")
sgxaft12ged <- ugarchfit(sgxaft12ged.spec, SGXaft)
# PHÂN PHỐI Generalized Error Distribution đối xứng (sged)
sgxaft12sged.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sged')
sgxaft12sged <- ugarchfit(sgxaft12sged.spec, SGXaft)
# PHÂN PHỐI CHUẨN
sgxaft21n.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'norm')
sgxaft21n <- ugarchfit(sgxaft21n.spec, SGXaft)
# PHÂN PHỐI STUDENT
sgxaft21std.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'std')
sgxaft21std <- ugarchfit(sgxaft21std.spec, SGXaft)
# PHÂN PHỐI ĐỐI XỨNG (sstd)
sgxaft21sstd.spec <- ugarchspec(variance.model = list( model = 'gjrGARCH', garchOrder = c(2,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sstd')
sgxaft21sstd <- ugarchfit(sgxaft21sstd.spec, SGXaft)
# PHÂN PHỐI Generalized Error Distribution (ged)
sgxaft21ged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = "ged")
sgxaft21ged <- ugarchfit(sgxaft21ged.spec, SGXaft)
# PHÂN PHỐI Generalized Error Distribution đối xứng (sged)
sgxaft21sged.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sged')
sgxaft21sged <- ugarchfit(sgxaft21sged.spec, SGXaft)
# PHÂN PHỐI CHUẨN
sgxaft22n.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'norm')
sgxaft22n <- ugarchfit(sgxaft22n.spec, SGXaft)
# PHÂN PHỐI STUDENT
sgxaft22std.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'std')
sgxaft22std <- ugarchfit(sgxaft22std.spec, SGXaft)
# PHÂN PHỐI ĐỐI XỨNG (sstd)
sgxaft22sstd.spec <- ugarchspec(variance.model = list( model = 'gjrGARCH', garchOrder = c(2,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sstd')
sgxaft22sstd <- ugarchfit(sgxaft22sstd.spec, SGXaft)
# PHÂN PHỐI Generalized Error Distribution (ged)
sgxaft22ged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = "ged")
sgxaft22ged <- ugarchfit(sgxaft22ged.spec, SGXaft)
# PHÂN PHỐI Generalized Error Distribution đối xứng (sged)
sgxaft22sged.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sged')
sgxaft22sged <- ugarchfit(sgxaft22sged.spec, SGXaft)
# PHÂN PHỐI CHUẨN
vniaft11n.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'norm')
vniaft11n <- ugarchfit(vniaft11n.spec, VNIaft)
# PHÂN PHỐI STUDENT
vniaft11std.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'std')
vniaft11std <- ugarchfit(vniaft11std.spec, VNIaft)
# PHÂN PHỐI ĐỐI XỨNG (sstd)
vniaft11sstd.spec <- ugarchspec(variance.model = list( model = 'gjrGARCH', garchOrder = c(1,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sstd')
vniaft11sstd <- ugarchfit(vniaft11sstd.spec, VNIaft)
# PHÂN PHỐI Generalized Error Distribution (ged)
vniaft11ged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)), mean.model = list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "ged")
vniaft11ged <- ugarchfit(vniaft11ged.spec, VNIaft)
# PHÂN PHỐI Generalized Error Distribution đối xứng (sged)
vniaft11sged.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sged')
vniaft11sged <- ugarchfit(vniaft11sged.spec, VNIaft)
# PHÂN PHỐI CHUẨN
vniaft12n.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'norm')
vniaft12n <- ugarchfit(vniaft12n.spec, VNIaft)
# PHÂN PHỐI STUDENT
vniaft12std.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'std')
vniaft12std <- ugarchfit(vniaft12std.spec, VNIaft)
# PHÂN PHỐI ĐỐI XỨNG (sstd)
vniaft12sstd.spec <- ugarchspec(variance.model = list( model = 'gjrGARCH', garchOrder = c(1,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sstd')
vniaft12sstd <- ugarchfit(vniaft12sstd.spec, VNIaft)
# PHÂN PHỐI Generalized Error Distribution (ged)
vniaft12ged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = "ged")
vniaft12ged <- ugarchfit(vniaft12ged.spec, VNIaft)
# PHÂN PHỐI Generalized Error Distribution đối xứng (sged)
vniaft12sged.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(1,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sged')
vniaft12sged <- ugarchfit(vniaft12sged.spec, VNIaft)
# PHÂN PHỐI CHUẨN
vniaft21n.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'norm')
vniaft21n <- ugarchfit(vniaft21n.spec, VNIaft)
# PHÂN PHỐI STUDENT
vniaft21std.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'std')
vniaft21std <- ugarchfit(vniaft21std.spec, VNIaft)
# PHÂN PHỐI ĐỐI XỨNG (sstd)
vniaft21sstd.spec <- ugarchspec(variance.model = list( model = 'gjrGARCH', garchOrder = c(2,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sstd')
vniaft21sstd <- ugarchfit(vniaft21sstd.spec, VNIaft)
# PHÂN PHỐI Generalized Error Distribution (ged)
vniaft21ged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = "ged")
vniaft21ged <- ugarchfit(vniaft21ged.spec, VNIaft)
# PHÂN PHỐI Generalized Error Distribution đối xứng (sged)
vniaft21sged.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,1)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sged')
vniaft21sged <- ugarchfit(vniaft21sged.spec, VNIaft)
# PHÂN PHỐI CHUẨN
vniaft22n.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'norm')
vniaft22n <- ugarchfit(vniaft22n.spec, VNIaft)
# PHÂN PHỐI STUDENT
vniaft22std.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'std')
vniaft22std <- ugarchfit(vniaft22std.spec, VNIaft)
# PHÂN PHỐI ĐỐI XỨNG (sstd)
vniaft22sstd.spec <- ugarchspec(variance.model = list( model = 'gjrGARCH', garchOrder = c(2,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sstd')
vniaft22sstd <- ugarchfit(vniaft22sstd.spec, VNIaft)
# PHÂN PHỐI Generalized Error Distribution (ged)
vniaft22ged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = "ged")
vniaft22ged <- ugarchfit(sgxaft22ged.spec, VNIaft)
# PHÂN PHỐI Generalized Error Distribution đối xứng (sged)
vniaft22sged.spec <- ugarchspec(variance.model = list(model = 'gjrGARCH', garchOrder = c(2,2)), mean.model = list(armaOrder = c(2,2), include.mean = TRUE), distribution.model = 'sged')
vniaft22sged <- ugarchfit(sgxaft22sged.spec, VNIaft)
sgxaft.model.list <- list(sgxaft11n = sgxaft11n,
sgxaft11std = sgxaft11std,
sgxaft11sstd = sgxaft11sstd,
sgxaft11ged = sgxaft11ged,
sgxaft11sged = sgxaft11sged,
sgxaft12std = sgxaft12std,
sgxaft12sstd = sgxaft12sstd,
sgxaft12ged = sgxaft12ged,
sgxaft12sged = sgxaft12sged,
sgxaft21n = sgxaft21n,
sgxaft21std = sgxaft21std,
sgxaft21ged = sgxaft21ged,
sgxaft21sged = sgxaft21sged,
sgxaft22n = sgxaft22n,
sgxaft22ged = sgxaft22ged,
sgxaft22sged = sgxaft22sged)
sgxaft.info.mat <- sapply(sgxaft.model.list, infocriteria)
rownames(sgxaft.info.mat) <- rownames(infocriteria(sgxaft11n))
sgxaft.info.mat
## sgxaft11n sgxaft11std sgxaft11sstd sgxaft11ged sgxaft11sged
## Akaike 0.9601930 0.9584435 0.7801714 0.9629774 0.7766020
## Bayes 1.1003731 1.1141991 0.9515026 1.1187330 0.9479332
## Shibata 0.9569319 0.9544404 0.7753551 0.9589743 0.7717857
## Hannan-Quinn 1.0168199 1.0213623 0.8493821 1.0258962 0.8458127
## sgxaft12std sgxaft12sstd sgxaft12ged sgxaft12sged sgxaft21n
## Akaike 0.9273060 1.349646 0.9249760 1.172116 0.9509687
## Bayes 1.0986372 1.536553 1.0963072 1.359023 1.1222999
## Shibata 0.9224897 1.343947 0.9201597 1.166417 0.9461524
## Hannan-Quinn 0.9965167 1.425149 0.9941867 1.247619 1.0201794
## sgxaft21std sgxaft21ged sgxaft21sged sgxaft22n sgxaft22ged
## Akaike 0.9621047 1.017878 0.7826898 0.9499881 0.9528708
## Bayes 1.1490115 1.204784 0.9851721 1.1368949 1.1553531
## Shibata 0.9564052 1.012178 0.7760382 0.9442886 0.9462192
## Hannan-Quinn 1.0376073 1.093380 0.8644842 1.0254907 1.0346653
## sgxaft22sged
## Akaike 11.37435
## Bayes 11.59241
## Shibata 11.36668
## Hannan-Quinn 11.46244
sgxaft.inds <- which(sgxaft.info.mat == min(sgxaft.info.mat), arr.ind = TRUE)
model.sgxaft <- colnames(sgxaft.info.mat)[sgxaft.inds[,2]]
model.sgxaft
## [1] "sgxaft11sged"
sgxaft11sged
##
## *---------------------------------*
## * GARCH Model Fit *
## *---------------------------------*
##
## Conditional Variance Dynamics
## -----------------------------------
## GARCH Model : gjrGARCH(1,1)
## Mean Model : ARFIMA(2,0,2)
## Distribution : sged
##
## Optimal Parameters
## ------------------------------------
## Estimate Std. Error t value Pr(>|t|)
## mu 9.471405 0.000001 8.9197e+06 0.000000
## ar1 0.215563 0.037269 5.7840e+00 0.000000
## ar2 -0.552891 0.062550 -8.8392e+00 0.000000
## ma1 -0.029947 0.005236 -5.7189e+00 0.000000
## ma2 0.546288 0.065485 8.3422e+00 0.000000
## omega 0.000931 0.000077 1.2112e+01 0.000000
## alpha1 0.009080 0.002746 3.3068e+00 0.000944
## beta1 1.000000 0.000000 3.4115e+06 0.000000
## gamma1 -0.023787 0.003368 -7.0638e+00 0.000000
## skew 0.490932 0.045033 1.0902e+01 0.000000
## shape 1.654870 0.202809 8.1598e+00 0.000000
##
## Robust Standard Errors:
## Estimate Std. Error t value Pr(>|t|)
## mu 9.471405 0.000001 1.3930e+07 0
## ar1 0.215563 0.029629 7.2755e+00 0
## ar2 -0.552891 0.047227 -1.1707e+01 0
## ma1 -0.029947 0.003980 -7.5237e+00 0
## ma2 0.546288 0.028597 1.9103e+01 0
## omega 0.000931 0.000023 4.0262e+01 0
## alpha1 0.009080 0.000396 2.2911e+01 0
## beta1 1.000000 0.000000 8.4607e+06 0
## gamma1 -0.023787 0.000715 -3.3291e+01 0
## skew 0.490932 0.030625 1.6030e+01 0
## shape 1.654870 0.226016 7.3219e+00 0
##
## LogLikelihood : -73.26131
##
## Information Criteria
## ------------------------------------
##
## Akaike 0.77660
## Bayes 0.94793
## Shibata 0.77179
## Hannan-Quinn 0.84581
##
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 0.116 0.7333892
## Lag[2*(p+q)+(p+q)-1][11] 8.330 0.0002456
## Lag[4*(p+q)+(p+q)-1][19] 16.048 0.0128819
## d.o.f=4
## H0 : No serial correlation
##
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 3.895 0.04844
## Lag[2*(p+q)+(p+q)-1][5] 6.214 0.08006
## Lag[4*(p+q)+(p+q)-1][9] 9.226 0.07303
## d.o.f=2
##
## Weighted ARCH LM Tests
## ------------------------------------
## Statistic Shape Scale P-Value
## ARCH Lag[3] 3.380 0.500 2.000 0.06598
## ARCH Lag[5] 3.859 1.440 1.667 0.18709
## ARCH Lag[7] 4.319 2.315 1.543 0.30286
##
## Nyblom stability test
## ------------------------------------
## Joint Statistic: 1.8806
## Individual Statistics:
## mu 0.04943
## ar1 0.24822
## ar2 0.26307
## ma1 0.11584
## ma2 0.18378
## omega 0.03711
## alpha1 0.04094
## beta1 0.03802
## gamma1 0.04132
## skew 0.29382
## shape 0.37704
##
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic: 2.49 2.75 3.27
## Individual Statistic: 0.35 0.47 0.75
##
## Sign Bias Test
## ------------------------------------
## t-value prob sig
## Sign Bias 0.4735 0.63632
## Negative Sign Bias 2.1536 0.03240 **
## Positive Sign Bias 1.8949 0.05946 *
## Joint Effect 8.2350 0.04140 **
##
##
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
## group statistic p-value(g-1)
## 1 20 20.14 0.38603
## 2 30 34.75 0.21283
## 3 40 61.89 0.01125
## 4 50 57.88 0.18015
##
##
## Elapsed time : 0.9005129
vniaft.model.list <- list(vniaft11n = vniaft11n,
vniaft11std = vniaft11std,
vniaft11sstd = vniaft11sstd,
vniaft11ged = vniaft11ged,
vniaft11sged = vniaft11sged,
vniaft12n = vniaft12n,
vniaft12std = vniaft12std,
vniaft12sstd = vniaft12sstd,
vniaft12ged = vniaft12ged,
vniaft12sged = vniaft12sged,
vniaft21n = vniaft21n,
vniaft21std = vniaft21std,
vniaft21sstd = vniaft21sstd,
vniaft21ged = vniaft21ged,
vniaft21sged = vniaft21sged,
vniaft22n = vniaft22n,
vniaft22std = vniaft22std,
vniaft22sstd = vniaft22sstd,
vniaft22ged = vniaft22ged,
vniaft22sged = vniaft22sged)
vniaft.info.mat <- sapply(vniaft.model.list, infocriteria)
rownames(vniaft.info.mat) <- rownames(infocriteria(vniaft11n))
vniaft.info.mat
## vniaft11n vniaft11std vniaft11sstd vniaft11ged vniaft11sged
## Akaike 13.17345 13.18730 13.10017 12.90900 12.86246
## Bayes 13.31363 13.34305 13.27150 13.06476 13.03380
## Shibata 13.17018 13.18329 13.09536 12.90500 12.85765
## Hannan-Quinn 13.23007 13.25021 13.16938 12.97192 12.93167
## vniaft12n vniaft12std vniaft12sstd vniaft12ged vniaft12sged
## Akaike 13.18143 13.19527 13.14015 12.89683 12.86958
## Bayes 13.33718 13.36660 13.32705 13.06816 13.05649
## Shibata 13.17743 13.19045 13.13445 12.89201 12.86388
## Hannan-Quinn 13.24435 13.26448 13.21565 12.96604 12.94509
## vniaft21n vniaft21std vniaft21sstd vniaft21ged vniaft21sged
## Akaike 13.11743 13.13663 13.11567 12.91621 12.88172
## Bayes 13.28876 13.32354 13.31815 13.10312 13.08421
## Shibata 13.11261 13.13093 13.10902 12.91051 12.87507
## Hannan-Quinn 13.18664 13.21213 13.19746 12.99171 12.96352
## vniaft22n vniaft22std vniaft22sstd vniaft22ged vniaft22sged
## Akaike 13.12664 13.14584 13.14262 12.90268 12.88862
## Bayes 13.31355 13.34832 13.36068 13.10516 13.10668
## Shibata 13.12094 13.13919 13.13495 12.89603 12.88095
## Hannan-Quinn 13.20215 13.22763 13.23071 12.98448 12.97671
vniaft.inds <- which(vniaft.info.mat == min(vniaft.info.mat), arr.ind = TRUE)
model.vniaft <- colnames(vniaft.info.mat)[vniaft.inds[,2]]
model.vniaft
## [1] "vniaft11sged"
vniaft11sged
##
## *---------------------------------*
## * GARCH Model Fit *
## *---------------------------------*
##
## Conditional Variance Dynamics
## -----------------------------------
## GARCH Model : gjrGARCH(1,1)
## Mean Model : ARFIMA(2,0,2)
## Distribution : sged
##
## Optimal Parameters
## ------------------------------------
## Estimate Std. Error t value Pr(>|t|)
## mu 1228.198339 0.750412 1.6367e+03 0.00000
## ar1 0.341932 0.000169 2.0177e+03 0.00000
## ar2 -0.137339 0.000065 -2.1250e+03 0.00000
## ma1 -0.343341 0.000168 -2.0379e+03 0.00000
## ma2 0.126757 0.000060 2.1248e+03 0.00000
## omega 35.821729 0.027448 1.3051e+03 0.00000
## alpha1 0.000000 0.000001 1.5270e-03 0.99878
## beta1 0.989993 0.000503 1.9665e+03 0.00000
## gamma1 0.014704 0.000010 1.4300e+03 0.00000
## skew 0.010016 0.015051 6.6547e-01 0.50575
## shape 23.637045 0.018116 1.3048e+03 0.00000
##
## Robust Standard Errors:
## Estimate Std. Error t value Pr(>|t|)
## mu 1228.198339 NaN NaN NaN
## ar1 0.341932 NaN NaN NaN
## ar2 -0.137339 NaN NaN NaN
## ma1 -0.343341 NaN NaN NaN
## ma2 0.126757 NaN NaN NaN
## omega 35.821729 NaN NaN NaN
## alpha1 0.000000 NaN NaN NaN
## beta1 0.989993 NaN NaN NaN
## gamma1 0.014704 NaN NaN NaN
## skew 0.010016 NaN NaN NaN
## shape 23.637045 NaN NaN NaN
##
## LogLikelihood : -1384.577
##
## Information Criteria
## ------------------------------------
##
## Akaike 12.862
## Bayes 13.034
## Shibata 12.858
## Hannan-Quinn 12.932
##
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 17.07 3.604e-05
## Lag[2*(p+q)+(p+q)-1][11] 36.93 0.000e+00
## Lag[4*(p+q)+(p+q)-1][19] 51.44 0.000e+00
## d.o.f=4
## H0 : No serial correlation
##
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 17.88 2.357e-05
## Lag[2*(p+q)+(p+q)-1][5] 50.12 5.840e-14
## Lag[4*(p+q)+(p+q)-1][9] 73.03 0.000e+00
## d.o.f=2
##
## Weighted ARCH LM Tests
## ------------------------------------
## Statistic Shape Scale P-Value
## ARCH Lag[3] 30.38 0.500 2.000 3.550e-08
## ARCH Lag[5] 53.67 1.440 1.667 5.440e-14
## ARCH Lag[7] 61.40 2.315 1.543 5.551e-16
##
## Nyblom stability test
## ------------------------------------
## Joint Statistic: NaN
## Individual Statistics:
## mu NaN
## ar1 0.6666
## ar2 1.0207
## ma1 0.6670
## ma2 1.0255
## omega 0.3589
## alpha1 NaN
## beta1 NaN
## gamma1 0.3329
## skew 0.8966
## shape 0.5099
##
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic: 2.49 2.75 3.27
## Individual Statistic: 0.35 0.47 0.75
##
## Sign Bias Test
## ------------------------------------
## t-value prob sig
## Sign Bias 0.8064 4.209e-01
## Negative Sign Bias 5.2718 3.319e-07 ***
## Positive Sign Bias 2.3944 1.752e-02 **
## Joint Effect 38.5150 2.199e-08 ***
##
##
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
## group statistic p-value(g-1)
## 1 20 122.1 4.528e-17
## 2 30 140.1 1.656e-16
## 3 40 145.2 3.783e-14
## 4 50 161.1 7.161e-14
##
##
## Elapsed time : 2.562097
sgxaft.res <- residuals(sgxaft11sged)/sigma(sgxaft11sged)
fitdist(distribution = 'sged' , sgxaft.res, control = list())$pars
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## mu sigma skew shape
## -0.06197076 1.07935331 0.47365287 1.58120225
sa <- pdist(distribution = 'sged' , q = sgxaft.res, mu = -0.06197076, sigma = 1.07935331, skew = 0.47365287, shape = 1.58120225)
vniaft.res <- residuals(vniaft11sged)/sigma(vniaft11sged)
fitdist(distribution = 'sged' , vniaft.res, control = list())$pars
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## Warning in .safefunx(tmpv, .solnp_fun, .env, ...):
## solnp-->warning: Inf detected in function call...check your function
## mu sigma skew shape
## 0.050907115 0.981317542 0.001467208 12.686171562
va <- pdist(distribution = 'sged' , q = vniaft.res, mu = 0.050907115 , sigma = 0.981317542, skew = 0.001467208, shape = 12.686171562)
# Kiểm định Anderson-Darling
ad.test(sa, 'punif')
##
## Anderson-Darling test of goodness-of-fit
## Null hypothesis: uniform distribution
## Parameters assumed to be fixed
##
## data: sa
## An = 0.31624, p-value = 0.9254
ad.test(va, 'punif')
##
## Anderson-Darling test of goodness-of-fit
## Null hypothesis: uniform distribution
## Parameters assumed to be fixed
##
## data: va
## An = 7.5657, p-value = 0.0001832
# Kiểm định Cramer-von Mises
cvm.test(sa, 'punif')
##
## Cramer-von Mises test of goodness-of-fit
## Null hypothesis: uniform distribution
## Parameters assumed to be fixed
##
## data: sa
## omega2 = 0.044824, p-value = 0.9073
cvm.test(va, 'punif')
##
## Cramer-von Mises test of goodness-of-fit
## Null hypothesis: uniform distribution
## Parameters assumed to be fixed
##
## data: va
## omega2 = 0.72607, p-value = 0.01094
# Kiểm định ks-test
ks.test(sa, 'punif')
##
## Asymptotic one-sample Kolmogorov-Smirnov test
##
## data: sa
## D = 0.042998, p-value = 0.8172
## alternative hypothesis: two-sided
ks.test(va, 'punif')
##
## Asymptotic one-sample Kolmogorov-Smirnov test
##
## data: va
## D = 0.1393, p-value = 0.0004399
## alternative hypothesis: two-sided
library(VineCopula)
BiCopSelect(sa, va, familyset = 1:9, selectioncrit = 'AIC' , indeptest = FALSE , level = 0.05)
## Bivariate copula: Clayton (par = 1.32, tau = 0.4)
hihi <- BiCopEst(sa,va, family = 3, method = 'mle', se = T, max.df = 10)
summary(hihi)
## Family
## ------
## No: 3
## Name: Clayton
##
## Parameter(s)
## ------------
## par: 1.32 (SE = 0.15)
##
## Dependence measures
## -------------------
## Kendall's tau: 0.4 (empirical = 0.52, p value < 0.01)
## Upper TD: 0
## Lower TD: 0.59
##
## Fit statistics
## --------------
## logLik: 62.98
## AIC: -123.96
## BIC: -120.58