d <- readxl::read_excel("C:/Users/tranh/Downloads/thongke/VNdata.xlsx")
library(tseries)
Kiểm định tính phân phối chuẩn Jarque-Bera
jarque.bera.test(d$VN30)
##
## Jarque Bera Test
##
## data: d$VN30
## X-squared = 8.0529, df = 2, p-value = 0.01784
jarque.bera.test(d$VNIndex)
##
## Jarque Bera Test
##
## data: d$VNIndex
## X-squared = 8.7594, df = 2, p-value = 0.01253
Kiểm định tính dừng Augmented Dickey-Fuller
adf.test(d$VN30)
##
## Augmented Dickey-Fuller Test
##
## data: d$VN30
## Dickey-Fuller = -2.2505, Lag order = 4, p-value = 0.4732
## alternative hypothesis: stationary
adf.test(d$VNIndex)
##
## Augmented Dickey-Fuller Test
##
## data: d$VNIndex
## Dickey-Fuller = -2.1803, Lag order = 4, p-value = 0.5019
## alternative hypothesis: stationary
Kiểm định tương quan chuỗi LJung-Box
Box.test(d$VN30, type = "Ljung-Box")
##
## Box-Ljung test
##
## data: d$VN30
## X-squared = 76.433, df = 1, p-value < 2.2e-16
Box.test(d$VNIndex, type = "Ljung-Box")
##
## Box-Ljung test
##
## data: d$VNIndex
## X-squared = 75.646, df = 1, p-value < 2.2e-16
Kiểm định hiệu ứng ARCH: ARCH - LM
library(rugarch)
ugarchfit(spec = ugarchspec(), data = d$VN30)
## Warning in .sgarchfit(spec = spec, data = data, out.sample = out.sample, :
## ugarchfit-->waring: using less than 100 data
## points for estimation
## Warning in .sgarchfit(spec = spec, data = data, out.sample = out.sample, :
## ugarchfit-->warning: solver failer to converge.
##
## *---------------------------------*
## * GARCH Model Fit *
## *---------------------------------*
##
## Conditional Variance Dynamics
## -----------------------------------
## GARCH Model : sGARCH(1,1)
## Mean Model : ARFIMA(1,0,1)
## Distribution : norm
##
## Convergence Problem:
## Solver Message:
ugarchfit(spec = ugarchspec(), data = d$VNIndex)
## Warning in .sgarchfit(spec = spec, data = data, out.sample = out.sample, :
## ugarchfit-->waring: using less than 100 data
## points for estimation
##
## *---------------------------------*
## * GARCH Model Fit *
## *---------------------------------*
##
## Conditional Variance Dynamics
## -----------------------------------
## GARCH Model : sGARCH(1,1)
## Mean Model : ARFIMA(1,0,1)
## Distribution : norm
##
## Optimal Parameters
## ------------------------------------
## Estimate Std. Error t value Pr(>|t|)
## mu 1157.70772 23.290502 49.7073 0.000000
## ar1 1.00000 0.024456 40.8897 0.000000
## ma1 0.20249 0.144893 1.3975 0.162265
## omega 607.65692 182.606618 3.3277 0.000876
## alpha1 0.87960 0.413698 2.1262 0.033487
## beta1 0.00000 0.041393 0.0000 1.000000
##
## Robust Standard Errors:
## Estimate Std. Error t value Pr(>|t|)
## mu 1157.70772 3.456004 334.9844 0.000000
## ar1 1.00000 0.026242 38.1076 0.000000
## ma1 0.20249 0.158873 1.2745 0.202479
## omega 607.65692 223.212252 2.7223 0.006482
## alpha1 0.87960 0.449781 1.9556 0.050510
## beta1 0.00000 0.030312 0.0000 1.000000
##
## LogLikelihood : -393.2351
##
## Information Criteria
## ------------------------------------
##
## Akaike 9.9809
## Bayes 10.1595
## Shibata 9.9706
## Hannan-Quinn 10.0525
##
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 0.5263 0.4682
## Lag[2*(p+q)+(p+q)-1][5] 3.1754 0.3661
## Lag[4*(p+q)+(p+q)-1][9] 5.1276 0.4251
## d.o.f=2
## H0 : No serial correlation
##
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
## statistic p-value
## Lag[1] 1.117 0.2905
## Lag[2*(p+q)+(p+q)-1][5] 3.895 0.2675
## Lag[4*(p+q)+(p+q)-1][9] 5.828 0.3185
## d.o.f=2
##
## Weighted ARCH LM Tests
## ------------------------------------
## Statistic Shape Scale P-Value
## ARCH Lag[3] 3.262 0.500 2.000 0.07089
## ARCH Lag[5] 4.703 1.440 1.667 0.12029
## ARCH Lag[7] 5.093 2.315 1.543 0.21529
##
## Nyblom stability test
## ------------------------------------
## Joint Statistic: 0.9568
## Individual Statistics:
## mu 0.007867
## ar1 0.122601
## ma1 0.025251
## omega 0.394483
## alpha1 0.073398
## beta1 0.204222
##
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic: 1.49 1.68 2.12
## Individual Statistic: 0.35 0.47 0.75
##
## Sign Bias Test
## ------------------------------------
## t-value prob sig
## Sign Bias 0.7000 0.4861
## Negative Sign Bias 0.6337 0.5282
## Positive Sign Bias 1.0352 0.3039
## Joint Effect 1.5023 0.6817
##
##
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
## group statistic p-value(g-1)
## 1 20 24.00 0.1962
## 2 30 28.75 0.4781
## 3 40 50.00 0.1115
## 4 50 61.25 0.1125
##
##
## Elapsed time : 0.09904099