library(readxl)
library(rugarch)
## Loading required package: parallel
## 
## Attaching package: 'rugarch'
## The following object is masked from 'package:stats':
## 
##     sigma
data <- read_excel("C:/Users/chaua/OneDrive - UFM/TLHT/Mô hình ngẫu nhiên/data.xlsx")
## New names:
## • `Date` -> `Date...1`
## • `Date` -> `Date...4`
VNts <- ts(data$VNI)
print(VNts)
## Time Series:
## Start = 1 
## End = 1360 
## Frequency = 1 
##    [1] 1222.90 1207.67 1197.33 1200.84 1195.90 1190.72 1185.90 1172.81 1172.98
##   [10] 1174.09 1173.13 1168.40 1165.42 1154.20 1151.77 1149.02 1138.07 1126.22
##   [19] 1134.62 1132.00 1125.50 1120.18 1138.35 1134.33 1132.03 1129.38 1125.30
##   [28] 1118.46 1111.72 1105.40 1115.22 1116.97 1117.42 1122.46 1116.02 1107.53
##   [37] 1101.32 1109.54 1108.31 1097.82 1078.39 1075.17 1078.05 1074.98 1063.76
##   [46] 1064.63 1061.79 1065.85 1070.64 1067.07 1068.31 1060.44 1065.91 1065.71
##   [55] 1066.90 1057.12 1058.26 1053.77 1053.44 1040.31 1040.61 1049.12 1039.63
##   [64] 1040.80 1034.85 1041.36 1042.91 1049.25 1048.98 1055.02 1053.81 1052.89
##   [73] 1064.30 1069.45 1069.46 1065.35 1070.91 1080.86 1078.45 1079.28 1064.64
##   [82] 1059.44 1056.33 1054.29 1052.25 1046.79 1045.10 1040.54 1032.43 1023.10
##   [91] 1045.14 1047.40 1062.19 1040.13 1052.80 1053.00 1055.95 1049.18 1037.84
##  [100] 1027.18 1024.77 1037.61 1040.55 1024.68 1021.25 1039.56 1053.66 1054.28
##  [109] 1082.23 1086.69 1059.31 1058.29 1048.20 1038.64 1043.70 1055.30 1064.03
##  [118] 1072.22 1065.84 1089.29 1077.15 1077.59 1075.97 1111.18 1102.57 1117.10
##  [127] 1108.08 1098.28 1088.29 1066.68 1060.17 1056.39 1055.76 1053.35 1054.21
##  [136] 1051.44 1055.82 1046.35 1043.90 1007.09 1009.29 1015.66 1004.57 1020.34
##  [145] 1022.61 1018.88 1023.13 1038.40 1052.48 1055.32 1050.43 1047.45 1032.07
##  [154] 1051.81 1050.53 1041.02 1048.69 1093.67 1080.01 1036.28 1048.42 1032.16
##  [163] 1005.69  971.46  947.71  946.00  952.12  960.65  969.33  969.26  942.90
##  [172]  911.90  941.04  954.53  947.24  985.59  981.65  975.19  997.15 1019.81
##  [181] 1023.19 1033.75 1027.94 1027.36 1028.01  993.36  997.70 1019.82 1058.45
##  [190] 1060.07 1063.66 1051.58 1061.85 1050.99 1034.81 1006.20 1042.48 1035.91
##  [199] 1074.52 1104.26 1078.14 1086.44 1132.11 1126.07 1143.62 1166.54 1174.35
##  [208] 1203.28 1214.70 1210.55 1218.93 1205.43 1234.03 1245.66 1240.77 1248.40
##  [217] 1249.62 1248.78 1234.60 1243.17 1277.40 1277.35 1280.51 1279.39 1270.80
##  [226] 1282.57 1288.88 1277.16 1270.81 1260.43 1269.18 1273.66 1275.28 1274.69
##  [235] 1274.20 1262.33 1252.07 1256.50 1256.75 1252.74 1254.15 1249.76 1241.62
##  [244] 1231.35 1206.33 1208.12 1191.04 1185.07 1188.50 1194.76 1198.47 1194.14
##  [253] 1178.33 1176.49 1179.25 1182.17 1173.92 1174.82 1171.31 1166.48 1149.61
##  [262] 1181.29 1195.53 1198.90 1197.60 1218.09 1218.10 1202.82 1185.48 1188.88
##  [271] 1169.27 1172.47 1180.40 1217.30 1236.63 1213.93 1230.31 1227.04 1284.08
##  [280] 1307.80 1307.91 1291.35 1290.01 1287.98 1288.62 1299.52 1292.68 1293.92
##  [289] 1285.45 1268.57 1268.43 1233.38 1218.81 1240.71 1241.64 1240.76 1228.37
##  [298] 1182.77 1238.84 1301.53 1293.56 1269.62 1329.26 1360.68 1348.68 1366.80
##  [307] 1350.99 1353.77 1341.34 1310.92 1379.23 1370.21 1384.72 1406.45 1432.60
##  [316] 1458.56 1472.12 1477.20 1455.25 1482.00 1502.35 1522.90 1520.03 1524.70
##  [325] 1516.44 1492.15 1490.51 1497.76 1483.18 1498.50 1498.26 1502.34 1503.78
##  [334] 1494.95 1469.10 1461.34 1459.33 1452.74 1446.25 1466.54 1479.08 1473.74
##  [343] 1473.71 1499.05 1505.33 1505.00 1485.52 1498.78 1490.13 1498.89 1494.85
##  [352] 1512.30 1503.47 1510.84 1504.84 1507.99 1492.10 1492.75 1471.96 1501.71
##  [361] 1506.79 1505.38 1500.99 1497.66 1478.96 1470.76 1481.58 1479.58 1439.71
##  [370] 1472.89 1465.30 1442.79 1438.94 1452.84 1496.02 1496.05 1510.51 1492.31
##  [379] 1503.71 1528.48 1528.57 1522.50 1525.58 1498.28 1485.97 1485.82 1494.39
##  [388] 1488.88 1477.03 1456.96 1477.67 1478.74 1477.33 1479.79 1476.61 1475.50
##  [397] 1476.02 1476.21 1463.54 1467.98 1452.87 1446.77 1413.58 1443.32 1482.05
##  [406] 1485.19 1478.44 1484.84 1493.03 1500.81 1488.87 1463.63 1447.25 1452.35
##  [415] 1469.83 1475.85 1466.45 1476.57 1473.37 1462.35 1465.02 1461.50 1467.57
##  [424] 1456.51 1444.30 1452.46 1438.97 1444.27 1438.01 1423.02 1391.63 1385.40
##  [433] 1389.24 1384.77 1393.80 1395.33 1395.53 1392.70 1391.85 1391.91 1394.80
##  [442] 1394.09 1372.73 1365.99 1362.82 1354.63 1339.54 1334.89 1342.06 1339.21
##  [451] 1339.31 1324.99 1351.17 1352.76 1350.68 1339.84 1350.48 1352.64 1345.87
##  [460] 1345.83 1339.70 1341.43 1345.31 1343.98 1333.61 1341.90 1346.39 1334.65
##  [469] 1331.47 1328.14 1313.20 1301.12 1309.55 1298.74 1298.86 1329.43 1374.85
##  [478] 1360.94 1363.09 1370.96 1357.05 1353.05 1357.79 1362.43 1341.45 1345.55
##  [487] 1334.74 1332.44 1314.22 1310.05 1293.60 1277.07 1276.93 1272.71 1268.83
##  [496] 1293.67 1270.79 1243.51 1299.31 1293.92 1279.91 1297.54 1296.30 1347.14
##  [505] 1374.68 1388.55 1354.79 1411.13 1420.27 1417.08 1408.55 1410.04 1405.81
##  [514] 1390.12 1379.72 1376.87 1379.97 1372.63 1377.77 1359.92 1356.52 1367.36
##  [523] 1361.72 1351.74 1323.58 1332.90 1319.88 1358.78 1374.05 1364.28 1340.78
##  [532] 1337.78 1328.05 1320.46 1303.57 1308.58 1297.98 1283.93 1278.22 1262.49
##  [541] 1252.68 1258.70 1266.36 1269.09 1256.04 1259.58 1241.81 1250.57 1256.43
##  [550] 1242.20 1239.39 1229.55 1219.75 1215.77 1248.53 1227.82 1268.28 1260.58
##  [559] 1238.71 1247.25 1255.87 1248.33 1252.45 1231.66 1234.89 1242.38 1239.96
##  [568] 1236.05 1216.10 1191.44 1186.36 1175.68 1162.21 1163.10 1161.81 1183.45
##  [577] 1194.43 1194.05 1200.94 1186.09 1179.90 1184.56 1181.56 1181.73 1170.08
##  [586] 1161.97 1168.27 1168.69 1168.52 1186.95 1186.61 1186.17 1168.47 1165.43
##  [595] 1162.01 1177.64 1175.04 1173.50 1174.38 1155.78 1114.93 1083.18 1126.91
##  [604] 1112.19 1111.29 1075.53 1035.51 1056.61 1023.94 1097.17 1136.12 1166.05
##  [613] 1166.78 1164.21 1134.68 1131.00 1191.94 1194.20 1187.40 1186.05 1192.28
##  [622] 1184.89 1167.69 1156.49 1143.21 1132.55 1120.47 1103.87 1097.54 1099.49
##  [631] 1091.33 1067.52 1078.90 1083.45 1081.08 1067.46 1051.77 1066.99 1055.27
##  [640] 1064.09 1045.96 1030.91 1039.13 1029.26 1029.98 1021.49 1019.80 1014.32
##  [649] 1008.87 1003.08 1010.22 1005.97  999.94  995.76  994.19  990.00  983.26
##  [658]  973.53  968.90  950.79  966.29  959.28  952.22  951.90  951.99  938.29
##  [667]  937.75  939.76  935.41  933.68  925.47  919.08  921.05  946.47  950.80
##  [676]  961.26  949.90  939.03  944.42  943.69  943.30  942.76  940.18  929.86
##  [685]  925.83  924.00  918.84  919.72  915.67  914.68  909.91  914.09  905.21
##  [694]  903.98  912.50  908.27  908.58  912.50  906.19  907.94  900.95  894.04
##  [703]  897.47  896.26  894.57  888.97  888.82  889.32  890.14  888.25  901.54
##  [712]  903.97  891.73  881.65  878.98  874.71  873.47  874.12  868.68  854.78
##  [721]  848.21  851.21  846.43  850.15  850.74  855.05  846.92  843.08  841.46
##  [730]  840.04  837.80  827.57  814.65  801.13  790.84  813.36  785.17  829.16
##  [739]  856.75  855.08  861.69  861.40  872.02  876.83  869.91  868.11  868.72
##  [748]  876.46  864.50  863.42  861.16  847.61  842.38  843.49  825.11  829.36
##  [757]  851.98  854.59  859.71  868.20  871.28  868.56  855.27  854.44  856.13
##  [766]  832.47  863.52  867.37  900.00  899.43  899.92  886.22  883.90  881.17
##  [775]  874.80  878.67  864.47  861.39  857.48  869.13  852.74  862.73  852.91
##  [784]  845.92  837.01  827.03  832.40  834.21  835.32  828.33  813.73  782.59
##  [793]  764.16  762.47  769.11  767.21  770.77  776.66  773.91  768.92  766.84
##  [802]  794.97  789.60  780.70  777.22  767.41  765.79  757.94  760.33  748.02
##  [811]  746.69  736.75  701.80  680.23  662.53  662.26  696.06  694.21  690.25
##  [820]  659.21  666.59  709.73  725.94  747.66  745.78  747.86  761.78  769.25
##  [829]  811.35  837.50  835.49  891.44  893.31  889.37  890.61  884.43  882.19
##  [838]  898.44  895.97  909.67  903.34  933.09  938.13  928.76  927.93  934.77
##  [847]  937.45  938.24  937.68  934.67  930.73  940.75  938.54  925.91  929.09
##  [856]  928.14  936.62  959.58  991.46  986.37  978.63  978.96  974.31  967.56
##  [865]  967.00  965.84  968.54  960.15  948.98  958.88  955.79  965.14  966.67
##  [874]  960.99  965.03  963.51  958.59  958.88  959.43  956.41  952.26  951.13
##  [883]  954.03  961.47  966.18  968.17  961.78  960.30  966.06  963.56  963.27
##  [892]  965.90  953.43  959.31  970.75  970.39  978.17  976.79  976.35  977.78
##  [901]  987.89 1000.56 1008.35 1002.91 1010.03 1012.30 1012.77 1018.33 1016.75
##  [910] 1022.49 1024.03 1024.91 1024.34 1022.43 1015.59  998.82 1000.89  995.87
##  [919]  996.57  993.60  987.79  987.19  983.56  989.20  989.82  994.46  993.05
##  [928]  993.57  991.84  987.38  987.83  988.22  983.09  987.59  989.67  991.19
##  [937]  999.59  996.56  997.84  990.75  987.30  988.13  985.75  990.36  997.10
##  [946]  995.15  996.74  989.86  987.22  976.07  969.31  970.26  974.12  974.08
##  [955]  976.79  977.63  979.36  984.06  978.59  977.26  976.79  982.88  992.45
##  [964]  997.26  994.38  984.67  981.03  980.00  979.38  968.91  966.83  975.24
##  [973]  965.93  964.61  973.15  991.10  997.39  991.66  986.02  997.94  993.35
##  [982]  994.95  988.41  989.46  982.04  982.34  976.05  982.57  982.11  972.53
##  [991]  975.40  978.63  973.65  969.05  966.35  975.34  973.04  960.39  961.98
## [1000]  965.61  949.94  943.11  959.13  960.13  962.85  959.20  959.18  949.69
## [1009]  944.01  946.95  953.61  950.08  954.17  962.07  962.90  958.28  948.21
## [1018]  951.16  946.47  959.88  969.34  971.54  972.00  975.14  970.03  982.71
## [1027]  983.78  986.29  976.48  975.69  975.64  965.34  958.54  952.55  947.01
## [1036]  951.22  957.56  957.97  974.14  978.50  979.64  974.13  976.92  968.00
## [1045]  965.86  966.21  962.30  972.10  977.17  982.90  985.95  981.91  988.48
## [1054]  997.56  989.26  986.91  984.46  985.81  988.53  980.76  982.98  975.91
## [1063]  969.79  970.07  988.71  981.78 1002.30 1006.59 1011.86 1004.12 1008.44
## [1072] 1005.41 1001.32  984.60  985.25  994.03  994.49  992.45  993.99  979.63
## [1081]  965.47  990.27  987.06  994.43  988.91  987.57  970.58  964.35  961.30
## [1090]  950.89  952.34  945.25  937.54  926.10  908.67  910.65  915.84  915.93
## [1099]  912.18  908.88  908.79  908.18  906.55  911.05  902.30  901.89  908.70
## [1108]  909.68  901.80  902.71  898.30  896.99  887.44  889.64  880.90  878.22
## [1117]  891.75  892.54  900.81  891.75  897.94  908.56  912.26  918.24  919.24
## [1126]  927.25  933.65  952.04  960.25  961.28  954.58  955.89  958.59  954.82
## [1135]  957.14  958.84  951.59  926.54  926.79  930.20  923.12  921.03  917.97
## [1144]  924.42  922.56  919.02  916.06  898.19  897.15  900.93  905.38  918.12
## [1153]  914.29  926.28  922.16  925.53  924.86  907.96  914.76  888.69  888.82
## [1162]  900.82  910.17  922.73  939.68  953.51  958.36  963.47  971.60  963.37
## [1171]  951.64  970.08  945.89  993.96  996.19  996.12 1008.39 1023.62 1020.40
## [1180] 1018.79 1012.88 1017.13 1015.37 1009.61 1010.74 1011.29 1002.97 1004.74
## [1189]  995.54  993.49  987.61  991.34  987.95  987.01  985.06  970.34  968.90
## [1198]  958.19  968.44  975.94  989.54  998.07  988.17  995.19  991.92  987.05
## [1207]  987.36  979.21  969.62  968.88  964.28  961.37  978.27  978.04  968.47
## [1216]  966.27  956.79  960.23  959.60  953.55  952.77  956.39  949.73  935.52
## [1225]  930.16  927.58  934.08  936.74  933.39  943.97  942.39  921.27  911.11
## [1234]  909.72  898.51  893.16  911.12  915.12  917.51  899.40  914.99  906.01
## [1243]  947.15  960.78  957.35  968.91  983.02  990.52  983.17  969.40  980.95
## [1252]  962.16  987.34 1015.72 1030.53 1020.76 1039.02 1039.01 1036.69 1034.50
## [1261] 1022.74 1013.78  992.87  971.25  948.50  931.75  963.90  985.92  988.94
## [1270]  985.91 1014.98 1040.54 1030.64 1054.62 1073.50 1066.98 1044.85 1028.87
## [1279] 1056.97 1060.45 1062.26 1026.80 1026.46 1029.08 1050.26 1044.86 1080.74
## [1288] 1076.78 1119.86 1094.63 1138.53 1153.28 1148.49 1157.14 1173.02 1167.11
## [1297] 1198.12 1204.33 1199.96 1193.17 1191.54 1188.29 1196.61 1167.03 1172.24
## [1306] 1171.73 1171.22 1153.59 1172.36 1169.36 1159.39 1159.22 1150.19 1138.76
## [1315] 1138.09 1133.31 1126.29 1123.41 1124.15 1112.26 1120.29 1093.48 1121.21
## [1324] 1115.79 1121.54 1119.61 1114.53 1102.85 1076.03 1087.15 1059.73 1041.79
## [1333] 1003.94 1023.25 1040.55 1011.60 1048.71 1105.04 1099.67 1110.36 1110.56
## [1342] 1109.80 1115.64 1104.57 1087.42 1087.42 1062.07 1050.25 1034.69 1062.96
## [1351] 1063.47 1050.11 1048.17 1038.11 1033.56 1022.90 1012.65 1019.75 1005.67
## [1360]  995.77
# Ước lượng mô hình GARCH(1,1) theo phân phối chuẩn
VNspec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)), mean.model = list(armaOrder = c(0, 0)))
VNfit <- ugarchfit(VNspec, VNts)
print(VNfit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(1,1)
## Mean Model   : ARFIMA(0,0,0)
## Distribution : norm 
## 
## Optimal Parameters
## ------------------------------------
##          Estimate  Std. Error   t value Pr(>|t|)
## mu     980.474064    1.850202 529.92813 0.000000
## omega   54.411797   14.101991   3.85845 0.000114
## alpha1   0.876518    0.084797  10.33667 0.000000
## beta1    0.126729    0.071712   1.76720 0.077195
## gamma1  -0.008495    0.077363  -0.10981 0.912563
## 
## Robust Standard Errors:
##          Estimate  Std. Error  t value Pr(>|t|)
## mu     980.474064   10.432802 93.97993 0.000000
## omega   54.411797   29.314175  1.85616 0.063431
## alpha1   0.876518    0.084994 10.31273 0.000000
## beta1    0.126729    0.094421  1.34217 0.179539
## gamma1  -0.008495    0.038935 -0.21819 0.827284
## 
## LogLikelihood : -7993.338 
## 
## Information Criteria
## ------------------------------------
##                    
## Akaike       11.762
## Bayes        11.781
## Shibata      11.762
## Hannan-Quinn 11.769
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                       1133       0
## Lag[2*(p+q)+(p+q)-1][2]      1648       0
## Lag[4*(p+q)+(p+q)-1][5]      3062       0
## d.o.f=0
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic   p-value
## Lag[1]                      21.77 3.070e-06
## Lag[2*(p+q)+(p+q)-1][5]     22.52 3.898e-06
## Lag[4*(p+q)+(p+q)-1][9]     28.72 9.773e-07
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]  0.001665 0.500 2.000  0.9675
## ARCH Lag[5]  0.633910 1.440 1.667  0.8435
## ARCH Lag[7]  6.304484 2.315 1.543  0.1220
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  4.6695
## Individual Statistics:             
## mu     2.6985
## omega  0.3900
## alpha1 0.7609
## beta1  0.3443
## gamma1 0.2760
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          1.28 1.47 1.88
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                     t-value   prob sig
## Sign Bias          0.008212 0.9934    
## Negative Sign Bias 0.260371 0.7946    
## Positive Sign Bias 0.491363 0.6232    
## Joint Effect       0.329763 0.9543    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20      4310            0
## 2    30      4714            0
## 3    40      6374            0
## 4    50      5591            0
## 
## 
## Elapsed time : 1.096115
# Phân phối Student (std)
vnst.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)), mean.model = list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "std")

vnst<- ugarchfit(vnst.spec,VNts) 
print(vnst)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(1,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : std 
## 
## Optimal Parameters
## ------------------------------------
##          Estimate  Std. Error  t value Pr(>|t|)
## mu     1.2210e+03    2.769989 440.7966 0.000000
## ar1    6.0808e-02    0.018050   3.3688 0.000755
## ar2    9.4431e-01    0.018061  52.2844 0.000000
## ma1    1.0132e+00    0.003605 281.0598 0.000000
## ma2    7.5935e-02    0.017240   4.4045 0.000011
## omega  4.4139e+00    1.832829   2.4082 0.016030
## alpha1 5.1430e-02    0.021734   2.3663 0.017965
## beta1  8.3257e-01    0.033087  25.1630 0.000000
## gamma1 2.3000e-01    0.048538   4.7385 0.000002
## shape  5.1130e+00    0.744753   6.8654 0.000000
## 
## Robust Standard Errors:
##          Estimate  Std. Error  t value Pr(>|t|)
## mu     1.2210e+03    1.398784 872.9023 0.000000
## ar1    6.0808e-02    0.007261   8.3742 0.000000
## ar2    9.4431e-01    0.007421 127.2511 0.000000
## ma1    1.0132e+00    0.011060  91.6120 0.000000
## ma2    7.5935e-02    0.009198   8.2555 0.000000
## omega  4.4139e+00    1.995575   2.2118 0.026979
## alpha1 5.1430e-02    0.021463   2.3962 0.016566
## beta1  8.3257e-01    0.038499  21.6258 0.000000
## gamma1 2.3000e-01    0.054470   4.2225 0.000024
## shape  5.1130e+00    0.655481   7.8004 0.000000
## 
## LogLikelihood : -5258.488 
## 
## Information Criteria
## ------------------------------------
##                    
## Akaike       7.7478
## Bayes        7.7861
## Shibata      7.7477
## Hannan-Quinn 7.7621
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.3725  0.5417
## Lag[2*(p+q)+(p+q)-1][11]    2.8964  1.0000
## Lag[4*(p+q)+(p+q)-1][19]    4.3369  0.9986
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                      1.015  0.3138
## Lag[2*(p+q)+(p+q)-1][5]     3.928  0.2632
## Lag[4*(p+q)+(p+q)-1][9]     6.098  0.2871
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]    0.1408 0.500 2.000  0.7074
## ARCH Lag[5]    1.5852 1.440 1.667  0.5702
## ARCH Lag[7]    3.4625 2.315 1.543  0.4307
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  2.1508
## Individual Statistics:             
## mu     0.0049
## ar1    0.1587
## ar2    0.1409
## ma1    0.3647
## ma2    0.3551
## omega  0.1569
## alpha1 0.3433
## beta1  0.2609
## gamma1 0.2300
## shape  0.1825
## 
## 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.2788 0.78046    
## Negative Sign Bias  2.2601 0.02397  **
## Positive Sign Bias  0.2622 0.79323    
## Joint Effect        7.2302 0.06491   *
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     38.85     0.004615
## 2    30     50.26     0.008456
## 3    40     58.65     0.022444
## 4    50     69.34     0.029430
## 
## 
## Elapsed time : 2.882457
# Phân phối Student đối xứng (sstd)
vnsst.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)), mean.model = list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "sstd")

vnsst<- ugarchfit(vnsst.spec,VNts) 
print(vnsst)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(1,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : sstd 
## 
## Convergence Problem:
## Solver Message:
# Phân phối Generalized Error Distribution(ged)
vnged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)), mean.model = list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "ged")

vnged <- ugarchfit(vnged.spec,VNts) 
print(vnged)
## 
## *---------------------------------*
## *          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     1217.270778    1.967152    618.7984 0.000000
## ar1       1.969013    0.000105  18730.9286 0.000000
## ar2      -0.968941    0.000044 -22059.3201 0.000000
## ma1      -0.913624    0.000915   -997.9893 0.000000
## ma2      -0.048288    0.001382    -34.9294 0.000000
## omega     3.891791    1.614855      2.4100 0.015953
## alpha1    0.050332    0.004696     10.7178 0.000000
## beta1     0.836148    0.029879     27.9847 0.000000
## gamma1    0.225041    0.039583      5.6853 0.000000
## shape     1.187773    0.063801     18.6167 0.000000
## 
## Robust Standard Errors:
##           Estimate  Std. Error     t value Pr(>|t|)
## mu     1217.270778    1.025936  1186.49831 0.000000
## ar1       1.969013    0.000366  5386.15548 0.000000
## ar2      -0.968941    0.000629 -1541.12079 0.000000
## ma1      -0.913624    0.001255  -727.71839 0.000000
## ma2      -0.048288    0.004248   -11.36641 0.000000
## omega     3.891791    1.763926     2.20632 0.027361
## alpha1    0.050332    0.128311     0.39226 0.694864
## beta1     0.836148    0.066069    12.65570 0.000000
## gamma1    0.225041    0.153583     1.46528 0.142845
## shape     1.187773    0.061812    19.21588 0.000000
## 
## LogLikelihood : -5241.864 
## 
## Information Criteria
## ------------------------------------
##                    
## Akaike       7.7233
## Bayes        7.7617
## Shibata      7.7232
## Hannan-Quinn 7.7377
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                     0.01878  0.8910
## Lag[2*(p+q)+(p+q)-1][11]   3.88166  1.0000
## Lag[4*(p+q)+(p+q)-1][19]   5.60784  0.9834
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                     0.7739  0.3790
## Lag[2*(p+q)+(p+q)-1][5]    3.0179  0.4038
## Lag[4*(p+q)+(p+q)-1][9]    5.3138  0.3848
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]   0.02288 0.500 2.000  0.8798
## ARCH Lag[5]   1.45249 1.440 1.667  0.6049
## ARCH Lag[7]   3.60439 2.315 1.543  0.4072
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  1.5586
## Individual Statistics:               
## mu     0.001262
## ar1    0.196611
## ar2    0.196371
## ma1    0.225795
## ma2    0.227246
## omega  0.182810
## alpha1 0.297877
## beta1  0.287413
## gamma1 0.306785
## shape  0.220637
## 
## 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.05323 0.95756    
## Negative Sign Bias 2.00413 0.04525  **
## Positive Sign Bias 0.20633 0.83656    
## Joint Effect       6.84252 0.07709   *
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     26.74       0.1110
## 2    30     38.93       0.1031
## 3    40     46.53       0.1901
## 4    50     55.59       0.2406
## 
## 
## Elapsed time : 3.811958
# Phân phối Generalized Error Distribution đối xứng ("sged")
vnsged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)), mean.model = list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "sged")

vnsged <- ugarchfit(vnsged.spec,VNts) 
print(vnsged)
## 
## *---------------------------------*
## *          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     1218.223524    1.917132    635.4407 0.000000
## ar1       1.972652    0.000097  20297.4328 0.000000
## ar2      -0.972635    0.000038 -25497.5874 0.000000
## ma1      -0.911554    0.001341   -679.9542 0.000000
## ma2      -0.054146    0.002069    -26.1696 0.000000
## omega     3.363148    1.234813      2.7236 0.006457
## alpha1    0.039476    0.005373      7.3467 0.000000
## beta1     0.859645    0.022844     37.6309 0.000000
## gamma1    0.188780    0.029860      6.3221 0.000000
## skew      1.095398    0.024789     44.1889 0.000000
## shape     1.192417    0.064066     18.6123 0.000000
## 
## Robust Standard Errors:
##           Estimate  Std. Error     t value Pr(>|t|)
## mu     1218.223524    1.045941  1164.71511 0.000000
## ar1       1.972652    0.000405  4876.01747 0.000000
## ar2      -0.972635    0.000627 -1550.39709 0.000000
## ma1      -0.911554    0.002408  -378.62554 0.000000
## ma2      -0.054146    0.006294    -8.60349 0.000000
## omega     3.363148    1.001853     3.35693 0.000788
## alpha1    0.039476    0.098942     0.39898 0.689908
## beta1     0.859645    0.040664    21.14019 0.000000
## gamma1    0.188780    0.138018     1.36779 0.171377
## skew      1.095398    0.042142    25.99291 0.000000
## shape     1.192417    0.063398    18.80846 0.000000
## 
## LogLikelihood : -5235.463 
## 
## Information Criteria
## ------------------------------------
##                    
## Akaike       7.7154
## Bayes        7.7576
## Shibata      7.7153
## Hannan-Quinn 7.7312
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.2413  0.6232
## Lag[2*(p+q)+(p+q)-1][11]    4.1394  0.9997
## Lag[4*(p+q)+(p+q)-1][19]    5.9724  0.9718
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                      2.621  0.1054
## Lag[2*(p+q)+(p+q)-1][5]     5.703  0.1056
## Lag[4*(p+q)+(p+q)-1][9]     7.697  0.1475
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]    0.2033 0.500 2.000  0.6521
## ARCH Lag[5]    1.2318 1.440 1.667  0.6656
## ARCH Lag[7]    3.0147 2.315 1.543  0.5108
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  2.3514
## Individual Statistics:               
## mu     0.001933
## ar1    0.106514
## ar2    0.107729
## ma1    0.179592
## ma2    0.177749
## omega  0.228607
## alpha1 0.495925
## beta1  0.397192
## gamma1 0.509875
## skew   0.109547
## shape  0.226181
## 
## 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.57560 0.564983    
## Negative Sign Bias  3.09526 0.002007 ***
## Positive Sign Bias  0.01883 0.984977    
## Joint Effect       11.65637 0.008658 ***
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     22.29      0.26986
## 2    30     47.22      0.01768
## 3    40     44.35      0.25619
## 4    50     60.07      0.13346
## 
## 
## Elapsed time : 24.01746
SGts <- ts(data$WTI)
print(SGts)
## Time Series:
## Start = 1 
## End = 1360 
## Frequency = 1 
##    [1]  9.71  9.72  9.68  9.58  9.57  9.50  9.55  9.48  9.44  9.37  9.47  9.57
##   [13]  9.57  9.39  9.34  9.32  9.28  9.28  9.32  9.36  9.40  9.61  9.55  9.58
##   [25]  9.56  9.58  9.58  9.46  9.55  9.54  9.62  9.66  9.70  9.62  9.59  9.60
##   [37]  9.50  9.49  9.50  9.37  9.38  9.28  9.25  9.30  9.29  9.24  9.41  9.37
##   [49]  9.32  9.30  9.24  9.23  9.46  9.52  9.46  9.46  9.49  9.55  9.49  9.54
##   [61]  9.59  9.57  9.57  9.57  9.60  9.57  9.66  9.56  9.51  9.53  9.52  9.48
##   [73]  9.54  9.52  9.42  9.51  9.53  9.58  9.43  9.36  9.40  9.34  9.24  9.16
##   [85]  9.13  9.08  8.93  8.83  8.77  8.81  8.91  8.71  8.68  8.71  8.63  8.81
##   [97]  8.95  8.99  9.00  8.94  8.77  8.66  8.66  8.71  8.79  8.87  8.80  8.85
##  [109]  8.92  8.89  8.97  8.99  9.10  9.18  9.14  9.19  9.16  9.15  9.16  9.16
##  [121]  9.21  9.14  9.14  9.22  9.33  9.31  9.22  9.21  9.11  9.09  9.09  9.13
##  [133]  9.08  8.97  9.05  8.90  8.91  8.80  8.87  8.95  8.93  8.95  8.99  8.98
##  [145]  9.05  8.93  8.90  8.98  8.93  9.05  9.08  9.13  9.12  9.21  9.15  9.08
##  [157]  9.24  9.15  9.13  9.16  9.05  9.14  9.16  9.12  9.17  9.14  9.11  9.20
##  [169]  9.39  9.25  9.08  9.16  9.11  9.09  8.83  8.61  8.49  8.46  8.44  8.45
##  [181]  8.45  8.57  8.42  8.42  8.45  8.49  8.35  8.20  8.33  8.47  8.51  8.53
##  [193]  8.60  8.73  9.16  9.27  9.30  9.42  9.46  9.49  9.52  9.41  9.46  9.35
##  [205]  9.40  9.44  9.47  9.50  9.56  9.55  9.53  9.52  9.60  9.55  9.65  9.73
##  [217]  9.65  9.57  9.47  9.45  9.45  9.45  9.49  9.45  9.50  9.64  9.69  9.72
##  [229]  9.77  9.91 10.01 10.00  9.94  9.89  9.89  9.80  9.85  9.85  9.85  9.90
##  [241]  9.93  9.89  9.96  9.91  9.90  9.86  9.69  9.68  9.80  9.77  9.78  9.85
##  [253]  9.80  9.78  9.78  9.73  9.66  9.64  9.60  9.49  9.46  9.42  9.47  9.40
##  [265]  9.46  9.54  9.64  9.55  9.47  9.40  9.39  9.47  9.50  9.49  9.49  9.73
##  [277]  9.64  9.58  9.67  9.72  9.73  9.73  9.70  9.73  9.75  9.72  9.53  9.84
##  [289]  9.85  9.80  9.76  9.80  9.92  9.87  9.67  9.74  9.66  9.67  9.50  9.39
##  [301]  9.43  9.53  9.62  9.81  9.81  9.79  9.73  9.74  9.76  9.85  9.90  9.90
##  [313]  9.94  9.92  9.86  9.99  9.98  9.90  9.92  9.98  9.98 10.04 10.10 10.02
##  [325]  9.99  9.97  9.89  9.82  9.79  9.84  9.82  9.81  9.78  9.80  9.73  9.68
##  [337]  9.63  9.43  9.47  9.54  9.45  9.35  9.40  9.42  9.50  9.47  9.48  9.39
##  [349]  9.34  9.43  9.37  9.51  9.51  9.59  9.62  9.65  9.79  9.82  9.74  9.75
##  [361]  9.89  9.88  9.88  9.86  9.34  9.46  9.55  9.40  9.51  9.56  9.57  9.57
##  [373]  9.54  9.63  9.69  9.65  9.64  9.60  9.65  9.62  9.51  9.49  9.33  9.30
##  [385]  9.33  9.36  9.38  9.30  9.21  9.19  9.18  9.12  9.10  9.22  9.35  9.37
##  [397]  9.39  9.39  9.44  9.45  9.38  9.47  9.39  9.29  9.07  9.01  8.93  9.23
##  [409]  9.18  9.25  9.29  9.33  9.35  9.39  9.41  9.49  9.47  9.52  9.53  9.51
##  [421]  9.53  9.55  9.60  9.55  9.59  9.76  9.82  9.68  9.66  9.71  9.73  9.66
##  [433]  9.64  9.54  9.63  9.65  9.55  9.62  9.60  9.75  9.61  9.47  9.53  9.53
##  [445]  9.57  9.51  9.80  9.81  9.98  9.91  9.98 10.10 10.04 10.07 10.00 10.05
##  [457] 10.04 10.08 10.05 10.06 10.05 10.03 10.23 10.17 10.12 10.23 10.27 10.04
##  [469]  9.90 10.09 10.11 10.21 10.26 10.24 10.29 10.76 10.77 10.84 10.62 10.82
##  [481] 10.81 10.90 11.00 11.04 11.00 11.33 12.05 11.93 11.90 11.88 11.94 11.81
##  [493] 11.76 11.90 11.80 11.79 11.60 11.39 11.37 11.27 11.30 11.40 11.22 11.16
##  [505] 11.07 11.11 11.18 11.08 11.08 11.09 11.18 10.96 11.13 11.11 11.07 11.14
##  [517] 11.02 11.01 11.00 10.88 10.89 10.98 10.71 10.55 10.43 10.47 10.50 10.44
##  [529] 10.37 10.39 10.34 10.38 10.33 10.39 10.54 10.37 10.43 10.38 10.29 10.23
##  [541] 10.30 10.10 10.11 10.06 10.04 10.26 10.35 10.21 10.24 10.43 10.54 10.55
##  [553] 10.60 10.58 10.60 10.53 10.47 10.59 10.35 10.26 10.30 10.16  9.96 10.04
##  [565] 10.03  9.96  9.93  9.99  9.96  9.97  9.95  9.96  9.91  9.93  9.88  9.93
##  [577]  9.90  9.94  9.97  9.96 10.00 10.08 10.10 10.15  9.99  9.92  9.99  9.95
##  [589]  9.95 10.03  9.93 10.00  9.99 10.07  9.88  9.95  9.92  9.83  9.91  9.95
##  [601]  9.86  9.84  9.82  9.85  9.90  9.92  9.92  9.90  9.84 10.05 10.03 10.05
##  [613] 10.09 10.24 10.18 10.00  9.86  9.87  9.95 10.02  9.99 10.04 10.00  9.69
##  [625]  9.60  9.70  9.70  9.28  9.34  9.25  9.23  9.22  9.30  9.18  9.17  9.22
##  [637]  9.28  9.27  9.29  9.35  9.18  9.02  9.07  9.04  9.03  9.12  9.08  9.04
##  [649]  9.04  8.89  9.22  9.20  9.20  9.17  9.23  9.13  9.08  9.10  9.05  9.15
##  [661]  9.11  9.09  9.11  9.00  9.28  9.11  9.10  8.90  8.82  8.64  8.66  8.75
##  [673]  9.00  9.08  9.09  9.06  9.00  9.03  9.15  9.17  9.20  9.12  9.32  9.24
##  [685]  9.10  9.07  9.10  9.08  9.12  9.11  9.11  9.15  9.15  9.13  9.20  9.00
##  [697]  9.04  8.98  8.90  8.90  9.03  8.59  8.58  8.62  8.52  8.51  8.52  8.60
##  [709]  8.55  8.59  8.68  8.70  8.70  8.61  8.71  8.63  8.64  8.63  8.65  8.68
##  [721]  8.57  8.65  8.64  8.64  8.71  8.68  8.72  8.64  8.64  8.86  8.76  8.73
##  [733]  8.51  8.17  8.22  8.30  8.36  8.32  8.36  8.25  8.44  8.38  8.37  8.29
##  [745]  8.32  8.25  8.28  8.35  8.26  8.21  8.31  8.22  8.18  8.19  8.34  8.06
##  [757]  8.21  8.04  8.10  8.00  8.12  8.29  8.16  8.17  8.22  8.16  8.25  8.29
##  [769]  8.37  8.35  8.39  8.45  8.40  8.28  8.28  8.42  8.28  8.15  8.75  9.90
##  [781]  9.83  9.88  9.90  9.95  9.91  9.85  9.84  9.89  9.93  9.92  9.81  9.76
##  [793]  9.50  9.52  9.65  9.75  9.73  9.77  9.64 10.16 10.39 10.06  9.94  9.83
##  [805]  9.76  9.71  9.67  9.84  9.70  9.79  9.58  9.33  9.09  9.13  9.19  8.92
##  [817]  9.04  9.00  8.95  8.59  8.12  8.67  8.06  8.35  8.18  8.08  8.47  8.69
##  [829]  8.85  9.19  8.64  8.91  9.04  9.05  8.70  8.68  8.49  8.96  8.86  8.98
##  [841]  8.93  9.05  9.26  9.38  9.15  9.34  9.22  9.15  9.20  9.05  8.79  8.76
##  [853]  8.77  8.64  8.68  8.59  8.70  8.70  8.78  8.71  8.79  8.76  8.78  8.72
##  [865]  8.73  8.73  8.79  8.80  8.58  8.67  8.61  8.66  8.86  8.86  8.90  8.96
##  [877]  9.04  8.99  9.02  9.05  9.04  8.95  8.98  8.95  9.03  9.15  8.97  8.86
##  [889]  8.99  9.00  8.92  8.89  8.88  8.93  8.85  8.85  8.86  8.64  8.94  8.97
##  [901]  8.83  8.90  8.86  8.86  8.85  8.84  8.86  8.91  8.90  9.16  9.10  9.03
##  [913]  8.97  8.92  9.00  8.94  8.98  9.06  8.85  8.28  8.25  8.32  8.18  8.22
##  [925]  8.22  8.26  8.30  8.35  8.40  8.22  8.37  8.40  8.43  8.34  8.41  8.38
##  [937]  8.50  8.47  8.49  8.43  8.37  8.47  8.29  8.40  8.50  8.48  8.47  8.53
##  [949]  8.54  8.47  8.61  8.47  8.54  8.45  8.50  8.35  8.28  8.20  8.20  8.18
##  [961]  8.18  8.23  8.26  8.25  8.30  8.25  8.17  8.18  8.25  8.30  8.21  8.11
##  [973]  8.02  7.90  7.89  7.98  7.78  7.92  7.95  7.98  8.02  8.04  8.03  8.00
##  [985]  7.96  7.99  7.95  8.02  8.00  7.98  7.99  7.97  7.93  7.95  7.95  7.94
##  [997]  7.96  7.94  7.85  7.88  7.92  7.95  7.87  7.85  7.88  7.95  7.79  7.76
## [1009]  7.58  7.55  7.54  7.50  7.46  7.51  7.50  7.49  7.44  7.39  7.37  7.38
## [1021]  7.45  7.47  7.42  7.62  7.62  7.46  7.51  7.47  7.41  7.40  7.36  7.33
## [1033]  7.38  7.38  7.38  7.40  7.36  7.24  7.40  7.42  7.40  7.26  7.28  7.25
## [1045]  7.28  7.33  7.26  7.25  7.30  7.39  7.37  7.38  7.44  7.39  7.44  7.42
## [1057]  7.40  7.31  7.32  7.31  7.30  7.29  7.26  7.29  7.32  7.41  7.33  7.35
## [1069]  7.31  7.33  7.31  7.26  7.35  7.47  7.76  7.92  8.02  8.00  8.00  7.89
## [1081]  7.84  7.85  7.82  7.90  7.87  7.82  7.86  7.77  7.79  7.79  7.72  7.68
## [1093]  7.58  7.58  7.59  7.64  7.65  7.62  7.60  7.57  7.50  7.41  7.43  7.44
## [1105]  7.42  7.45  7.42  7.30  7.26  7.29  7.33  7.33  7.27  7.26  7.19  7.15
## [1117]  7.17  7.15  7.12  7.11  7.06  7.13  7.15  7.09  7.13  7.10  7.24  7.16
## [1129]  7.19  7.15  7.08  7.03  7.15  7.18  7.30  7.30  7.36  7.32  7.28  7.26
## [1141]  7.23  7.24  7.18  7.14  7.21  7.15  7.25  7.26  7.13  7.22  7.19  7.22
## [1153]  7.19  7.26  7.18  7.08  7.18  6.98  6.84  6.73  6.85  6.95  6.96  7.06
## [1165]  7.05  7.08  6.93  6.95  6.87  6.83  6.86  6.90  6.86  7.01  7.08  7.24
## [1177]  7.27  7.32  7.35  7.33  7.34  7.37  7.32  7.35  7.48  7.43  7.46  7.30
## [1189]  7.31  7.27  7.27  7.32  7.29  7.28  7.29  7.30  7.33  7.36  7.38  7.40
## [1201]  7.41  7.41  7.43  7.40  7.38  7.35  7.39  7.36  7.36  7.41  7.34  7.43
## [1213]  7.36  7.32  7.38  7.43  7.42  7.38  7.36  7.38  7.43  7.44  7.41  7.57
## [1225]  7.58  7.52  7.50  7.48  7.49  7.48  7.48  7.45  7.44  7.49  7.44  7.39
## [1237]  7.34  7.30  7.05  7.12  7.12  7.16  7.14  7.17  7.08  7.16  7.13  7.10
## [1249]  7.17  7.25  7.19  7.15  7.19  7.21  7.24  7.25  7.25  7.25  7.26  7.28
## [1261]  7.28  7.26  7.23  7.24  7.25  7.37  7.39  7.51  7.39  7.48  7.64  7.65
## [1273]  7.66  7.61  7.67  7.69  7.71  7.67  7.72  7.66  7.66  7.61  7.73  7.70
## [1285]  7.70  7.63  7.69  7.70  7.56  7.59  7.53  7.44  7.44  7.46  7.37  7.44
## [1297]  7.36  7.28  7.31  7.26  7.13  7.33  7.34  7.37  7.34  7.41  7.38  7.37
## [1309]  7.47  7.50  7.49  7.46  7.50  7.54  7.62  7.56  7.58  7.50  7.47  7.44
## [1321]  7.48  7.47  7.48  7.54  7.55  7.65  7.61  7.53  7.48  7.59  7.30  7.31
## [1333]  7.89  8.01  8.01  7.88  8.04  8.16  8.23  8.20  8.20  8.28  8.23  8.17
## [1345]  8.49  8.35  7.98  7.86  7.78  7.57  7.57  7.55  7.56  7.63  7.62  7.59
## [1357]  7.57  7.57  7.50  7.47
# Ước lượng mô hình GARCH(1,1) theo phân phối chuẩn
SGspec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)), mean.model = list(armaOrder = c(0, 0)))
SGfit <- ugarchfit(SGspec, VNts)
print(SGfit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(1,1)
## Mean Model   : ARFIMA(0,0,0)
## Distribution : norm 
## 
## Optimal Parameters
## ------------------------------------
##          Estimate  Std. Error   t value Pr(>|t|)
## mu     980.474064    1.850202 529.92813 0.000000
## omega   54.411797   14.101991   3.85845 0.000114
## alpha1   0.876518    0.084797  10.33667 0.000000
## beta1    0.126729    0.071712   1.76720 0.077195
## gamma1  -0.008495    0.077363  -0.10981 0.912563
## 
## Robust Standard Errors:
##          Estimate  Std. Error  t value Pr(>|t|)
## mu     980.474064   10.432802 93.97993 0.000000
## omega   54.411797   29.314175  1.85616 0.063431
## alpha1   0.876518    0.084994 10.31273 0.000000
## beta1    0.126729    0.094421  1.34217 0.179539
## gamma1  -0.008495    0.038935 -0.21819 0.827284
## 
## LogLikelihood : -7993.338 
## 
## Information Criteria
## ------------------------------------
##                    
## Akaike       11.762
## Bayes        11.781
## Shibata      11.762
## Hannan-Quinn 11.769
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                       1133       0
## Lag[2*(p+q)+(p+q)-1][2]      1648       0
## Lag[4*(p+q)+(p+q)-1][5]      3062       0
## d.o.f=0
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic   p-value
## Lag[1]                      21.77 3.070e-06
## Lag[2*(p+q)+(p+q)-1][5]     22.52 3.898e-06
## Lag[4*(p+q)+(p+q)-1][9]     28.72 9.773e-07
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]  0.001665 0.500 2.000  0.9675
## ARCH Lag[5]  0.633910 1.440 1.667  0.8435
## ARCH Lag[7]  6.304484 2.315 1.543  0.1220
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  4.6695
## Individual Statistics:             
## mu     2.6985
## omega  0.3900
## alpha1 0.7609
## beta1  0.3443
## gamma1 0.2760
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          1.28 1.47 1.88
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                     t-value   prob sig
## Sign Bias          0.008212 0.9934    
## Negative Sign Bias 0.260371 0.7946    
## Positive Sign Bias 0.491363 0.6232    
## Joint Effect       0.329763 0.9543    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20      4310            0
## 2    30      4714            0
## 3    40      6374            0
## 4    50      5591            0
## 
## 
## Elapsed time : 0.6835511
# Phân phối Student (std)
sgst.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)), mean.model = list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "std")

sgst<- ugarchfit(sgst.spec,VNts) 
print(sgst)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(1,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : std 
## 
## Optimal Parameters
## ------------------------------------
##          Estimate  Std. Error  t value Pr(>|t|)
## mu     1.2210e+03    2.769989 440.7966 0.000000
## ar1    6.0808e-02    0.018050   3.3688 0.000755
## ar2    9.4431e-01    0.018061  52.2844 0.000000
## ma1    1.0132e+00    0.003605 281.0598 0.000000
## ma2    7.5935e-02    0.017240   4.4045 0.000011
## omega  4.4139e+00    1.832829   2.4082 0.016030
## alpha1 5.1430e-02    0.021734   2.3663 0.017965
## beta1  8.3257e-01    0.033087  25.1630 0.000000
## gamma1 2.3000e-01    0.048538   4.7385 0.000002
## shape  5.1130e+00    0.744753   6.8654 0.000000
## 
## Robust Standard Errors:
##          Estimate  Std. Error  t value Pr(>|t|)
## mu     1.2210e+03    1.398784 872.9023 0.000000
## ar1    6.0808e-02    0.007261   8.3742 0.000000
## ar2    9.4431e-01    0.007421 127.2511 0.000000
## ma1    1.0132e+00    0.011060  91.6120 0.000000
## ma2    7.5935e-02    0.009198   8.2555 0.000000
## omega  4.4139e+00    1.995575   2.2118 0.026979
## alpha1 5.1430e-02    0.021463   2.3962 0.016566
## beta1  8.3257e-01    0.038499  21.6258 0.000000
## gamma1 2.3000e-01    0.054470   4.2225 0.000024
## shape  5.1130e+00    0.655481   7.8004 0.000000
## 
## LogLikelihood : -5258.488 
## 
## Information Criteria
## ------------------------------------
##                    
## Akaike       7.7478
## Bayes        7.7861
## Shibata      7.7477
## Hannan-Quinn 7.7621
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.3725  0.5417
## Lag[2*(p+q)+(p+q)-1][11]    2.8964  1.0000
## Lag[4*(p+q)+(p+q)-1][19]    4.3369  0.9986
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                      1.015  0.3138
## Lag[2*(p+q)+(p+q)-1][5]     3.928  0.2632
## Lag[4*(p+q)+(p+q)-1][9]     6.098  0.2871
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]    0.1408 0.500 2.000  0.7074
## ARCH Lag[5]    1.5852 1.440 1.667  0.5702
## ARCH Lag[7]    3.4625 2.315 1.543  0.4307
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  2.1508
## Individual Statistics:             
## mu     0.0049
## ar1    0.1587
## ar2    0.1409
## ma1    0.3647
## ma2    0.3551
## omega  0.1569
## alpha1 0.3433
## beta1  0.2609
## gamma1 0.2300
## shape  0.1825
## 
## 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.2788 0.78046    
## Negative Sign Bias  2.2601 0.02397  **
## Positive Sign Bias  0.2622 0.79323    
## Joint Effect        7.2302 0.06491   *
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     38.85     0.004615
## 2    30     50.26     0.008456
## 3    40     58.65     0.022444
## 4    50     69.34     0.029430
## 
## 
## Elapsed time : 2.797715
# Phân phối Student đối xứng (sstd)
sgsst.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)), mean.model = list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "sstd")

sgsst<- ugarchfit(sgsst.spec,VNts) 
print(sgsst)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(1,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : sstd 
## 
## Convergence Problem:
## Solver Message:
# Phân phối Generalized Error Distribution(ged)
sgged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)), mean.model = list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "ged")

sgged <- ugarchfit(sgged.spec,VNts) 
print(sgged)
## 
## *---------------------------------*
## *          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     1217.270778    1.967152    618.7984 0.000000
## ar1       1.969013    0.000105  18730.9286 0.000000
## ar2      -0.968941    0.000044 -22059.3201 0.000000
## ma1      -0.913624    0.000915   -997.9893 0.000000
## ma2      -0.048288    0.001382    -34.9294 0.000000
## omega     3.891791    1.614855      2.4100 0.015953
## alpha1    0.050332    0.004696     10.7178 0.000000
## beta1     0.836148    0.029879     27.9847 0.000000
## gamma1    0.225041    0.039583      5.6853 0.000000
## shape     1.187773    0.063801     18.6167 0.000000
## 
## Robust Standard Errors:
##           Estimate  Std. Error     t value Pr(>|t|)
## mu     1217.270778    1.025936  1186.49831 0.000000
## ar1       1.969013    0.000366  5386.15548 0.000000
## ar2      -0.968941    0.000629 -1541.12079 0.000000
## ma1      -0.913624    0.001255  -727.71839 0.000000
## ma2      -0.048288    0.004248   -11.36641 0.000000
## omega     3.891791    1.763926     2.20632 0.027361
## alpha1    0.050332    0.128311     0.39226 0.694864
## beta1     0.836148    0.066069    12.65570 0.000000
## gamma1    0.225041    0.153583     1.46528 0.142845
## shape     1.187773    0.061812    19.21588 0.000000
## 
## LogLikelihood : -5241.864 
## 
## Information Criteria
## ------------------------------------
##                    
## Akaike       7.7233
## Bayes        7.7617
## Shibata      7.7232
## Hannan-Quinn 7.7377
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                     0.01878  0.8910
## Lag[2*(p+q)+(p+q)-1][11]   3.88166  1.0000
## Lag[4*(p+q)+(p+q)-1][19]   5.60784  0.9834
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                     0.7739  0.3790
## Lag[2*(p+q)+(p+q)-1][5]    3.0179  0.4038
## Lag[4*(p+q)+(p+q)-1][9]    5.3138  0.3848
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]   0.02288 0.500 2.000  0.8798
## ARCH Lag[5]   1.45249 1.440 1.667  0.6049
## ARCH Lag[7]   3.60439 2.315 1.543  0.4072
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  1.5586
## Individual Statistics:               
## mu     0.001262
## ar1    0.196611
## ar2    0.196371
## ma1    0.225795
## ma2    0.227246
## omega  0.182810
## alpha1 0.297877
## beta1  0.287413
## gamma1 0.306785
## shape  0.220637
## 
## 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.05323 0.95756    
## Negative Sign Bias 2.00413 0.04525  **
## Positive Sign Bias 0.20633 0.83656    
## Joint Effect       6.84252 0.07709   *
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     26.74       0.1110
## 2    30     38.93       0.1031
## 3    40     46.53       0.1901
## 4    50     55.59       0.2406
## 
## 
## Elapsed time : 3.530612
# Phân phối Generalized Error Distribution đối xứng ("sged")
sgsged.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)), mean.model = list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "sged")

sgsged <- ugarchfit(sgsged.spec,VNts) 
print(sgsged)
## 
## *---------------------------------*
## *          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     1218.223524    1.917132    635.4407 0.000000
## ar1       1.972652    0.000097  20297.4328 0.000000
## ar2      -0.972635    0.000038 -25497.5874 0.000000
## ma1      -0.911554    0.001341   -679.9542 0.000000
## ma2      -0.054146    0.002069    -26.1696 0.000000
## omega     3.363148    1.234813      2.7236 0.006457
## alpha1    0.039476    0.005373      7.3467 0.000000
## beta1     0.859645    0.022844     37.6309 0.000000
## gamma1    0.188780    0.029860      6.3221 0.000000
## skew      1.095398    0.024789     44.1889 0.000000
## shape     1.192417    0.064066     18.6123 0.000000
## 
## Robust Standard Errors:
##           Estimate  Std. Error     t value Pr(>|t|)
## mu     1218.223524    1.045941  1164.71511 0.000000
## ar1       1.972652    0.000405  4876.01747 0.000000
## ar2      -0.972635    0.000627 -1550.39709 0.000000
## ma1      -0.911554    0.002408  -378.62554 0.000000
## ma2      -0.054146    0.006294    -8.60349 0.000000
## omega     3.363148    1.001853     3.35693 0.000788
## alpha1    0.039476    0.098942     0.39898 0.689908
## beta1     0.859645    0.040664    21.14019 0.000000
## gamma1    0.188780    0.138018     1.36779 0.171377
## skew      1.095398    0.042142    25.99291 0.000000
## shape     1.192417    0.063398    18.80846 0.000000
## 
## LogLikelihood : -5235.463 
## 
## Information Criteria
## ------------------------------------
##                    
## Akaike       7.7154
## Bayes        7.7576
## Shibata      7.7153
## Hannan-Quinn 7.7312
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.2413  0.6232
## Lag[2*(p+q)+(p+q)-1][11]    4.1394  0.9997
## Lag[4*(p+q)+(p+q)-1][19]    5.9724  0.9718
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                      2.621  0.1054
## Lag[2*(p+q)+(p+q)-1][5]     5.703  0.1056
## Lag[4*(p+q)+(p+q)-1][9]     7.697  0.1475
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]    0.2033 0.500 2.000  0.6521
## ARCH Lag[5]    1.2318 1.440 1.667  0.6656
## ARCH Lag[7]    3.0147 2.315 1.543  0.5108
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  2.3514
## Individual Statistics:               
## mu     0.001933
## ar1    0.106514
## ar2    0.107729
## ma1    0.179592
## ma2    0.177749
## omega  0.228607
## alpha1 0.495925
## beta1  0.397192
## gamma1 0.509875
## skew   0.109547
## shape  0.226181
## 
## 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.57560 0.564983    
## Negative Sign Bias  3.09526 0.002007 ***
## Positive Sign Bias  0.01883 0.984977    
## Joint Effect       11.65637 0.008658 ***
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     22.29      0.26986
## 2    30     47.22      0.01768
## 3    40     44.35      0.25619
## 4    50     60.07      0.13346
## 
## 
## Elapsed time : 23.63035