CẤU TRÚC PHỤ THUỘC GIỮA CHỈ SỐ THỊ TRƯỜNG CHỨNG KHOÁN VIỆT NAM ĐẾN TỶ GIÁ VÀNG XAU/USD: TIẾP CẬN BẰNG PHƯƠNG PHÁP COPULA

Các họ hàm cơ bản của Copula

Copula họ Elip

library(moments)
library(kableExtra)
## Warning: package 'kableExtra' was built under R version 4.3.3
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following object is masked from 'package:kableExtra':
## 
##     group_rows
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(knitr)
## Warning: package 'knitr' was built under R version 4.3.3
library(copula)
## Warning: package 'copula' was built under R version 4.3.3
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.3.3
library(plotly)
## Warning: package 'plotly' was built under R version 4.3.3
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
library(gridExtra)
## Warning: package 'gridExtra' was built under R version 4.3.3
## 
## Attaching package: 'gridExtra'
## The following object is masked from 'package:dplyr':
## 
##     combine
library(VC2copula)
## Warning: package 'VC2copula' was built under R version 4.3.3
library(VineCopula)
## Warning: package 'VineCopula' was built under R version 4.3.3
## 
## Attaching package: 'VineCopula'
## The following objects are masked from 'package:VC2copula':
## 
##     BB1Copula, BB6Copula, BB7Copula, BB8Copula, copulaFromFamilyIndex,
##     joeBiCopula, r270BB1Copula, r270BB6Copula, r270BB7Copula,
##     r270BB8Copula, r270ClaytonCopula, r270GumbelCopula,
##     r270JoeBiCopula, r270TawnT1Copula, r270TawnT2Copula, r90BB1Copula,
##     r90BB6Copula, r90BB7Copula, r90BB8Copula, r90ClaytonCopula,
##     r90GumbelCopula, r90JoeBiCopula, r90TawnT1Copula, r90TawnT2Copula,
##     surBB1Copula, surBB6Copula, surBB7Copula, surBB8Copula,
##     surClaytonCopula, surGumbelCopula, surJoeBiCopula, surTawnT1Copula,
##     surTawnT2Copula, tawnT1Copula, tawnT2Copula, vineCopula
## The following object is masked from 'package:copula':
## 
##     pobs
library(gridGraphics)
## Warning: package 'gridGraphics' was built under R version 4.3.3
## Loading required package: grid
library(png)
library(quantmod)
## Warning: package 'quantmod' was built under R version 4.3.3
## Loading required package: xts
## Warning: package 'xts' was built under R version 4.3.3
## Loading required package: zoo
## Warning: package 'zoo' was built under R version 4.3.3
## 
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric
## 
## ######################### Warning from 'xts' package ##########################
## #                                                                             #
## # The dplyr lag() function breaks how base R's lag() function is supposed to  #
## # work, which breaks lag(my_xts). Calls to lag(my_xts) that you type or       #
## # source() into this session won't work correctly.                            #
## #                                                                             #
## # Use stats::lag() to make sure you're not using dplyr::lag(), or you can add #
## # conflictRules('dplyr', exclude = 'lag') to your .Rprofile to stop           #
## # dplyr from breaking base R's lag() function.                                #
## #                                                                             #
## # Code in packages is not affected. It's protected by R's namespace mechanism #
## # Set `options(xts.warn_dplyr_breaks_lag = FALSE)` to suppress this warning.  #
## #                                                                             #
## ###############################################################################
## 
## Attaching package: 'xts'
## The following objects are masked from 'package:dplyr':
## 
##     first, last
## Loading required package: TTR
## Warning: package 'TTR' was built under R version 4.3.3
## Registered S3 method overwritten by 'quantmod':
##   method            from
##   as.zoo.data.frame zoo
library(PerformanceAnalytics)
## Warning: package 'PerformanceAnalytics' was built under R version 4.3.3
## 
## Attaching package: 'PerformanceAnalytics'
## The following objects are masked from 'package:moments':
## 
##     kurtosis, skewness
## The following object is masked from 'package:graphics':
## 
##     legend
library(tidyr)
library(tseries)
## Warning: package 'tseries' was built under R version 4.3.3
library(FinTS)
## Warning: package 'FinTS' was built under R version 4.3.3
library(ggcorrplot)
## Warning: package 'ggcorrplot' was built under R version 4.3.3
library(goftest)
library(VC2copula)
library(rugarch)
## Warning: package 'rugarch' was built under R version 4.3.3
## Loading required package: parallel
## 
## Attaching package: 'rugarch'
## The following object is masked from 'package:stats':
## 
##     sigma
scatter_plot <- function(random_data, cl) {
  ggplot(data.frame(random_data), aes(random_data[,1], random_data[,2])) +
  geom_point(alpha = 0.5, col = cl) +
  theme_minimal() +
  labs(x = "u", y = "v")
  } 
persp_plot <- function(copula_obj, file_name, cl) {
  png(file_name)
  persp(copula_obj, dCopula, 
        xlab = 'u', ylab = 'v', col = cl, ltheta = 120,  
        ticktype = "detailed", cex.axis = 0.8)
  dev.off()
  rasterGrob(readPNG(file_name),interpolate = TRUE)
}
set.seed(123)
cop_nor <- normalCopula(param = 0.8, dim = 2)
random_nor <- rCopula(copula = cop_nor,n = 7600)
cop_std <- tCopula(param = 0.8, dim = 2, df = 1)
random_std <- rCopula(copula = cop_std,n = 7600)
#Vẽ biểu đồ 
png('nors.png') 
scatter_plot(random_nor, '#ADD8E6')
dev.off()
## png 
##   2
nors <- rasterGrob(readPNG('nors.png'), interpolate = TRUE) 
png('stds.png')
scatter_plot(random_std, '#F08080')
dev.off()
## png 
##   2
stds <- rasterGrob(readPNG('stds.png'), interpolate = TRUE)
nor_per <- persp_plot(cop_nor, 'norp.png', '#ADD8E6')
std_per <- persp_plot(cop_std, 'stdp.png', '#F08080')
legend <- legendGrob(
  labels = c("Gauss", "Student"), pch = 15,
  gp = gpar(col = c('#ADD8E6', '#F08080'), fill = c('#ADD8E6', '#F08080'))
)
grid.arrange(nors, nor_per, stds, std_per, legend, ncol = 3, 
  layout_matrix = rbind(c(1, 2, 5), c(3, 4, 5)),
  widths = c(2, 2, 1), 
  top = textGrob("Hình : Biểu đồ phân tán và phối cảnh PDF của Copula họ Elip", 
                 gp = gpar(fontsize = 15, font = 2))
             )

## Copula họ Archimedean

set.seed(123)
cop_clay <- claytonCopula(param = 4, dim = 2)
random_clay <- rCopula(copula = cop_clay,n = 7600)
cop_gum <- gumbelCopula(param = 5, dim = 2)
random_gum <- rCopula(copula = cop_gum,n = 7600)
png('clays.png')
scatter_plot(random_clay,'#90EE90')
dev.off()
## png 
##   2
clays <- rasterGrob(readPNG('clays.png'), interpolate = TRUE)
png('gums.png')
scatter_plot(random_gum,'#FFA07A')
dev.off()
## png 
##   2
gums <- rasterGrob(readPNG('gums.png'), interpolate = TRUE)
clayp <- persp_plot(cop_clay,'clayp.png','#90EE90')
gump <- persp_plot(cop_gum,'gump.png','#FFA07A')
legend <- legendGrob(
  labels = c("Clayton", "Gumbel"), pch = 15,
  gp = gpar(col = c('#90EE90', '#FFA07A'), fill = c('#90EE90', '#FFA07A'))
)
grid.arrange(clays, clayp, gums, gump, legend, ncol = 3, 
  layout_matrix = rbind(c(1, 2, 5), c(3, 4, 5)),
  widths = c(2, 2, 1), 
  top = textGrob("Hình : Biểu đồ phân tán và PDF của Copula Clayton và Gumbel", 
                 gp = gpar(fontsize = 15, font = 2))
             )

set.seed(123)
cop_surgum <- VC2copula::surGumbelCopula(param = 5)
random_surgum <- rCopula(copula = cop_surgum,n = 7600)
cop_surclay <- VC2copula::surClaytonCopula(param = 4)
random_surclay <- rCopula(copula = cop_surclay,n = 7600)
png('surclays.png')
scatter_plot(random_surclay,'#FFB6C1')
dev.off()
## png 
##   2
surclays <- rasterGrob(readPNG('surclays.png'), interpolate = TRUE)
png('surgums.png')
scatter_plot(random_surgum,'#E6E6FA')
dev.off()
## png 
##   2
surgums <- rasterGrob(readPNG('surgums.png'), interpolate = TRUE)
surclayp <- persp_plot(cop_surclay, "surclayp.png","#FFB6C1")
surgump <- persp_plot(cop_surgum, "surgump.png","#E6E6FA")
legend <- legendGrob(labels = c("Survival Clayton","Survival Gumbel"), pch = 15,
                    gp = gpar(col = c('#FFB6C1','#E6E6FA'), fill = c('#FFB6C1','#E6E6FA' )))
grid.arrange(surclays, surclayp,surgums, surgump, legend, ncol = 3,
             layout_matrix = rbind(c(1,2,5),c(3,4,5)),
             widths = c(2,2,1),
             top = textGrob("Hình : Biểu đồ phân tán và PDF của Copula Sur Clayton và Gumbel", 
                 gp = gpar(fontsize = 15, font = 2))
             )

set.seed(123)
cop_frank <- frankCopula(param = 9.2)
random_frank <- rCopula(copula = cop_frank,n = 7600)
cop_joe <- joeCopula(param = 3)
random_joe <- rCopula(copula = cop_joe,n = 7600)
png('franks.png')
scatter_plot(random_frank,'#FFFACD')
dev.off()
## png 
##   2
franks <- rasterGrob(readPNG('franks.png'), interpolate = TRUE)
png('joes.png')
scatter_plot(random_joe,'#FF6347')
dev.off()
## png 
##   2
joes <- rasterGrob(readPNG('joes.png'), interpolate = TRUE)
frankp <- persp_plot(cop_frank, "frankp.png","#FFFACD")
joep <- persp_plot(cop_joe, "joep.png","#FF6347")
legend <- legendGrob(labels = c("Franl","Joe"), pch = 15,
                    gp = gpar(col = c('#FFFACD','#FF6347'), fill = c('#FFFACD','#FF6347')))
grid.arrange(franks, frankp,joes, joep, legend, ncol = 3,
             layout_matrix = rbind(c(1,2,5),c(3,4,5)),
             widths = c(2,2,1),
             top = textGrob("Hình : Biểu đồ phân tán và  PDF của Copula Frank và Joe", 
                 gp = gpar(fontsize = 15, font = 2))
             )

set.seed(123)
cop_bb1 <- VC2copula::BB1Copula(param = c(2,1.7))
random_bb1 <- rCopula(copula = cop_bb1,n = 7600)
cop_bb6 <- VC2copula::BB6Copula(param = c(2,4.5))
random_bb6 <- rCopula(copula = cop_bb6,n = 7600)
png('bb1s.png')
scatter_plot(random_bb1,'#6A5ACD')
dev.off()
## png 
##   2
bb1s <- rasterGrob(readPNG('bb1s.png'), interpolate = TRUE)
png('bb6s.png')
scatter_plot(random_bb6,'#DC143C')
dev.off()
## png 
##   2
bb6s <- rasterGrob(readPNG('bb6s.png'), interpolate = TRUE)
bb1p <- persp_plot(cop_bb1, "bb1p.png","#6A5ACD")
bb6p <- persp_plot(cop_bb6, "bb6p.png","#DC143C")
legend <- legendGrob(labels = c("BB1","BB6"), pch = 15,
                    gp = gpar(col = c('#6A5ACD','#DC143C'), fill = c('#6A5ACD','#DC143C')))
grid.arrange(bb1s, bb1p,bb6s, bb6p, legend, ncol = 3,
             layout_matrix = rbind(c(1,2,5),c(3,4,5)),
             widths = c(2,2,1),
             top = textGrob("Hình: Biểu đồ phân tán và  PDF của Copula BB1 và BB6", 
                 gp = gpar(fontsize = 15, font = 2))
             )

set.seed(123)
cop_bb7 <- VC2copula::BB7Copula(param = c(2,4.5))
random_bb7 <- rCopula(copula = cop_bb7,n = 7600)
cop_bb8 <- VC2copula::BB8Copula(param = c(4,0.8))
random_bb8 <- rCopula(copula = cop_bb8,n = 7600)
png('bb7s.png')
scatter_plot(random_bb7,'#FFA07A')
dev.off()
## png 
##   2
bb7s <- rasterGrob(readPNG('bb7s.png'), interpolate = TRUE)
png('bb8s.png')
scatter_plot(random_bb8,'#C0C0C0')
dev.off()
## png 
##   2
bb8s <- rasterGrob(readPNG('bb8s.png'), interpolate = TRUE)
bb7p <- persp_plot(cop_bb7, "bb7p.png","#FFA07A")
bb8p <- persp_plot(cop_bb8, "bb8p.png","#C0C0C0")
legend <- legendGrob(labels = c("BB7","BB8"), pch = 15,
                    gp = gpar(col = c('#FFA07A','#C0C0C0'), fill = c('#FFA07A','#C0C0C0')))
grid.arrange(bb7s, bb7p,bb8s, bb8p, legend, ncol = 3,
             layout_matrix = rbind(c(1,2,5),c(3,4,5)),
             widths = c(2,2,1),
             top = textGrob("Hình: Biểu đồ phân tán và  PDF của Copula BB7 và BB8", 
                 gp = gpar(fontsize = 15, font = 2))
             )

Thống Kê Mô Tả dỮ LIỆU

library(lmtest)
## Warning: package 'lmtest' was built under R version 4.3.3
library(fGarch)
## Warning: package 'fGarch' was built under R version 4.3.3
## NOTE: Packages 'fBasics', 'timeDate', and 'timeSeries' are no longer
## attached to the search() path when 'fGarch' is attached.
## 
## If needed attach them yourself in your R script by e.g.,
##         require("timeSeries")
## 
## Attaching package: 'fGarch'
## The following objects are masked from 'package:PerformanceAnalytics':
## 
##     ES, VaR
## The following object is masked from 'package:TTR':
## 
##     volatility
library(rugarch)
library(tseries)
library(xlsx)
## Warning: package 'xlsx' was built under R version 4.3.3
library(quantmod)
library(PerformanceAnalytics)
library(ggplot2)
library(kableExtra)
library(tidyr)
data <- read.xlsx("D:/MHNN/datapractical5.xlsx", sheetIndex = 1, header = T)
data <- na.omit(data)
library(moments)
library(tidyverse)
## Warning: package 'tidyverse' was built under R version 4.3.3
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ forcats   1.0.0     ✔ readr     2.1.5
## ✔ lubridate 1.9.3     ✔ stringr   1.5.1
## ✔ purrr     1.0.2     ✔ tibble    3.2.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ gridExtra::combine()  masks dplyr::combine()
## ✖ plotly::filter()      masks dplyr::filter(), stats::filter()
## ✖ xts::first()          masks dplyr::first()
## ✖ dplyr::group_rows()   masks kableExtra::group_rows()
## ✖ lubridate::interval() masks copula::interval()
## ✖ dplyr::lag()          masks stats::lag()
## ✖ xts::last()           masks dplyr::last()
## ✖ purrr::reduce()       masks rugarch::reduce()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
datan <- as.data.frame(data)
rVNI <- datan %>% summarise(Min = min(VNI),
                      Max = max(VNI),
                      Mean = mean(VNI),
                      StDev = sd(VNI),
                      Skewness = skewness(VNI),
                      Kurtosis = kurtosis(VNI))
rXAU <- datan %>% summarise(Min = min(XAU.USD),
                      Max = max(XAU.USD),
                      Mean = mean(XAU.USD),
                      StDev = sd(XAU.USD),
                      Skewness = skewness(XAU.USD),
                      Kurtosis = kurtosis(XAU.USD))
print(rVNI)
##          Min        Max          Mean       StDev  Skewness Kurtosis
## 1 -0.0275133 0.04363962 -2.686766e-06 0.007796302 0.5756554   3.1855
print(rXAU)
##           Min        Max         Mean       StDev  Skewness Kurtosis
## 1 -0.02561258 0.01866097 0.0001347535 0.003920565 -0.330554 3.430407

Ma trận hệ số tương quan

library(PerformanceAnalytics)
library(Hmisc)
## Warning: package 'Hmisc' was built under R version 4.3.3
## 
## Attaching package: 'Hmisc'
## The following object is masked from 'package:quantmod':
## 
##     Lag
## The following object is masked from 'package:plotly':
## 
##     subplot
## The following objects are masked from 'package:dplyr':
## 
##     src, summarize
## The following objects are masked from 'package:base':
## 
##     format.pval, units
res <- cor(data[,2:3])
round(res, 2)
##           VNI XAU.USD
## VNI      1.00   -0.05
## XAU.USD -0.05    1.00
library(corrplot)
## Warning: package 'corrplot' was built under R version 4.3.3
## corrplot 0.92 loaded
corrplot(res, type = "upper", order = "hclust", 
         tl.col = "black", tl.srt = 45)

data2 <- data[,c(2,3)]
data1 <- data.frame(sapply(data2, as.numeric))
chart.Correlation(data1, histogram=TRUE, pch=19)
## Warning in par(usr): argument 1 does not name a graphical parameter

pearson <- cor(data$XAU.USD,data$VNI, method="pearson")
spearman <- cor(data$XAU.USD,data$VNI, method="spearman")
kendall <- cor(data$XAU.USD,data$VNI, method="kendall")
print(pearson)
## [1] -0.04830442
print(spearman)
## [1] -0.04166188
print(kendall)
## [1] -0.02801631
library(ggcorrplot)
Note <- cor(data2)
ggcorrplot(Note, hc.order = TRUE,
   outline.col = "pink",
   ggtheme = ggplot2::theme_gray,
   colors = c("#6D9EC1", "pink", "darkred"),
   lab = TRUE, lab_col = 'pink',title = ' Trực quan hóa hệ số tương quan với phương pháp Pearson')

Biển đồ chuỗi tỷ suất theo ngày

library(quantmod)
library(PerformanceAnalytics)
library(ggplot2)
library(kableExtra)
library(tidyr)
# Giả sử dữ liệu của bạn đã được load vào data1

# Tạo một dataframe mới để vẽ đồ thị ghép
data_plot <- data %>%
  pivot_longer(cols = c(VNI, XAU.USD), names_to = "VNI", values_to = "XAU.USD")

# Vẽ đồ thị ghép
ggplot(data_plot, aes(x = DATE, y = XAU.USD)) +
  geom_line() +
  facet_wrap(~ VNI, ncol = 2) +  # Tạo các subplot theo biến Index
  labs(title = "Biến động tỷ suất lợi nhuận của các chỉ số")

  theme_minimal()
## List of 136
##  $ line                            :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ lineend      : chr "butt"
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ rect                            :List of 5
##   ..$ fill         : chr "white"
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ text                            :List of 11
##   ..$ family       : chr ""
##   ..$ face         : chr "plain"
##   ..$ colour       : chr "black"
##   ..$ size         : num 11
##   ..$ hjust        : num 0.5
##   ..$ vjust        : num 0.5
##   ..$ angle        : num 0
##   ..$ lineheight   : num 0.9
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ title                           : NULL
##  $ aspect.ratio                    : NULL
##  $ axis.title                      : NULL
##  $ axis.title.x                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.75points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.top                :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.75points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.bottom             : NULL
##  $ axis.title.y                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num 90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.75points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.y.left               : NULL
##  $ axis.title.y.right              :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num -90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.75points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text                       :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : chr "grey30"
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.2points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.top                 :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.2points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.bottom              : NULL
##  $ axis.text.y                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 1
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.y.left                : NULL
##  $ axis.text.y.right               :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.theta                 : NULL
##  $ axis.text.r                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0.5
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.ticks                      : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ axis.ticks.x                    : NULL
##  $ axis.ticks.x.top                : NULL
##  $ axis.ticks.x.bottom             : NULL
##  $ axis.ticks.y                    : NULL
##  $ axis.ticks.y.left               : NULL
##  $ axis.ticks.y.right              : NULL
##  $ axis.ticks.theta                : NULL
##  $ axis.ticks.r                    : NULL
##  $ axis.minor.ticks.x.top          : NULL
##  $ axis.minor.ticks.x.bottom       : NULL
##  $ axis.minor.ticks.y.left         : NULL
##  $ axis.minor.ticks.y.right        : NULL
##  $ axis.minor.ticks.theta          : NULL
##  $ axis.minor.ticks.r              : NULL
##  $ axis.ticks.length               : 'simpleUnit' num 2.75points
##   ..- attr(*, "unit")= int 8
##  $ axis.ticks.length.x             : NULL
##  $ axis.ticks.length.x.top         : NULL
##  $ axis.ticks.length.x.bottom      : NULL
##  $ axis.ticks.length.y             : NULL
##  $ axis.ticks.length.y.left        : NULL
##  $ axis.ticks.length.y.right       : NULL
##  $ axis.ticks.length.theta         : NULL
##  $ axis.ticks.length.r             : NULL
##  $ axis.minor.ticks.length         : 'rel' num 0.75
##  $ axis.minor.ticks.length.x       : NULL
##  $ axis.minor.ticks.length.x.top   : NULL
##  $ axis.minor.ticks.length.x.bottom: NULL
##  $ axis.minor.ticks.length.y       : NULL
##  $ axis.minor.ticks.length.y.left  : NULL
##  $ axis.minor.ticks.length.y.right : NULL
##  $ axis.minor.ticks.length.theta   : NULL
##  $ axis.minor.ticks.length.r       : NULL
##  $ axis.line                       : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ axis.line.x                     : NULL
##  $ axis.line.x.top                 : NULL
##  $ axis.line.x.bottom              : NULL
##  $ axis.line.y                     : NULL
##  $ axis.line.y.left                : NULL
##  $ axis.line.y.right               : NULL
##  $ axis.line.theta                 : NULL
##  $ axis.line.r                     : NULL
##  $ legend.background               : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.margin                   : 'margin' num [1:4] 5.5points 5.5points 5.5points 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing                  : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing.x                : NULL
##  $ legend.spacing.y                : NULL
##  $ legend.key                      : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.key.size                 : 'simpleUnit' num 1.2lines
##   ..- attr(*, "unit")= int 3
##  $ legend.key.height               : NULL
##  $ legend.key.width                : NULL
##  $ legend.key.spacing              : 'simpleUnit' num 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.key.spacing.x            : NULL
##  $ legend.key.spacing.y            : NULL
##  $ legend.frame                    : NULL
##  $ legend.ticks                    : NULL
##  $ legend.ticks.length             : 'rel' num 0.2
##  $ legend.axis.line                : NULL
##  $ legend.text                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.text.position            : NULL
##  $ legend.title                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.title.position           : NULL
##  $ legend.position                 : chr "right"
##  $ legend.position.inside          : NULL
##  $ legend.direction                : NULL
##  $ legend.byrow                    : NULL
##  $ legend.justification            : chr "center"
##  $ legend.justification.top        : NULL
##  $ legend.justification.bottom     : NULL
##  $ legend.justification.left       : NULL
##  $ legend.justification.right      : NULL
##  $ legend.justification.inside     : NULL
##  $ legend.location                 : NULL
##  $ legend.box                      : NULL
##  $ legend.box.just                 : NULL
##  $ legend.box.margin               : 'margin' num [1:4] 0cm 0cm 0cm 0cm
##   ..- attr(*, "unit")= int 1
##  $ legend.box.background           : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.box.spacing              : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##   [list output truncated]
##  - attr(*, "class")= chr [1:2] "theme" "gg"
##  - attr(*, "complete")= logi TRUE
##  - attr(*, "validate")= logi TRUE

Kiểm định phân phối chuẩn: Jarque-Bera

library(tseries)
XAU.USD <- data$XAU.USD
VNI <- data$VNI
result1 <-  jarque.bera.test(XAU.USD)
result2 <- jarque.bera.test(VNI)
print(result1)
## 
##  Jarque Bera Test
## 
## data:  XAU.USD
## X-squared = 740.42, df = 2, p-value < 2.2e-16
print(result2)
## 
##  Jarque Bera Test
## 
## data:  VNI
## X-squared = 696.02, df = 2, p-value < 2.2e-16

Kiểm định tính dừng: Augmented Dickey–Fuller

result3 <- adf.test(XAU.USD)
## Warning in adf.test(XAU.USD): p-value smaller than printed p-value
result4 <- adf.test(VNI)
## Warning in adf.test(VNI): p-value smaller than printed p-value
print(result3)
## 
##  Augmented Dickey-Fuller Test
## 
## data:  XAU.USD
## Dickey-Fuller = -11.244, Lag order = 11, p-value = 0.01
## alternative hypothesis: stationary
print(result4)
## 
##  Augmented Dickey-Fuller Test
## 
## data:  VNI
## Dickey-Fuller = -17.899, Lag order = 11, p-value = 0.01
## alternative hypothesis: stationary

Kiểm định tương quan chuỗi: Ljung-Box

result7 <- autoarfima(data2[, 2],ar.max = 2, ma.max = 2, criterion = "AIC", method = "full")
print(result7)
## $fit
## 
## *----------------------------------*
## *          ARFIMA Model Fit        *
## *----------------------------------*
## Mean Model   : ARFIMA(2,0,2)
## Distribution : norm 
## 
## Optimal Parameters
## ------------------------------------
##        Estimate  Std. Error  t value Pr(>|t|)
## ar1    0.199441    0.044998   4.4322 0.000009
## ar2   -0.947042    0.010145 -93.3499 0.000000
## ma1   -0.197572    0.055853  -3.5373 0.000404
## ma2    0.918403    0.016753  54.8201 0.000000
## sigma  0.003906    0.000072  53.9629 0.000000
## 
## Robust Standard Errors:
##        Estimate  Std. Error  t value Pr(>|t|)
## ar1    0.199441    0.051500   3.8727 0.000108
## ar2   -0.947042    0.011725 -80.7692 0.000000
## ma1   -0.197572    0.065616  -3.0110 0.002604
## ma2    0.918403    0.006531 140.6121 0.000000
## sigma  0.003906    0.000180  21.7264 0.000000
## 
## LogLikelihood : 6007.8 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -8.2456
## Bayes        -8.2275
## Shibata      -8.2456
## Hannan-Quinn -8.2388
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.8933  0.3446
## Lag[2*(p+q)+(p+q)-1][11]    6.4316  0.2319
## Lag[4*(p+q)+(p+q)-1][19]   12.5557  0.1423
## 
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic   p-value
## Lag[1]                      6.745 9.401e-03
## Lag[2*(p+q)+(p+q)-1][2]    19.107 7.637e-06
## Lag[4*(p+q)+(p+q)-1][5]    41.793 1.421e-11
## 
## 
## ARCH LM Tests
## ------------------------------------
##              Statistic DoF   P-Value
## ARCH Lag[2]      29.74   2 3.487e-07
## ARCH Lag[5]      55.58   5 9.896e-11
## ARCH Lag[10]     89.74  10 5.995e-15
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  1.5734
## Individual Statistics:             
## ar1   0.07574
## ar2   0.19881
## ma1   0.08032
## ma2   0.26677
## sigma 1.00371
## 
## 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.2575748 
## 
## 
## $rank.matrix
##    ar1 ar2 ma1 ma2 im arf       AIC converged
## 1    1   1   1   1  0   0 -8.245605         1
## 2    0   0   0   0  1   0 -8.243102         1
## 3    0   1   0   0  0   0 -8.243049         1
## 4    0   0   0   1  0   0 -8.242999         1
## 5    0   1   0   0  1   0 -8.242940         1
## 6    0   1   0   1  0   0 -8.242931         1
## 7    0   0   0   1  1   0 -8.242889         1
## 8    1   1   0   1  0   0 -8.242852         1
## 9    0   0   1   0  0   0 -8.242737         1
## 10   1   0   0   0  0   0 -8.242682         1
## 11   1   1   0   1  1   0 -8.242651         1
## 12   1   1   0   0  0   0 -8.242490         1
## 13   0   0   1   0  1   0 -8.242480         1
## 14   0   1   1   0  0   0 -8.242459         1
## 15   1   0   0   0  1   0 -8.242428         1
## 16   1   0   0   1  0   0 -8.242406         1
## 17   0   0   1   1  0   0 -8.242370         1
## 18   0   1   0   1  1   0 -8.242328         1
## 19   1   1   0   0  1   0 -8.242318         1
## 20   0   1   1   1  0   0 -8.242313         1
## 21   0   1   1   0  1   0 -8.242285         1
## 22   1   0   0   1  1   0 -8.242229         1
## 23   0   0   1   1  1   0 -8.242192         1
## 24   1   0   1   1  1   0 -8.242129         1
## 25   1   0   1   1  0   0 -8.241989         1
## 26   1   0   1   0  0   0 -8.241692         1
## 27   0   1   1   1  1   0 -8.241683         1
## 28   1   0   1   0  1   0 -8.241446         1
## 29   1   1   1   0  0   0 -8.241340         1
## 30   1   1   1   0  1   0 -8.241159         1
## 31   1   1   1   1  1   0 -8.240424         1
result8 <- autoarfima(data[, 2],ar.max = 2, ma.max = 2, criterion = "AIC", method = "full")
print(result8)
## $fit
## 
## *----------------------------------*
## *          ARFIMA Model Fit        *
## *----------------------------------*
## Mean Model   : ARFIMA(2,0,2)
## Distribution : norm 
## 
## Optimal Parameters
## ------------------------------------
##        Estimate  Std. Error     t value Pr(>|t|)
## ar1    0.000000          NA          NA       NA
## ar2    0.041249    0.025472  1.6194e+00  0.10537
## ma1   -0.935097    0.000001 -6.5187e+05  0.00000
## ma2   -0.044486    0.000565 -7.8797e+01  0.00000
## sigma  0.005690    0.000105  5.3963e+01  0.00000
## 
## Robust Standard Errors:
##        Estimate  Std. Error     t value Pr(>|t|)
## ar1    0.000000          NA          NA       NA
## ar2    0.041249    0.037879  1.0889e+00  0.27618
## ma1   -0.935097    0.000002 -4.7778e+05  0.00000
## ma2   -0.044486    0.000831 -5.3559e+01  0.00000
## sigma  0.005690    0.000178  3.1910e+01  0.00000
## 
## LogLikelihood : 5460.075 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -7.4946
## Bayes        -7.4801
## Shibata      -7.4946
## Hannan-Quinn -7.4892
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                   0.0004785  0.9825
## Lag[2*(p+q)+(p+q)-1][11] 2.5580236  1.0000
## Lag[4*(p+q)+(p+q)-1][19] 7.2559589  0.8841
## 
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic   p-value
## Lag[1]                      55.62 8.815e-14
## Lag[2*(p+q)+(p+q)-1][2]     85.35 0.000e+00
## Lag[4*(p+q)+(p+q)-1][5]    144.74 0.000e+00
## 
## 
## ARCH LM Tests
## ------------------------------------
##              Statistic DoF P-Value
## ARCH Lag[2]      95.94   2       0
## ARCH Lag[5]     122.55   5       0
## ARCH Lag[10]    168.75  10       0
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  1.1062
## Individual Statistics:            
## ar2   0.4003
## ma1   0.4951
## ma2   0.5211
## sigma 0.3162
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          1.07 1.24 1.6
## Individual Statistic:     0.35 0.47 0.75
## 
## 
## Elapsed time : 0.09141994 
## 
## 
## $rank.matrix
##    ar1 ar2 ma1 ma2 im arf       AIC converged
## 1    0   1   1   1  0   0 -7.494608         1
## 2    1   1   1   0  0   0 -7.494605         1
## 3    1   0   1   1  0   0 -7.494588         1
## 4    1   0   1   0  0   0 -7.494509         1
## 5    0   0   1   1  0   0 -7.494362         1
## 6    0   1   1   0  0   0 -7.494008         1
## 7    0   0   1   0  0   0 -7.493919         1
## 8    0   1   1   1  1   0 -7.493427         1
## 9    1   1   1   0  1   0 -7.493424         1
## 10   1   1   0   1  0   0 -7.493378         1
## 11   1   0   1   1  1   0 -7.493344         1
## 12   1   0   1   0  1   0 -7.493322         1
## 13   1   1   1   1  0   0 -7.493235         1
## 14   0   0   1   1  1   0 -7.493173         1
## 15   1   0   0   1  0   0 -7.493149         1
## 16   0   1   1   0  1   0 -7.492811         1
## 17   0   0   1   0  1   0 -7.492715         1
## 18   1   1   0   1  1   0 -7.492189         1
## 19   1   1   1   1  1   0 -7.492053         1
## 20   1   0   0   1  1   0 -7.491945         1
## 21   1   1   0   0  0   0 -7.247547         1
## 22   1   1   0   0  1   0 -7.246174         1
## 23   1   0   0   0  0   0 -7.151703         1
## 24   1   0   0   0  1   0 -7.150330         1
## 25   0   1   0   1  0   0 -6.871026         1
## 26   0   0   0   1  0   0 -6.868593         1
## 27   0   1   0   0  0   0 -6.868581         1
## 28   0   0   0   0  1   0 -6.868274         1
## 29   0   0   0   1  1   0 -6.867220         1
## 30   0   1   0   0  1   0 -6.867208         1
## 31   0   1   0   1  1   0 -6.865819         1
re_XAU <- result7$fit@fit$residuals
re_VNI <- result8$fit@fit$residuals
result5 <-  Box.test(re_XAU, lag = 2, type = "Ljung-Box")
result6 <-  Box.test(re_VNI, lag = 2, type = "Ljung-Box")
print(result5)
## 
##  Box-Ljung test
## 
## data:  re_XAU
## X-squared = 0.89368, df = 2, p-value = 0.6396
print(result6)
## 
##  Box-Ljung test
## 
## data:  re_VNI
## X-squared = 0.00089726, df = 2, p-value = 0.9996
result55 <-  Box.test(re_XAU^2, lag = 2, type = "Ljung-Box")
result66 <-  Box.test(re_VNI^2, lag = 2, type = "Ljung-Box")
print(result55)
## 
##  Box-Ljung test
## 
## data:  re_XAU^2
## X-squared = 31.469, df = 2, p-value = 1.467e-07
print(result66)
## 
##  Box-Ljung test
## 
## data:  re_VNI^2
## X-squared = 115.09, df = 2, p-value < 2.2e-16

Kiểm định hiệu ứng ARCH: ARCH-LM

library(lmtest)
library(fGarch)
library(rugarch)
library(tseries)

# Kiểm định hiệu ứng ARCH - LM  
arch_spec <- ugarchspec(variance.model = list(model = "sGARCH"))
arch_XAU.USD <- ugarchfit(spec = arch_spec, data = data$XAU.USD)
arch_VNI <- ugarchfit(spec = arch_spec, data = data$VNI)

residuals <- residuals(arch_XAU.USD)
residuals1 <- residuals(arch_VNI)

n <- length(residuals)
n1 <- length(residuals1)
x <- 1:n
x1 <- 1:n1

# Tạo mô hình tuyến tính
arch_lm_model_XAU.USD <- lm(residuals^2 ~ x)
arch_lm_model_VNI <- lm(residuals1^2 ~ x1)


# Kiểm định hiệu ứng ARCH-LM
arch1 <- bptest(arch_lm_model_XAU.USD)
arch2 <- bptest(arch_lm_model_VNI)
# Hiển thị kết quả
arch1
## 
##  studentized Breusch-Pagan test
## 
## data:  arch_lm_model_XAU.USD
## BP = 0.0015143, df = 1, p-value = 0.969
arch2
## 
##  studentized Breusch-Pagan test
## 
## data:  arch_lm_model_VNI
## BP = 0.37244, df = 1, p-value = 0.5417

Đồ thị biến động hai chuỗi lợi suất

library(quantmod)
library(PerformanceAnalytics)
library(ggplot2)
library(kableExtra)
library(tidyr)

data_plot <- data %>%
  pivot_longer(cols = c(VNI, XAU.USD), names_to = "VNI", values_to = "XAU.USD")

# Vẽ đồ thị ghép
ggplot(data_plot, aes(x = DATE, y = XAU.USD)) +
  geom_line() +
  facet_wrap(~ VNI, ncol = 2) +  # Tạo các subplot theo biến Index
  labs(title = "Biến động tỷ suất lợi nhuận của các chỉ số")

  theme_minimal()
## List of 136
##  $ line                            :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ lineend      : chr "butt"
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ rect                            :List of 5
##   ..$ fill         : chr "white"
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ text                            :List of 11
##   ..$ family       : chr ""
##   ..$ face         : chr "plain"
##   ..$ colour       : chr "black"
##   ..$ size         : num 11
##   ..$ hjust        : num 0.5
##   ..$ vjust        : num 0.5
##   ..$ angle        : num 0
##   ..$ lineheight   : num 0.9
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ title                           : NULL
##  $ aspect.ratio                    : NULL
##  $ axis.title                      : NULL
##  $ axis.title.x                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.75points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.top                :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.75points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.bottom             : NULL
##  $ axis.title.y                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num 90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.75points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.y.left               : NULL
##  $ axis.title.y.right              :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num -90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.75points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text                       :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : chr "grey30"
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.2points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.top                 :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.2points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.bottom              : NULL
##  $ axis.text.y                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 1
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.y.left                : NULL
##  $ axis.text.y.right               :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.theta                 : NULL
##  $ axis.text.r                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0.5
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.ticks                      : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ axis.ticks.x                    : NULL
##  $ axis.ticks.x.top                : NULL
##  $ axis.ticks.x.bottom             : NULL
##  $ axis.ticks.y                    : NULL
##  $ axis.ticks.y.left               : NULL
##  $ axis.ticks.y.right              : NULL
##  $ axis.ticks.theta                : NULL
##  $ axis.ticks.r                    : NULL
##  $ axis.minor.ticks.x.top          : NULL
##  $ axis.minor.ticks.x.bottom       : NULL
##  $ axis.minor.ticks.y.left         : NULL
##  $ axis.minor.ticks.y.right        : NULL
##  $ axis.minor.ticks.theta          : NULL
##  $ axis.minor.ticks.r              : NULL
##  $ axis.ticks.length               : 'simpleUnit' num 2.75points
##   ..- attr(*, "unit")= int 8
##  $ axis.ticks.length.x             : NULL
##  $ axis.ticks.length.x.top         : NULL
##  $ axis.ticks.length.x.bottom      : NULL
##  $ axis.ticks.length.y             : NULL
##  $ axis.ticks.length.y.left        : NULL
##  $ axis.ticks.length.y.right       : NULL
##  $ axis.ticks.length.theta         : NULL
##  $ axis.ticks.length.r             : NULL
##  $ axis.minor.ticks.length         : 'rel' num 0.75
##  $ axis.minor.ticks.length.x       : NULL
##  $ axis.minor.ticks.length.x.top   : NULL
##  $ axis.minor.ticks.length.x.bottom: NULL
##  $ axis.minor.ticks.length.y       : NULL
##  $ axis.minor.ticks.length.y.left  : NULL
##  $ axis.minor.ticks.length.y.right : NULL
##  $ axis.minor.ticks.length.theta   : NULL
##  $ axis.minor.ticks.length.r       : NULL
##  $ axis.line                       : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ axis.line.x                     : NULL
##  $ axis.line.x.top                 : NULL
##  $ axis.line.x.bottom              : NULL
##  $ axis.line.y                     : NULL
##  $ axis.line.y.left                : NULL
##  $ axis.line.y.right               : NULL
##  $ axis.line.theta                 : NULL
##  $ axis.line.r                     : NULL
##  $ legend.background               : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.margin                   : 'margin' num [1:4] 5.5points 5.5points 5.5points 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing                  : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing.x                : NULL
##  $ legend.spacing.y                : NULL
##  $ legend.key                      : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.key.size                 : 'simpleUnit' num 1.2lines
##   ..- attr(*, "unit")= int 3
##  $ legend.key.height               : NULL
##  $ legend.key.width                : NULL
##  $ legend.key.spacing              : 'simpleUnit' num 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.key.spacing.x            : NULL
##  $ legend.key.spacing.y            : NULL
##  $ legend.frame                    : NULL
##  $ legend.ticks                    : NULL
##  $ legend.ticks.length             : 'rel' num 0.2
##  $ legend.axis.line                : NULL
##  $ legend.text                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.text.position            : NULL
##  $ legend.title                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.title.position           : NULL
##  $ legend.position                 : chr "right"
##  $ legend.position.inside          : NULL
##  $ legend.direction                : NULL
##  $ legend.byrow                    : NULL
##  $ legend.justification            : chr "center"
##  $ legend.justification.top        : NULL
##  $ legend.justification.bottom     : NULL
##  $ legend.justification.left       : NULL
##  $ legend.justification.right      : NULL
##  $ legend.justification.inside     : NULL
##  $ legend.location                 : NULL
##  $ legend.box                      : NULL
##  $ legend.box.just                 : NULL
##  $ legend.box.margin               : 'margin' num [1:4] 0cm 0cm 0cm 0cm
##   ..- attr(*, "unit")= int 1
##  $ legend.box.background           : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.box.spacing              : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##   [list output truncated]
##  - attr(*, "class")= chr [1:2] "theme" "gg"
##  - attr(*, "complete")= logi TRUE
##  - attr(*, "validate")= logi TRUE

Mô hình ARMA

**Mô hình ARMA cho XAU.USD

result7 <- autoarfima(data2[, 2],ar.max = 2, ma.max = 2, criterion = "AIC", method = "full")
print(result7)
## $fit
## 
## *----------------------------------*
## *          ARFIMA Model Fit        *
## *----------------------------------*
## Mean Model   : ARFIMA(2,0,2)
## Distribution : norm 
## 
## Optimal Parameters
## ------------------------------------
##        Estimate  Std. Error  t value Pr(>|t|)
## ar1    0.199441    0.044998   4.4322 0.000009
## ar2   -0.947042    0.010145 -93.3499 0.000000
## ma1   -0.197572    0.055853  -3.5373 0.000404
## ma2    0.918403    0.016753  54.8201 0.000000
## sigma  0.003906    0.000072  53.9629 0.000000
## 
## Robust Standard Errors:
##        Estimate  Std. Error  t value Pr(>|t|)
## ar1    0.199441    0.051500   3.8727 0.000108
## ar2   -0.947042    0.011725 -80.7692 0.000000
## ma1   -0.197572    0.065616  -3.0110 0.002604
## ma2    0.918403    0.006531 140.6121 0.000000
## sigma  0.003906    0.000180  21.7264 0.000000
## 
## LogLikelihood : 6007.8 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -8.2456
## Bayes        -8.2275
## Shibata      -8.2456
## Hannan-Quinn -8.2388
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.8933  0.3446
## Lag[2*(p+q)+(p+q)-1][11]    6.4316  0.2319
## Lag[4*(p+q)+(p+q)-1][19]   12.5557  0.1423
## 
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic   p-value
## Lag[1]                      6.745 9.401e-03
## Lag[2*(p+q)+(p+q)-1][2]    19.107 7.637e-06
## Lag[4*(p+q)+(p+q)-1][5]    41.793 1.421e-11
## 
## 
## ARCH LM Tests
## ------------------------------------
##              Statistic DoF   P-Value
## ARCH Lag[2]      29.74   2 3.487e-07
## ARCH Lag[5]      55.58   5 9.896e-11
## ARCH Lag[10]     89.74  10 5.995e-15
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  1.5734
## Individual Statistics:             
## ar1   0.07574
## ar2   0.19881
## ma1   0.08032
## ma2   0.26677
## sigma 1.00371
## 
## 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.2281008 
## 
## 
## $rank.matrix
##    ar1 ar2 ma1 ma2 im arf       AIC converged
## 1    1   1   1   1  0   0 -8.245605         1
## 2    0   0   0   0  1   0 -8.243102         1
## 3    0   1   0   0  0   0 -8.243049         1
## 4    0   0   0   1  0   0 -8.242999         1
## 5    0   1   0   0  1   0 -8.242940         1
## 6    0   1   0   1  0   0 -8.242931         1
## 7    0   0   0   1  1   0 -8.242889         1
## 8    1   1   0   1  0   0 -8.242852         1
## 9    0   0   1   0  0   0 -8.242737         1
## 10   1   0   0   0  0   0 -8.242682         1
## 11   1   1   0   1  1   0 -8.242651         1
## 12   1   1   0   0  0   0 -8.242490         1
## 13   0   0   1   0  1   0 -8.242480         1
## 14   0   1   1   0  0   0 -8.242459         1
## 15   1   0   0   0  1   0 -8.242428         1
## 16   1   0   0   1  0   0 -8.242406         1
## 17   0   0   1   1  0   0 -8.242370         1
## 18   0   1   0   1  1   0 -8.242328         1
## 19   1   1   0   0  1   0 -8.242318         1
## 20   0   1   1   1  0   0 -8.242313         1
## 21   0   1   1   0  1   0 -8.242285         1
## 22   1   0   0   1  1   0 -8.242229         1
## 23   0   0   1   1  1   0 -8.242192         1
## 24   1   0   1   1  1   0 -8.242129         1
## 25   1   0   1   1  0   0 -8.241989         1
## 26   1   0   1   0  0   0 -8.241692         1
## 27   0   1   1   1  1   0 -8.241683         1
## 28   1   0   1   0  1   0 -8.241446         1
## 29   1   1   1   0  0   0 -8.241340         1
## 30   1   1   1   0  1   0 -8.241159         1
## 31   1   1   1   1  1   0 -8.240424         1

Mô hình ARMA cho VNI

result8 <- autoarfima(data[, 2],ar.max = 2, ma.max = 2, criterion = "AIC", method = "full")
print(result8)
## $fit
## 
## *----------------------------------*
## *          ARFIMA Model Fit        *
## *----------------------------------*
## Mean Model   : ARFIMA(2,0,2)
## Distribution : norm 
## 
## Optimal Parameters
## ------------------------------------
##        Estimate  Std. Error     t value Pr(>|t|)
## ar1    0.000000          NA          NA       NA
## ar2    0.041249    0.025472  1.6194e+00  0.10537
## ma1   -0.935097    0.000001 -6.5187e+05  0.00000
## ma2   -0.044486    0.000565 -7.8797e+01  0.00000
## sigma  0.005690    0.000105  5.3963e+01  0.00000
## 
## Robust Standard Errors:
##        Estimate  Std. Error     t value Pr(>|t|)
## ar1    0.000000          NA          NA       NA
## ar2    0.041249    0.037879  1.0889e+00  0.27618
## ma1   -0.935097    0.000002 -4.7778e+05  0.00000
## ma2   -0.044486    0.000831 -5.3559e+01  0.00000
## sigma  0.005690    0.000178  3.1910e+01  0.00000
## 
## LogLikelihood : 5460.075 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -7.4946
## Bayes        -7.4801
## Shibata      -7.4946
## Hannan-Quinn -7.4892
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                   0.0004785  0.9825
## Lag[2*(p+q)+(p+q)-1][11] 2.5580236  1.0000
## Lag[4*(p+q)+(p+q)-1][19] 7.2559589  0.8841
## 
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic   p-value
## Lag[1]                      55.62 8.815e-14
## Lag[2*(p+q)+(p+q)-1][2]     85.35 0.000e+00
## Lag[4*(p+q)+(p+q)-1][5]    144.74 0.000e+00
## 
## 
## ARCH LM Tests
## ------------------------------------
##              Statistic DoF P-Value
## ARCH Lag[2]      95.94   2       0
## ARCH Lag[5]     122.55   5       0
## ARCH Lag[10]    168.75  10       0
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  1.1062
## Individual Statistics:            
## ar2   0.4003
## ma1   0.4951
## ma2   0.5211
## sigma 0.3162
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          1.07 1.24 1.6
## Individual Statistic:     0.35 0.47 0.75
## 
## 
## Elapsed time : 0.1008711 
## 
## 
## $rank.matrix
##    ar1 ar2 ma1 ma2 im arf       AIC converged
## 1    0   1   1   1  0   0 -7.494608         1
## 2    1   1   1   0  0   0 -7.494605         1
## 3    1   0   1   1  0   0 -7.494588         1
## 4    1   0   1   0  0   0 -7.494509         1
## 5    0   0   1   1  0   0 -7.494362         1
## 6    0   1   1   0  0   0 -7.494008         1
## 7    0   0   1   0  0   0 -7.493919         1
## 8    0   1   1   1  1   0 -7.493427         1
## 9    1   1   1   0  1   0 -7.493424         1
## 10   1   1   0   1  0   0 -7.493378         1
## 11   1   0   1   1  1   0 -7.493344         1
## 12   1   0   1   0  1   0 -7.493322         1
## 13   1   1   1   1  0   0 -7.493235         1
## 14   0   0   1   1  1   0 -7.493173         1
## 15   1   0   0   1  0   0 -7.493149         1
## 16   0   1   1   0  1   0 -7.492811         1
## 17   0   0   1   0  1   0 -7.492715         1
## 18   1   1   0   1  1   0 -7.492189         1
## 19   1   1   1   1  1   0 -7.492053         1
## 20   1   0   0   1  1   0 -7.491945         1
## 21   1   1   0   0  0   0 -7.247547         1
## 22   1   1   0   0  1   0 -7.246174         1
## 23   1   0   0   0  0   0 -7.151703         1
## 24   1   0   0   0  1   0 -7.150330         1
## 25   0   1   0   1  0   0 -6.871026         1
## 26   0   0   0   1  0   0 -6.868593         1
## 27   0   1   0   0  0   0 -6.868581         1
## 28   0   0   0   0  1   0 -6.868274         1
## 29   0   0   0   1  1   0 -6.867220         1
## 30   0   1   0   0  1   0 -6.867208         1
## 31   0   1   0   1  1   0 -6.865819         1

ƯỚC LƯỢNG CÁC DẠNG MÔ HÌNH GJR-GARCH

Ước lượng cho chuỗi XAU.USD

Garch11

XAU.garch11n.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "norm")
XAU.garch11n.fit <- ugarchfit(spec = XAU.garch11n.spec, data = data[, 3])

XAU.garch11t.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "std")
XAU.garch11t.fit <- ugarchfit(spec = XAU.garch11t.spec, data = data[, 3])
 
XAU.garch11st.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "sstd")
XAU.garch11st.fit <- ugarchfit(spec = XAU.garch11st.spec, data = data[, 3])

XAU.garch11g.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "ged")
XAU.garch11g.fit <- ugarchfit(spec = XAU.garch11g.spec, data = data[, 3])

XAU.garch11sg.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "sged")
XAU.garch11sg.fit <- ugarchfit(spec = XAU.garch11sg.spec, data = data[, 3])

print(XAU.garch11n.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(1,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : norm 
## 
## Convergence Problem:
## Solver Message:
print(XAU.garch11t.fit)
## 
## *---------------------------------*
## *          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      0.000181    0.000082   2.20901 0.027174
## ar1     0.196179    0.035543   5.51953 0.000000
## ar2    -0.951156    0.028707 -33.13358 0.000000
## ma1    -0.203561    0.046358  -4.39104 0.000011
## ma2     0.922402    0.036302  25.40912 0.000000
## omega   0.000000    0.000000   0.65282 0.513870
## alpha1  0.076762    0.012866   5.96610 0.000000
## beta1   0.932286    0.010272  90.76373 0.000000
## gamma1 -0.047757    0.016920  -2.82241 0.004766
## shape   4.652846    0.566421   8.21447 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error    t value Pr(>|t|)
## mu      0.000181    0.000082   2.196426 0.028061
## ar1     0.196179    0.043763   4.482746 0.000007
## ar2    -0.951156    0.032147 -29.587541 0.000000
## ma1    -0.203561    0.057396  -3.546607 0.000390
## ma2     0.922402    0.040028  23.043650 0.000000
## omega   0.000000    0.000005   0.060085 0.952088
## alpha1  0.076762    0.246489   0.311423 0.755479
## beta1   0.932286    0.158975   5.864361 0.000000
## gamma1 -0.047757    0.119235  -0.400524 0.688771
## shape   4.652846    3.639958   1.278269 0.201155
## 
## LogLikelihood : 6133.19 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -8.4110
## Bayes        -8.3747
## Shibata      -8.4111
## Hannan-Quinn -8.3974
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       2.028  0.1544
## Lag[2*(p+q)+(p+q)-1][11]     4.918  0.9700
## Lag[4*(p+q)+(p+q)-1][19]     7.688  0.8353
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                     0.2631  0.6080
## Lag[2*(p+q)+(p+q)-1][5]    4.5710  0.1909
## Lag[4*(p+q)+(p+q)-1][9]    5.9517  0.3038
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]    0.3203 0.500 2.000  0.5714
## ARCH Lag[5]    2.1840 1.440 1.667  0.4320
## ARCH Lag[7]    2.7452 2.315 1.543  0.5629
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  422.4859
## Individual Statistics:                
## mu       0.18209
## ar1      0.04960
## ar2      0.35585
## ma1      0.05596
## ma2      0.46660
## omega  131.44213
## alpha1   0.19290
## beta1    0.26442
## gamma1   0.22246
## shape    0.22720
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          2.29 2.54 3.05
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                     t-value   prob sig
## Sign Bias          1.603536 0.1090    
## Negative Sign Bias 1.425741 0.1542    
## Positive Sign Bias 0.008289 0.9934    
## Joint Effect       3.700502 0.2957    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     19.69       0.4136
## 2    30     28.42       0.4954
## 3    40     33.29       0.7274
## 4    50     37.20       0.8916
## 
## 
## Elapsed time : 1.45211
print(XAU.garch11st.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(1,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : sstd 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error   t value Pr(>|t|)
## mu      0.000095    0.000092   1.03961 0.298519
## ar1     0.189180    0.035770   5.28872 0.000000
## ar2    -0.952305    0.029817 -31.93807 0.000000
## ma1    -0.194287    0.047185  -4.11757 0.000038
## ma2     0.923479    0.037593  24.56487 0.000000
## omega   0.000000    0.000001   0.64905 0.516306
## alpha1  0.078112    0.013912   5.61458 0.000000
## beta1   0.928840    0.011488  80.85497 0.000000
## gamma1 -0.047055    0.017381  -2.70722 0.006785
## skew    0.938318    0.032972  28.45769 0.000000
## shape   4.647912    0.559284   8.31047 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error    t value Pr(>|t|)
## mu      0.000095    0.000098   0.973244 0.330432
## ar1     0.189180    0.045217   4.183799 0.000029
## ar2    -0.952305    0.037053 -25.701252 0.000000
## ma1    -0.194287    0.060740  -3.198664 0.001381
## ma2     0.923479    0.045159  20.449471 0.000000
## omega   0.000000    0.000006   0.058923 0.953014
## alpha1  0.078112    0.255923   0.305216 0.760201
## beta1   0.928840    0.173867   5.342231 0.000000
## gamma1 -0.047055    0.115545  -0.407241 0.683831
## skew    0.938318    0.033641  27.892254 0.000000
## shape   4.647912    3.417027   1.360221 0.173760
## 
## LogLikelihood : 6134.849 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -8.4119
## Bayes        -8.3720
## Shibata      -8.4120
## Hannan-Quinn -8.3970
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       1.702  0.1920
## Lag[2*(p+q)+(p+q)-1][11]     4.628  0.9927
## Lag[4*(p+q)+(p+q)-1][19]     7.402  0.8687
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                     0.3678  0.5442
## Lag[2*(p+q)+(p+q)-1][5]    4.7069  0.1781
## Lag[4*(p+q)+(p+q)-1][9]    6.0549  0.2919
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]    0.3758 0.500 2.000  0.5399
## ARCH Lag[5]    2.2715 1.440 1.667  0.4143
## ARCH Lag[7]    2.7677 2.315 1.543  0.5585
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  419.6437
## Individual Statistics:                
## mu       0.21467
## ar1      0.05563
## ar2      0.34110
## ma1      0.06844
## ma2      0.43970
## omega  126.56295
## alpha1   0.19473
## beta1    0.25834
## gamma1   0.21919
## skew     0.40620
## shape    0.21136
## 
## 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          1.56316 0.1182    
## Negative Sign Bias 1.47836 0.1395    
## Positive Sign Bias 0.07202 0.9426    
## Joint Effect       3.77608 0.2867    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     17.41       0.5623
## 2    30     23.15       0.7697
## 3    40     29.05       0.8773
## 4    50     35.00       0.9342
## 
## 
## Elapsed time : 1.965402
print(XAU.garch11g.fit)
## 
## *---------------------------------*
## *          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      0.000165    0.000084   1.95787 0.050245
## ar1     0.206413    0.019123  10.79383 0.000000
## ar2    -0.952339    0.011621 -81.95221 0.000000
## ma1    -0.212286    0.024898  -8.52626 0.000000
## ma2     0.920332    0.014900  61.76779 0.000000
## omega   0.000000    0.000001   0.48257 0.629403
## alpha1  0.085363    0.019430   4.39333 0.000011
## beta1   0.921970    0.017639  52.26943 0.000000
## gamma1 -0.054730    0.015903  -3.44146 0.000579
## shape   1.235955    0.043980  28.10235 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error     t value Pr(>|t|)
## mu      0.000165    0.000091    1.819920 0.068771
## ar1     0.206413    0.015211   13.570042 0.000000
## ar2    -0.952339    0.006346 -150.059338 0.000000
## ma1    -0.212286    0.019294  -11.002696 0.000000
## ma2     0.920332    0.013967   65.891382 0.000000
## omega   0.000000    0.000010    0.032544 0.974038
## alpha1  0.085363    0.406846    0.209816 0.833811
## beta1   0.921970    0.310236    2.971838 0.002960
## gamma1 -0.054730    0.197261   -0.277451 0.781434
## shape   1.235955    0.628791    1.965606 0.049344
## 
## LogLikelihood : 6134.853 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -8.4133
## Bayes        -8.3770
## Shibata      -8.4134
## Hannan-Quinn -8.3997
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       1.776  0.1826
## Lag[2*(p+q)+(p+q)-1][11]     4.918  0.9701
## Lag[4*(p+q)+(p+q)-1][19]     7.736  0.8293
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                     0.4629  0.4963
## Lag[2*(p+q)+(p+q)-1][5]    4.0875  0.2434
## Lag[4*(p+q)+(p+q)-1][9]    5.1303  0.4105
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]    0.5028 0.500 2.000  0.4783
## ARCH Lag[5]    1.8978 1.440 1.667  0.4943
## ARCH Lag[7]    2.2372 2.315 1.543  0.6672
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  407.6392
## Individual Statistics:                
## mu       0.18811
## ar1      0.05270
## ar2      0.33316
## ma1      0.04896
## ma2      0.45659
## omega  113.10651
## alpha1   0.19921
## beta1    0.24886
## gamma1   0.21461
## shape    0.11955
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          2.29 2.54 3.05
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                    t-value   prob sig
## Sign Bias           1.5652 0.1178    
## Negative Sign Bias  1.5273 0.1269    
## Positive Sign Bias  0.2344 0.8147    
## Joint Effect        4.1850 0.2422    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     24.88       0.1646
## 2    30     24.47       0.7056
## 3    40     31.91       0.7824
## 4    50     42.56       0.7302
## 
## 
## Elapsed time : 2.298662
print(XAU.garch11sg.fit)
## 
## *---------------------------------*
## *          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      0.000113    0.000097   1.15859 0.246624
## ar1     0.192069    0.009983  19.23960 0.000000
## ar2    -0.955622    0.020650 -46.27678 0.000000
## ma1    -0.197211    0.013453 -14.65879 0.000000
## ma2     0.923142    0.026860  34.36811 0.000000
## omega   0.000000    0.000000   0.52014 0.602965
## alpha1  0.075977    0.010264   7.40208 0.000000
## beta1   0.935272    0.010395  89.97283 0.000000
## gamma1 -0.051365    0.014260  -3.60213 0.000316
## skew    0.940130    0.026509  35.46520 0.000000
## shape   1.239972    0.054491  22.75555 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error    t value Pr(>|t|)
## mu      0.000113    0.000179   0.630313 0.528490
## ar1     0.192069    0.005504  34.897577 0.000000
## ar2    -0.955622    0.020250 -47.192276 0.000000
## ma1    -0.197211    0.009436 -20.900237 0.000000
## ma2     0.923142    0.027260  33.864170 0.000000
## omega   0.000000    0.000005   0.042267 0.966286
## alpha1  0.075977    0.245173   0.309893 0.756642
## beta1   0.935272    0.177962   5.255451 0.000000
## gamma1 -0.051365    0.134421  -0.382118 0.702374
## skew    0.940130    0.037132  25.318900 0.000000
## shape   1.239972    0.314817   3.938710 0.000082
## 
## LogLikelihood : 6136.139 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -8.4137
## Bayes        -8.3737
## Shibata      -8.4138
## Hannan-Quinn -8.3988
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       1.942  0.1634
## Lag[2*(p+q)+(p+q)-1][11]     5.282  0.8866
## Lag[4*(p+q)+(p+q)-1][19]     8.157  0.7720
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                      0.268  0.6047
## Lag[2*(p+q)+(p+q)-1][5]     4.519  0.1961
## Lag[4*(p+q)+(p+q)-1][9]     5.875  0.3129
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]     0.340 0.500 2.000  0.5598
## ARCH Lag[5]     2.197 1.440 1.667  0.4293
## ARCH Lag[7]     2.727 2.315 1.543  0.5665
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  434.7946
## Individual Statistics:                
## mu       0.11225
## ar1      0.12486
## ar2      0.33482
## ma1      0.13756
## ma2      0.42012
## omega  145.06067
## alpha1   0.19970
## beta1    0.19108
## gamma1   0.17149
## skew     0.37979
## shape    0.07843
## 
## 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           1.6252 0.1043    
## Negative Sign Bias  1.4696 0.1419    
## Positive Sign Bias  0.1329 0.8943    
## Joint Effect        4.1044 0.2504    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     20.57       0.3613
## 2    30     19.73       0.9012
## 3    40     40.04       0.4236
## 4    50     37.20       0.8916
## 
## 
## Elapsed time : 4.199541

Garch12

XAU.garch12n.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 2)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "norm")
XAU.garch12n.fit <- ugarchfit(spec = XAU.garch12n.spec, data = data[, 3])

XAU.garch12t.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 2)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "std")
XAU.garch12t.fit <- ugarchfit(spec = XAU.garch12t.spec, data = data[, 3])
 
XAU.garch12st.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 2)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "sstd")
XAU.garch12st.fit <- ugarchfit(spec = XAU.garch12st.spec, data = data[, 3])

XAU.garch12g.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "ged")
XAU.garch12g.fit <- ugarchfit(spec = XAU.garch12g.spec, data = data[, 3])

XAU.garch12sg.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 2)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "sged")
XAU.garch12sg.fit <- ugarchfit(spec = XAU.garch12g.spec, data = data[, 3])

print(XAU.garch12n.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(1,2)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : norm 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error     t value Pr(>|t|)
## mu      0.000097    0.000091    1.075938 0.281955
## ar1     0.196626    0.003595   54.688167 0.000000
## ar2    -0.978170    0.001401 -698.063657 0.000000
## ma1    -0.197599    0.009734  -20.300799 0.000000
## ma2     0.956424    0.005771  165.738775 0.000000
## omega   0.000000    0.000001    0.697407 0.485548
## alpha1  0.104596    0.023729    4.408021 0.000010
## beta1   0.906029    0.063195   14.337147 0.000000
## beta2   0.000002    0.056508    0.000032 0.999975
## gamma1 -0.067170    0.021027   -3.194411 0.001401
## 
## Robust Standard Errors:
##         Estimate  Std. Error     t value Pr(>|t|)
## mu      0.000097    0.000106    0.917411 0.358927
## ar1     0.196626    0.006908   28.464427 0.000000
## ar2    -0.978170    0.006950 -140.752665 0.000000
## ma1    -0.197599    0.008635  -22.882324 0.000000
## ma2     0.956424    0.007337  130.351206 0.000000
## omega   0.000000    0.000010    0.041807 0.966652
## alpha1  0.104596    0.257965    0.405467 0.685134
## beta1   0.906029    0.441666    2.051390 0.040229
## beta2   0.000002    0.234344    0.000008 0.999994
## gamma1 -0.067170    0.141398   -0.475041 0.634758
## 
## LogLikelihood : 6086.736 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -8.3472
## Bayes        -8.3109
## Shibata      -8.3473
## Hannan-Quinn -8.3336
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       1.102  0.2939
## Lag[2*(p+q)+(p+q)-1][11]     3.684  1.0000
## Lag[4*(p+q)+(p+q)-1][19]     6.241  0.9601
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.9223  0.3369
## Lag[2*(p+q)+(p+q)-1][8]     4.4010  0.4408
## Lag[4*(p+q)+(p+q)-1][14]    5.1644  0.7489
## d.o.f=3
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[4]    0.8365 0.500 2.000  0.3604
## ARCH Lag[6]    0.9355 1.461 1.711  0.7663
## ARCH Lag[8]    1.0255 2.368 1.583  0.9205
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  393.9766
## Individual Statistics:               
## mu      0.07500
## ar1     0.07214
## ar2     0.19102
## ma1     0.05417
## ma2     0.25390
## omega  75.34192
## alpha1  0.20321
## beta1   0.24575
## beta2   0.25036
## gamma1  0.21036
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          2.29 2.54 3.05
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                    t-value    prob sig
## Sign Bias           1.5424 0.12319    
## Negative Sign Bias  1.6926 0.09074   *
## Positive Sign Bias  0.5171 0.60515    
## Joint Effect        5.0931 0.16510    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     68.12    1.883e-07
## 2    30     86.16    1.405e-07
## 3    40     88.89    9.181e-06
## 4    50    102.17    1.300e-05
## 
## 
## Elapsed time : 1.132464
print(XAU.garch12t.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(1,2)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : std 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error    t value Pr(>|t|)
## mu      0.000173    0.000082   2.112181 0.034671
## ar1     0.196901    0.036477   5.398020 0.000000
## ar2    -0.950858    0.029477 -32.257819 0.000000
## ma1    -0.204309    0.047609  -4.291355 0.000018
## ma2     0.922836    0.036890  25.015615 0.000000
## omega   0.000000    0.000000   0.581214 0.561096
## alpha1  0.075701    0.013307   5.688980 0.000000
## beta1   0.933826    0.033521  27.857987 0.000000
## beta2   0.000577    0.037001   0.015604 0.987550
## gamma1 -0.046582    0.016666  -2.794943 0.005191
## shape   4.594893    0.515930   8.906031 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error    t value Pr(>|t|)
## mu      0.000173    0.000082   2.114591 0.034465
## ar1     0.196901    0.045529   4.324756 0.000015
## ar2    -0.950858    0.029861 -31.843280 0.000000
## ma1    -0.204309    0.059818  -3.415500 0.000637
## ma2     0.922836    0.036408  25.347090 0.000000
## omega   0.000000    0.000006   0.049626 0.960420
## alpha1  0.075701    0.261904   0.289040 0.772551
## beta1   0.933826    0.063210  14.773297 0.000000
## beta2   0.000577    0.228256   0.002530 0.997982
## gamma1 -0.046582    0.123858  -0.376091 0.706849
## shape   4.594893    4.191023   1.096365 0.272919
## 
## LogLikelihood : 6133.146 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -8.4095
## Bayes        -8.3696
## Shibata      -8.4097
## Hannan-Quinn -8.3946
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       2.060  0.1513
## Lag[2*(p+q)+(p+q)-1][11]     4.902  0.9720
## Lag[4*(p+q)+(p+q)-1][19]     7.628  0.8426
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.2607  0.6096
## Lag[2*(p+q)+(p+q)-1][8]     5.7172  0.2647
## Lag[4*(p+q)+(p+q)-1][14]    6.8874  0.5204
## d.o.f=3
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[4]     2.291 0.500 2.000  0.1301
## ARCH Lag[6]     2.607 1.461 1.711  0.3711
## ARCH Lag[8]     2.905 2.368 1.583  0.5614
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  459.181
## Individual Statistics:                
## mu       0.20178
## ar1      0.04701
## ar2      0.32056
## ma1      0.05238
## ma2      0.42566
## omega  137.85652
## alpha1   0.17723
## beta1    0.23501
## beta2    0.23934
## gamma1   0.20674
## shape    0.19066
## 
## 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          1.614749 0.1066    
## Negative Sign Bias 1.449478 0.1474    
## Positive Sign Bias 0.007429 0.9941    
## Joint Effect       3.764980 0.2880    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     18.75       0.4728
## 2    30     29.00       0.4651
## 3    40     31.03       0.8146
## 4    50     37.34       0.8884
## 
## 
## Elapsed time : 1.57421
print(XAU.garch12st.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(1,2)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : sstd 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error    t value Pr(>|t|)
## mu      0.000099    0.000092   1.080428 0.279951
## ar1     0.187992    0.035671   5.270095 0.000000
## ar2    -0.953452    0.029830 -31.963007 0.000000
## ma1    -0.192762    0.047154  -4.087927 0.000044
## ma2     0.924935    0.037699  24.534568 0.000000
## omega   0.000000    0.000001   0.563712 0.572950
## alpha1  0.076921    0.014375   5.350922 0.000000
## beta1   0.932703    0.044071  21.163627 0.000000
## beta2   0.000504    0.048688   0.010342 0.991748
## gamma1 -0.047367    0.016509  -2.869117 0.004116
## skew    0.937840    0.032984  28.433537 0.000000
## shape   4.618179    0.519043   8.897487 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error    t value Pr(>|t|)
## mu      0.000099    0.000099   0.998555 0.318010
## ar1     0.187992    0.045452   4.136090 0.000035
## ar2    -0.953452    0.032627 -29.222370 0.000000
## ma1    -0.192762    0.061365  -3.141236 0.001682
## ma2     0.924935    0.040109  23.060249 0.000000
## omega   0.000000    0.000006   0.046895 0.962597
## alpha1  0.076921    0.275626   0.279076 0.780186
## beta1   0.932703    0.162474   5.740622 0.000000
## beta2   0.000504    0.336793   0.001495 0.998807
## gamma1 -0.047367    0.129963  -0.364463 0.715513
## skew    0.937840    0.033511  27.986433 0.000000
## shape   4.618179    4.410094   1.047184 0.295015
## 
## LogLikelihood : 6134.787 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -8.4104
## Bayes        -8.3669
## Shibata      -8.4106
## Hannan-Quinn -8.3942
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       1.755  0.1852
## Lag[2*(p+q)+(p+q)-1][11]     4.704  0.9891
## Lag[4*(p+q)+(p+q)-1][19]     7.458  0.8625
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.3196  0.5719
## Lag[2*(p+q)+(p+q)-1][8]     5.9098  0.2442
## Lag[4*(p+q)+(p+q)-1][14]    7.0791  0.4956
## d.o.f=3
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[4]     2.389 0.500 2.000  0.1222
## ARCH Lag[6]     2.690 1.461 1.711  0.3569
## ARCH Lag[8]     2.986 2.368 1.583  0.5461
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  458.3485
## Individual Statistics:                
## mu       0.19684
## ar1      0.05556
## ar2      0.33472
## ma1      0.06858
## ma2      0.42620
## omega  138.78963
## alpha1   0.18141
## beta1    0.23959
## beta2    0.24344
## gamma1   0.20503
## skew     0.37962
## shape    0.19478
## 
## 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          1.56001 0.1190    
## Negative Sign Bias 1.46064 0.1443    
## Positive Sign Bias 0.06758 0.9461    
## Joint Effect       3.73767 0.2912    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     15.90       0.6642
## 2    30     23.44       0.7562
## 3    40     29.93       0.8513
## 4    50     45.99       0.5958
## 
## 
## Elapsed time : 2.006666
print(XAU.garch12g.fit)
## 
## *---------------------------------*
## *          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      0.000165    0.000084   1.95787 0.050245
## ar1     0.206413    0.019123  10.79383 0.000000
## ar2    -0.952339    0.011621 -81.95221 0.000000
## ma1    -0.212286    0.024898  -8.52626 0.000000
## ma2     0.920332    0.014900  61.76779 0.000000
## omega   0.000000    0.000001   0.48257 0.629403
## alpha1  0.085363    0.019430   4.39333 0.000011
## beta1   0.921970    0.017639  52.26943 0.000000
## gamma1 -0.054730    0.015903  -3.44146 0.000579
## shape   1.235955    0.043980  28.10235 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error     t value Pr(>|t|)
## mu      0.000165    0.000091    1.819920 0.068771
## ar1     0.206413    0.015211   13.570042 0.000000
## ar2    -0.952339    0.006346 -150.059338 0.000000
## ma1    -0.212286    0.019294  -11.002696 0.000000
## ma2     0.920332    0.013967   65.891382 0.000000
## omega   0.000000    0.000010    0.032544 0.974038
## alpha1  0.085363    0.406846    0.209816 0.833811
## beta1   0.921970    0.310236    2.971838 0.002960
## gamma1 -0.054730    0.197261   -0.277451 0.781434
## shape   1.235955    0.628791    1.965606 0.049344
## 
## LogLikelihood : 6134.853 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -8.4133
## Bayes        -8.3770
## Shibata      -8.4134
## Hannan-Quinn -8.3997
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       1.776  0.1826
## Lag[2*(p+q)+(p+q)-1][11]     4.918  0.9701
## Lag[4*(p+q)+(p+q)-1][19]     7.736  0.8293
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                     0.4629  0.4963
## Lag[2*(p+q)+(p+q)-1][5]    4.0875  0.2434
## Lag[4*(p+q)+(p+q)-1][9]    5.1303  0.4105
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]    0.5028 0.500 2.000  0.4783
## ARCH Lag[5]    1.8978 1.440 1.667  0.4943
## ARCH Lag[7]    2.2372 2.315 1.543  0.6672
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  407.6392
## Individual Statistics:                
## mu       0.18811
## ar1      0.05270
## ar2      0.33316
## ma1      0.04896
## ma2      0.45659
## omega  113.10651
## alpha1   0.19921
## beta1    0.24886
## gamma1   0.21461
## shape    0.11955
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          2.29 2.54 3.05
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                    t-value   prob sig
## Sign Bias           1.5652 0.1178    
## Negative Sign Bias  1.5273 0.1269    
## Positive Sign Bias  0.2344 0.8147    
## Joint Effect        4.1850 0.2422    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     24.88       0.1646
## 2    30     24.47       0.7056
## 3    40     31.91       0.7824
## 4    50     42.56       0.7302
## 
## 
## Elapsed time : 2.272967
print(XAU.garch12sg.fit)
## 
## *---------------------------------*
## *          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      0.000165    0.000084   1.95787 0.050245
## ar1     0.206413    0.019123  10.79383 0.000000
## ar2    -0.952339    0.011621 -81.95221 0.000000
## ma1    -0.212286    0.024898  -8.52626 0.000000
## ma2     0.920332    0.014900  61.76779 0.000000
## omega   0.000000    0.000001   0.48257 0.629403
## alpha1  0.085363    0.019430   4.39333 0.000011
## beta1   0.921970    0.017639  52.26943 0.000000
## gamma1 -0.054730    0.015903  -3.44146 0.000579
## shape   1.235955    0.043980  28.10235 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error     t value Pr(>|t|)
## mu      0.000165    0.000091    1.819920 0.068771
## ar1     0.206413    0.015211   13.570042 0.000000
## ar2    -0.952339    0.006346 -150.059338 0.000000
## ma1    -0.212286    0.019294  -11.002696 0.000000
## ma2     0.920332    0.013967   65.891382 0.000000
## omega   0.000000    0.000010    0.032544 0.974038
## alpha1  0.085363    0.406846    0.209816 0.833811
## beta1   0.921970    0.310236    2.971838 0.002960
## gamma1 -0.054730    0.197261   -0.277451 0.781434
## shape   1.235955    0.628791    1.965606 0.049344
## 
## LogLikelihood : 6134.853 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -8.4133
## Bayes        -8.3770
## Shibata      -8.4134
## Hannan-Quinn -8.3997
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       1.776  0.1826
## Lag[2*(p+q)+(p+q)-1][11]     4.918  0.9701
## Lag[4*(p+q)+(p+q)-1][19]     7.736  0.8293
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                     0.4629  0.4963
## Lag[2*(p+q)+(p+q)-1][5]    4.0875  0.2434
## Lag[4*(p+q)+(p+q)-1][9]    5.1303  0.4105
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]    0.5028 0.500 2.000  0.4783
## ARCH Lag[5]    1.8978 1.440 1.667  0.4943
## ARCH Lag[7]    2.2372 2.315 1.543  0.6672
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  407.6392
## Individual Statistics:                
## mu       0.18811
## ar1      0.05270
## ar2      0.33316
## ma1      0.04896
## ma2      0.45659
## omega  113.10651
## alpha1   0.19921
## beta1    0.24886
## gamma1   0.21461
## shape    0.11955
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          2.29 2.54 3.05
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                    t-value   prob sig
## Sign Bias           1.5652 0.1178    
## Negative Sign Bias  1.5273 0.1269    
## Positive Sign Bias  0.2344 0.8147    
## Joint Effect        4.1850 0.2422    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     24.88       0.1646
## 2    30     24.47       0.7056
## 3    40     31.91       0.7824
## 4    50     42.56       0.7302
## 
## 
## Elapsed time : 2.335893

Garch21

XAU.garch21n.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2, 1)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "norm")
XAU.garch21n.fit <- ugarchfit(spec = XAU.garch21n.spec, data = data[, 3])

XAU.garch21t.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2, 1)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "std")
XAU.garch21t.fit <- ugarchfit(spec = XAU.garch21t.spec, data = data[, 3])
 
XAU.garch21st.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2, 1)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "sstd")
XAU.garch21st.fit <- ugarchfit(spec = XAU.garch21st.spec, data = data[, 3])

XAU.garch21g.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2, 1)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "ged")
XAU.garch21g.fit <- ugarchfit(spec = XAU.garch21g.spec, data = data[, 3])

XAU.garch21sg.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2, 1)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "sged")
XAU.garch21sg.fit <- ugarchfit(spec = XAU.garch21g.spec, data = data[, 3])

print(XAU.garch21n.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(2,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : norm 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error    t value Pr(>|t|)
## mu      0.000095    0.000091    1.04526 0.295905
## ar1     0.194290    0.000734  264.71381 0.000000
## ar2    -0.977991    0.004592 -212.97099 0.000000
## ma1    -0.192536    0.007244  -26.57887 0.000000
## ma2     0.956887    0.003359  284.85411 0.000000
## omega   0.000000    0.000001    0.88160 0.377991
## alpha1  0.026348    0.034616    0.76115 0.446569
## alpha2  0.095066    0.039683    2.39565 0.016591
## beta1   0.887843    0.017018   52.17070 0.000000
## gamma1 -0.004095    0.040178   -0.10192 0.918824
## gamma2 -0.072665    0.043781   -1.65972 0.096971
## 
## Robust Standard Errors:
##         Estimate  Std. Error     t value Pr(>|t|)
## mu      0.000095    0.000094    1.014859  0.31017
## ar1     0.194290    0.006457   30.089025  0.00000
## ar2    -0.977991    0.006149 -159.049225  0.00000
## ma1    -0.192536    0.006607  -29.141241  0.00000
## ma2     0.956887    0.004405  217.205257  0.00000
## omega   0.000000    0.000008    0.066042  0.94734
## alpha1  0.026348    0.060681    0.434197  0.66414
## alpha2  0.095066    0.162583    0.584725  0.55873
## beta1   0.887843    0.165178    5.375059  0.00000
## gamma1 -0.004095    0.055251   -0.074111  0.94092
## gamma2 -0.072665    0.130224   -0.557997  0.57685
## 
## LogLikelihood : 6089.188 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -8.3492
## Bayes        -8.3092
## Shibata      -8.3493
## Hannan-Quinn -8.3343
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.9435  0.3314
## Lag[2*(p+q)+(p+q)-1][11]    3.3845  1.0000
## Lag[4*(p+q)+(p+q)-1][19]    5.8455  0.9764
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                    0.001655  0.9675
## Lag[2*(p+q)+(p+q)-1][8]   2.470950  0.7810
## Lag[4*(p+q)+(p+q)-1][14]  3.232770  0.9417
## d.o.f=3
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[4]    0.7214 0.500 2.000  0.3957
## ARCH Lag[6]    0.9634 1.461 1.711  0.7583
## ARCH Lag[8]    1.0416 2.368 1.583  0.9181
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  263.9994
## Individual Statistics:               
## mu      0.10241
## ar1     0.05535
## ar2     0.20711
## ma1     0.04942
## ma2     0.27187
## omega  56.66848
## alpha1  0.25217
## alpha2  0.21082
## beta1   0.29061
## gamma1  0.25104
## gamma2  0.20381
## 
## 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           1.7001 0.08932   *
## Negative Sign Bias  1.3692 0.17114    
## Positive Sign Bias  0.6151 0.53855    
## Joint Effect        3.2668 0.35229    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     68.45    1.661e-07
## 2    30     77.30    2.860e-06
## 3    40     92.13    3.444e-06
## 4    50     94.96    9.091e-05
## 
## 
## Elapsed time : 1.703766
print(XAU.garch21t.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(2,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : std 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error   t value Pr(>|t|)
## mu      0.000167    0.000082   2.04782 0.040578
## ar1     0.201456    0.036264   5.55520 0.000000
## ar2    -0.949094    0.030301 -31.32256 0.000000
## ma1    -0.210178    0.046937  -4.47787 0.000008
## ma2     0.921619    0.037446  24.61194 0.000000
## omega   0.000000    0.000000   0.70747 0.479271
## alpha1  0.014903    0.045334   0.32873 0.742360
## alpha2  0.067713    0.044705   1.51466 0.129859
## beta1   0.927263    0.010917  84.93648 0.000000
## gamma1 -0.010240    0.053513  -0.19136 0.848247
## gamma2 -0.041319    0.055380  -0.74611 0.455600
## shape   4.614070    0.559064   8.25320 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error    t value Pr(>|t|)
## mu      0.000167    0.000085   1.971247 0.048696
## ar1     0.201456    0.044877   4.489112 0.000007
## ar2    -0.949094    0.032083 -29.582291 0.000000
## ma1    -0.210178    0.058453  -3.595654 0.000324
## ma2     0.921619    0.038526  23.921724 0.000000
## omega   0.000000    0.000005   0.070237 0.944005
## alpha1  0.014903    0.066777   0.223171 0.823403
## alpha2  0.067713    0.208223   0.325193 0.745035
## beta1   0.927263    0.158685   5.843430 0.000000
## gamma1 -0.010240    0.063459  -0.161365 0.871806
## gamma2 -0.041319    0.141473  -0.292066 0.770236
## shape   4.614070    2.966241   1.555528 0.119820
## 
## LogLikelihood : 6134.194 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -8.4096
## Bayes        -8.3661
## Shibata      -8.4097
## Hannan-Quinn -8.3934
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       2.486  0.1149
## Lag[2*(p+q)+(p+q)-1][11]     5.072  0.9443
## Lag[4*(p+q)+(p+q)-1][19]     7.685  0.8356
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.3262  0.5679
## Lag[2*(p+q)+(p+q)-1][8]     4.7800  0.3836
## Lag[4*(p+q)+(p+q)-1][14]    5.8478  0.6593
## d.o.f=3
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[4]     2.476 0.500 2.000  0.1156
## ARCH Lag[6]     2.685 1.461 1.711  0.3577
## ARCH Lag[8]     2.994 2.368 1.583  0.5445
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  415.9854
## Individual Statistics:                
## mu       0.23204
## ar1      0.05755
## ar2      0.33832
## ma1      0.06187
## ma2      0.45292
## omega  123.53265
## alpha1   0.20552
## alpha2   0.17033
## beta1    0.26622
## gamma1   0.23431
## gamma2   0.18664
## shape    0.18964
## 
## 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           1.6351 0.1023    
## Negative Sign Bias  0.8510 0.3949    
## Positive Sign Bias  0.9515 0.3415    
## Joint Effect        2.6951 0.4411    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     20.68       0.3550
## 2    30     25.00       0.6781
## 3    40     30.54       0.8316
## 4    50     40.43       0.8034
## 
## 
## Elapsed time : 2.266276
print(XAU.garch21st.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(2,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : sstd 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error   t value Pr(>|t|)
## mu      0.000091    0.000092   0.99666 0.318931
## ar1     0.190121    0.036040   5.27531 0.000000
## ar2    -0.953773    0.030061 -31.72822 0.000000
## ma1    -0.194557    0.047319  -4.11165 0.000039
## ma2     0.926167    0.038092  24.31418 0.000000
## omega   0.000000    0.000000   0.72663 0.467453
## alpha1  0.023245    0.048670   0.47760 0.632935
## alpha2  0.061544    0.047851   1.28617 0.198385
## beta1   0.924331    0.011344  81.48221 0.000000
## gamma1 -0.020827    0.055822  -0.37310 0.709073
## gamma2 -0.030968    0.057432  -0.53920 0.589747
## skew    0.938829    0.033118  28.34782 0.000000
## shape   4.617767    0.557100   8.28893 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error    t value Pr(>|t|)
## mu      0.000091    0.000099   0.922247 0.356400
## ar1     0.190121    0.046979   4.046912 0.000052
## ar2    -0.953773    0.037692 -25.304126 0.000000
## ma1    -0.194557    0.062715  -3.102265 0.001920
## ma2     0.926167    0.046148  20.069562 0.000000
## omega   0.000000    0.000004   0.074931 0.940269
## alpha1  0.023245    0.072337   0.321338 0.747954
## alpha2  0.061544    0.203650   0.302204 0.762496
## beta1   0.924331    0.158586   5.828588 0.000000
## gamma1 -0.020827    0.068425  -0.304384 0.760835
## gamma2 -0.030968    0.140017  -0.221172 0.824959
## skew    0.938829    0.033449  28.067552 0.000000
## shape   4.617767    2.611525   1.768227 0.077023
## 
## LogLikelihood : 6135.821 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -8.4105
## Bayes        -8.3633
## Shibata      -8.4106
## Hannan-Quinn -8.3929
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       1.981  0.1593
## Lag[2*(p+q)+(p+q)-1][11]     4.661  0.9913
## Lag[4*(p+q)+(p+q)-1][19]     7.283  0.8813
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.2323  0.6298
## Lag[2*(p+q)+(p+q)-1][8]     4.5646  0.4155
## Lag[4*(p+q)+(p+q)-1][14]    5.5675  0.6966
## d.o.f=3
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[4]     2.268 0.500 2.000  0.1321
## ARCH Lag[6]     2.438 1.461 1.711  0.4016
## ARCH Lag[8]     2.697 2.368 1.583  0.6014
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  414.9671
## Individual Statistics:                
## mu       0.24114
## ar1      0.05389
## ar2      0.33816
## ma1      0.06446
## ma2      0.41970
## omega  121.72962
## alpha1   0.20550
## alpha2   0.17425
## beta1    0.25537
## gamma1   0.22713
## gamma2   0.18356
## skew     0.39144
## shape    0.18194
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          2.89 3.15 3.69
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                    t-value   prob sig
## Sign Bias           1.5054 0.1324    
## Negative Sign Bias  0.7912 0.4289    
## Positive Sign Bias  0.7109 0.4772    
## Joint Effect        2.2762 0.5171    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     22.43       0.2632
## 2    30     20.14       0.8885
## 3    40     37.90       0.5199
## 4    50     38.64       0.8559
## 
## 
## Elapsed time : 3.045832
print(XAU.garch21g.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(2,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : ged 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error   t value Pr(>|t|)
## mu      0.000183    0.000077   2.38846 0.016919
## ar1     0.208046    0.014166  14.68586 0.000000
## ar2    -0.950826    0.011829 -80.37943 0.000000
## ma1    -0.213250    0.017967 -11.86908 0.000000
## ma2     0.919762    0.014828  62.02728 0.000000
## omega   0.000000    0.000001   0.41998 0.674501
## alpha1  0.018686    0.042115   0.44370 0.657261
## alpha2  0.075208    0.034954   2.15163 0.031426
## beta1   0.913390    0.025093  36.40035 0.000000
## gamma1 -0.006427    0.049297  -0.13037 0.896273
## gamma2 -0.054457    0.048398  -1.12518 0.260513
## shape   1.232940    0.029595  41.66072 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error     t value Pr(>|t|)
## mu      0.000183    0.000076    2.398490 0.016463
## ar1     0.208046    0.009096   22.873043 0.000000
## ar2    -0.950826    0.006411 -148.320489 0.000000
## ma1    -0.213250    0.014634  -14.571790 0.000000
## ma2     0.919762    0.013198   69.690407 0.000000
## omega   0.000000    0.000017    0.023634 0.981145
## alpha1  0.018686    0.119065    0.156942 0.875291
## alpha2  0.075208    0.538691    0.139612 0.888967
## beta1   0.913390    0.495664    1.842762 0.065364
## gamma1 -0.006427    0.064632   -0.099438 0.920790
## gamma2 -0.054457    0.361751   -0.150537 0.880341
## shape   1.232940    0.947024    1.301910 0.192947
## 
## LogLikelihood : 6135.996 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -8.4121
## Bayes        -8.3685
## Shibata      -8.4122
## Hannan-Quinn -8.3958
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       1.881  0.1702
## Lag[2*(p+q)+(p+q)-1][11]     4.750  0.9862
## Lag[4*(p+q)+(p+q)-1][19]     7.440  0.8645
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.1141  0.7356
## Lag[2*(p+q)+(p+q)-1][8]     3.7583  0.5481
## Lag[4*(p+q)+(p+q)-1][14]    4.6823  0.8077
## d.o.f=3
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[4]     1.926 0.500 2.000  0.1652
## ARCH Lag[6]     2.096 1.461 1.711  0.4700
## ARCH Lag[8]     2.283 2.368 1.583  0.6842
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  389.2474
## Individual Statistics:               
## mu      0.14830
## ar1     0.04840
## ar2     0.29217
## ma1     0.04777
## ma2     0.40633
## omega  99.13800
## alpha1  0.24415
## alpha2  0.20464
## beta1   0.31806
## gamma1  0.26240
## gamma2  0.21218
## shape   0.10029
## 
## 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           1.5473 0.1220    
## Negative Sign Bias  1.0232 0.3064    
## Positive Sign Bias  0.7625 0.4459    
## Joint Effect        2.4838 0.4782    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     26.03       0.1293
## 2    30     22.53       0.7976
## 3    40     37.85       0.5224
## 4    50     51.35       0.3818
## 
## 
## Elapsed time : 4.387095
print(XAU.garch21sg.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(2,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : ged 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error   t value Pr(>|t|)
## mu      0.000183    0.000077   2.38846 0.016919
## ar1     0.208046    0.014166  14.68586 0.000000
## ar2    -0.950826    0.011829 -80.37943 0.000000
## ma1    -0.213250    0.017967 -11.86908 0.000000
## ma2     0.919762    0.014828  62.02728 0.000000
## omega   0.000000    0.000001   0.41998 0.674501
## alpha1  0.018686    0.042115   0.44370 0.657261
## alpha2  0.075208    0.034954   2.15163 0.031426
## beta1   0.913390    0.025093  36.40035 0.000000
## gamma1 -0.006427    0.049297  -0.13037 0.896273
## gamma2 -0.054457    0.048398  -1.12518 0.260513
## shape   1.232940    0.029595  41.66072 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error     t value Pr(>|t|)
## mu      0.000183    0.000076    2.398490 0.016463
## ar1     0.208046    0.009096   22.873043 0.000000
## ar2    -0.950826    0.006411 -148.320489 0.000000
## ma1    -0.213250    0.014634  -14.571790 0.000000
## ma2     0.919762    0.013198   69.690407 0.000000
## omega   0.000000    0.000017    0.023634 0.981145
## alpha1  0.018686    0.119065    0.156942 0.875291
## alpha2  0.075208    0.538691    0.139612 0.888967
## beta1   0.913390    0.495664    1.842762 0.065364
## gamma1 -0.006427    0.064632   -0.099438 0.920790
## gamma2 -0.054457    0.361751   -0.150537 0.880341
## shape   1.232940    0.947024    1.301910 0.192947
## 
## LogLikelihood : 6135.996 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -8.4121
## Bayes        -8.3685
## Shibata      -8.4122
## Hannan-Quinn -8.3958
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       1.881  0.1702
## Lag[2*(p+q)+(p+q)-1][11]     4.750  0.9862
## Lag[4*(p+q)+(p+q)-1][19]     7.440  0.8645
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.1141  0.7356
## Lag[2*(p+q)+(p+q)-1][8]     3.7583  0.5481
## Lag[4*(p+q)+(p+q)-1][14]    4.6823  0.8077
## d.o.f=3
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[4]     1.926 0.500 2.000  0.1652
## ARCH Lag[6]     2.096 1.461 1.711  0.4700
## ARCH Lag[8]     2.283 2.368 1.583  0.6842
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  389.2474
## Individual Statistics:               
## mu      0.14830
## ar1     0.04840
## ar2     0.29217
## ma1     0.04777
## ma2     0.40633
## omega  99.13800
## alpha1  0.24415
## alpha2  0.20464
## beta1   0.31806
## gamma1  0.26240
## gamma2  0.21218
## shape   0.10029
## 
## 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           1.5473 0.1220    
## Negative Sign Bias  1.0232 0.3064    
## Positive Sign Bias  0.7625 0.4459    
## Joint Effect        2.4838 0.4782    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     26.03       0.1293
## 2    30     22.53       0.7976
## 3    40     37.85       0.5224
## 4    50     51.35       0.3818
## 
## 
## Elapsed time : 4.38931

Garch22

XAU.garch22n.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2, 2)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "norm")
XAU.garch22n.fit <- ugarchfit(spec = XAU.garch22n.spec, data = data[, 3])

XAU.garch22t.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2, 2)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "std")
XAU.garch22t.fit <- ugarchfit(spec = XAU.garch22t.spec, data = data[, 3])
 
XAU.garch22st.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2, 2)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "sstd")
XAU.garch22st.fit <- ugarchfit(spec = XAU.garch22st.spec, data = data[, 3])

XAU.garch22g.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2, 2)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "ged")
XAU.garch22g.fit <- ugarchfit(spec = XAU.garch22g.spec, data = data[, 3])

XAU.garch22sg.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2, 2)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "sged")
XAU.garch22sg.fit <- ugarchfit(spec = XAU.garch22g.spec, data = data[, 3])


print(XAU.garch22n.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(2,2)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : norm 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error   t value Pr(>|t|)
## mu      0.000094    0.000091   1.03398 0.301147
## ar1     0.193973    0.029806   6.50792 0.000000
## ar2    -0.980198    0.012730 -77.00203 0.000000
## ma1    -0.192377    0.042508  -4.52568 0.000006
## ma2     0.959263    0.014046  68.29626 0.000000
## omega   0.000001    0.000001   1.23524 0.216740
## alpha1  0.006635    0.030282   0.21911 0.826566
## alpha2  0.173230    0.039258   4.41261 0.000010
## beta1   0.258787    0.118432   2.18511 0.028881
## beta2   0.569285    0.113065   5.03505 0.000000
## gamma1  0.013813    0.034388   0.40167 0.687924
## gamma2 -0.123536    0.042719  -2.89184 0.003830
## 
## Robust Standard Errors:
##         Estimate  Std. Error   t value Pr(>|t|)
## mu      0.000094    0.000093   1.01380 0.310678
## ar1     0.193973    0.069148   2.80518 0.005029
## ar2    -0.980198    0.026357 -37.18971 0.000000
## ma1    -0.192377    0.099009  -1.94302 0.052014
## ma2     0.959263    0.029986  31.99089 0.000000
## omega   0.000001    0.000006   0.13350 0.893799
## alpha1  0.006635    0.059093   0.11228 0.910602
## alpha2  0.173230    0.115561   1.49904 0.133864
## beta1   0.258787    0.168256   1.53806 0.124034
## beta2   0.569285    0.136358   4.17493 0.000030
## gamma1  0.013813    0.050745   0.27220 0.785467
## gamma2 -0.123536    0.083713  -1.47570 0.140024
## 
## LogLikelihood : 6092.022 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -8.3517
## Bayes        -8.3081
## Shibata      -8.3518
## Hannan-Quinn -8.3354
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.9911  0.3195
## Lag[2*(p+q)+(p+q)-1][11]    3.5403  1.0000
## Lag[4*(p+q)+(p+q)-1][19]    6.0016  0.9707
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.1941  0.6595
## Lag[2*(p+q)+(p+q)-1][11]    0.9830  0.9967
## Lag[4*(p+q)+(p+q)-1][19]    2.0166  0.9995
## d.o.f=4
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[5]   0.01693 0.500 2.000  0.8965
## ARCH Lag[7]   0.20351 1.473 1.746  0.9698
## ARCH Lag[9]   0.28817 2.402 1.619  0.9953
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  188.3737
## Individual Statistics:               
## mu      0.09115
## ar1     0.07143
## ar2     0.18071
## ma1     0.07689
## ma2     0.23059
## omega  30.97011
## alpha1  0.26767
## alpha2  0.20724
## beta1   0.28937
## beta2   0.30827
## gamma1  0.28797
## gamma2  0.20117
## 
## 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           1.5581 0.1194    
## Negative Sign Bias  1.1530 0.2491    
## Positive Sign Bias  0.8986 0.3690    
## Joint Effect        2.6912 0.4417    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     65.95    4.275e-07
## 2    30     86.24    1.365e-07
## 3    40     91.69    3.939e-06
## 4    50    109.73    1.511e-06
## 
## 
## Elapsed time : 1.922106
print(XAU.garch22t.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(2,2)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : std 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error    t value Pr(>|t|)
## mu      0.000176    0.000081   2.156841 0.031018
## ar1     0.202455    0.035486   5.705154 0.000000
## ar2    -0.951742    0.028452 -33.450635 0.000000
## ma1    -0.211764    0.045812  -4.622402 0.000004
## ma2     0.924806    0.035785  25.843474 0.000000
## omega   0.000001    0.000001   0.916168 0.359579
## alpha1  0.000001    0.030568   0.000022 0.999982
## alpha2  0.150151    0.030602   4.906582 0.000001
## beta1   0.161332    0.132896   1.213971 0.224759
## beta2   0.707192    0.142223   4.972431 0.000001
## gamma1  0.019074    0.037415   0.509800 0.610191
## gamma2 -0.114736    0.039834  -2.880359 0.003972
## shape   4.599626    0.516276   8.909234 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error    t value Pr(>|t|)
## mu      0.000176    0.000082   2.146989 0.031794
## ar1     0.202455    0.046693   4.335890 0.000015
## ar2    -0.951742    0.028976 -32.845985 0.000000
## ma1    -0.211764    0.060457  -3.502702 0.000461
## ma2     0.924806    0.036040  25.660520 0.000000
## omega   0.000001    0.000005   0.121373 0.903396
## alpha1  0.000001    0.135840   0.000005 0.999996
## alpha2  0.150151    0.228120   0.658211 0.510403
## beta1   0.161332    0.736423   0.219075 0.826592
## beta2   0.707192    0.517021   1.367820 0.171368
## gamma1  0.019074    0.043740   0.436081 0.662778
## gamma2 -0.114736    0.197778  -0.580127 0.561829
## shape   4.599626    2.751687   1.671566 0.094610
## 
## LogLikelihood : 6136.927 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -8.4120
## Bayes        -8.3648
## Shibata      -8.4121
## Hannan-Quinn -8.3944
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       2.387  0.1223
## Lag[2*(p+q)+(p+q)-1][11]     5.091  0.9404
## Lag[4*(p+q)+(p+q)-1][19]     7.747  0.8279
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.3089  0.5784
## Lag[2*(p+q)+(p+q)-1][11]    2.8137  0.8898
## Lag[4*(p+q)+(p+q)-1][19]    4.1117  0.9751
## d.o.f=4
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[5]    0.1336 0.500 2.000  0.7147
## ARCH Lag[7]    1.0458 1.473 1.746  0.7445
## ARCH Lag[9]    1.1798 2.402 1.619  0.9052
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  354.5176
## Individual Statistics:               
## mu      0.20754
## ar1     0.07258
## ar2     0.30597
## ma1     0.07527
## ma2     0.40421
## omega  68.46700
## alpha1  0.27582
## alpha2  0.17837
## beta1   0.27797
## beta2   0.30094
## gamma1  0.30853
## gamma2  0.17511
## shape   0.22029
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          2.89 3.15 3.69
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                    t-value   prob sig
## Sign Bias            1.598 0.1103    
## Negative Sign Bias   1.067 0.2860    
## Positive Sign Bias   1.132 0.2580    
## Joint Effect         2.895 0.4082    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     20.26       0.3789
## 2    30     24.38       0.7097
## 3    40     33.01       0.7388
## 4    50     50.73       0.4052
## 
## 
## Elapsed time : 2.573189
print(XAU.garch22st.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(2,2)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : sstd 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error    t value Pr(>|t|)
## mu      0.000102    0.000091   1.111092 0.266529
## ar1     0.193873    0.033961   5.708693 0.000000
## ar2    -0.953885    0.029018 -32.871866 0.000000
## ma1    -0.200492    0.044642  -4.491155 0.000007
## ma2     0.926319    0.036583  25.321364 0.000000
## omega   0.000001    0.000001   0.931240 0.351729
## alpha1  0.000045    0.029771   0.001513 0.998793
## alpha2  0.150230    0.029014   5.177872 0.000000
## beta1   0.164821    0.131052   1.257681 0.208507
## beta2   0.702377    0.140215   5.009299 0.000001
## gamma1  0.019032    0.036827   0.516784 0.605307
## gamma2 -0.114029    0.038547  -2.958150 0.003095
## skew    0.938658    0.033241  28.237656 0.000000
## shape   4.648304    0.537252   8.652000 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error    t value Pr(>|t|)
## mu      0.000102    0.000096   1.060064 0.289116
## ar1     0.193873    0.044006   4.405563 0.000011
## ar2    -0.953885    0.031875 -29.925416 0.000000
## ma1    -0.200492    0.058657  -3.418068 0.000631
## ma2     0.926319    0.038833  23.853716 0.000000
## omega   0.000001    0.000005   0.125588 0.900058
## alpha1  0.000045    0.125434   0.000359 0.999713
## alpha2  0.150230    0.226215   0.664103 0.506625
## beta1   0.164821    0.717689   0.229656 0.818359
## beta2   0.702377    0.503236   1.395720 0.162799
## gamma1  0.019032    0.052483   0.362624 0.716885
## gamma2 -0.114029    0.206331  -0.552652 0.580502
## skew    0.938658    0.031816  29.502535 0.000000
## shape   4.648304    2.636690   1.762932 0.077912
## 
## LogLikelihood : 6138.512 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -8.4128
## Bayes        -8.3620
## Shibata      -8.4130
## Hannan-Quinn -8.3938
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       2.090  0.1482
## Lag[2*(p+q)+(p+q)-1][11]     4.874  0.9753
## Lag[4*(p+q)+(p+q)-1][19]     7.547  0.8523
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.2915  0.5893
## Lag[2*(p+q)+(p+q)-1][11]    2.7873  0.8927
## Lag[4*(p+q)+(p+q)-1][19]    4.0778  0.9761
## d.o.f=4
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[5]    0.1633 0.500 2.000  0.6861
## ARCH Lag[7]    1.0696 1.473 1.746  0.7379
## ARCH Lag[9]    1.2018 2.402 1.619  0.9018
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  356.7794
## Individual Statistics:               
## mu      0.20391
## ar1     0.08672
## ar2     0.31705
## ma1     0.09877
## ma2     0.39837
## omega  69.76473
## alpha1  0.26571
## alpha2  0.18651
## beta1   0.27850
## beta2   0.30068
## gamma1  0.29208
## gamma2  0.18123
## skew    0.36676
## shape   0.22657
## 
## 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.525 0.1275    
## Negative Sign Bias   1.061 0.2891    
## Positive Sign Bias   1.071 0.2841    
## Joint Effect         2.674 0.4446    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     17.90       0.5291
## 2    30     17.87       0.9468
## 3    40     37.08       0.5579
## 4    50     40.43       0.8034
## 
## 
## Elapsed time : 3.51786
print(XAU.garch22g.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(2,2)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : ged 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error    t value Pr(>|t|)
## mu      0.000176    0.000089   1.964712 0.049448
## ar1     0.207003    0.011185  18.507388 0.000000
## ar2    -0.953014    0.011582 -82.281821 0.000000
## ma1    -0.212996    0.014477 -14.712881 0.000000
## ma2     0.922289    0.014694  62.765824 0.000000
## omega   0.000001    0.000002   0.340910 0.733171
## alpha1  0.000155    0.020936   0.007419 0.994080
## alpha2  0.153430    0.048280   3.177906 0.001483
## beta1   0.220285    0.033345   6.606197 0.000000
## beta2   0.638611    0.118717   5.379260 0.000000
## gamma1  0.015488    0.038456   0.402747 0.687134
## gamma2 -0.114706    0.016169  -7.094165 0.000000
## shape   1.236551    0.054940  22.507188 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error     t value Pr(>|t|)
## mu      0.000176    0.000136    1.288739  0.19749
## ar1     0.207003    0.011916   17.372548  0.00000
## ar2    -0.953014    0.005610 -169.875363  0.00000
## ma1    -0.212996    0.007621  -27.949488  0.00000
## ma2     0.922289    0.017379   53.068179  0.00000
## omega   0.000001    0.000039    0.016332  0.98697
## alpha1  0.000155    0.530460    0.000293  0.99977
## alpha2  0.153430    1.333935    0.115020  0.90843
## beta1   0.220285    2.872393    0.076690  0.93887
## beta2   0.638611    1.384399    0.461291  0.64459
## gamma1  0.015488    0.040636    0.381142  0.70310
## gamma2 -0.114706    0.934143   -0.122793  0.90227
## shape   1.236551    1.712930    0.721892  0.47036
## 
## LogLikelihood : 6138.273 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -8.4138
## Bayes        -8.3667
## Shibata      -8.4140
## Hannan-Quinn -8.3962
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       1.978  0.1596
## Lag[2*(p+q)+(p+q)-1][11]     4.940  0.9671
## Lag[4*(p+q)+(p+q)-1][19]     7.643  0.8408
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.4038  0.5251
## Lag[2*(p+q)+(p+q)-1][11]    2.0484  0.9573
## Lag[4*(p+q)+(p+q)-1][19]    3.2080  0.9929
## d.o.f=4
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[5]   0.01649 0.500 2.000  0.8978
## ARCH Lag[7]   0.59250 1.473 1.746  0.8720
## ARCH Lag[9]   0.67022 2.402 1.619  0.9698
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  331.5984
## Individual Statistics:               
## mu      0.15888
## ar1     0.08463
## ar2     0.27350
## ma1     0.07843
## ma2     0.37258
## omega  60.58513
## alpha1  0.27723
## alpha2  0.19546
## beta1   0.29713
## beta2   0.31509
## gamma1  0.30901
## gamma2  0.19094
## shape   0.09036
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          2.89 3.15 3.69
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                    t-value   prob sig
## Sign Bias           1.4359 0.1512    
## Negative Sign Bias  0.9581 0.3382    
## Positive Sign Bias  1.0120 0.3117    
## Joint Effect        2.3314 0.5065    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     32.54      0.02712
## 2    30     32.21      0.31055
## 3    40     47.85      0.15653
## 4    50     45.99      0.59583
## 
## 
## Elapsed time : 4.519516
print(XAU.garch22sg.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(2,2)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : ged 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error    t value Pr(>|t|)
## mu      0.000176    0.000089   1.964712 0.049448
## ar1     0.207003    0.011185  18.507388 0.000000
## ar2    -0.953014    0.011582 -82.281821 0.000000
## ma1    -0.212996    0.014477 -14.712881 0.000000
## ma2     0.922289    0.014694  62.765824 0.000000
## omega   0.000001    0.000002   0.340910 0.733171
## alpha1  0.000155    0.020936   0.007419 0.994080
## alpha2  0.153430    0.048280   3.177906 0.001483
## beta1   0.220285    0.033345   6.606197 0.000000
## beta2   0.638611    0.118717   5.379260 0.000000
## gamma1  0.015488    0.038456   0.402747 0.687134
## gamma2 -0.114706    0.016169  -7.094165 0.000000
## shape   1.236551    0.054940  22.507188 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error     t value Pr(>|t|)
## mu      0.000176    0.000136    1.288739  0.19749
## ar1     0.207003    0.011916   17.372548  0.00000
## ar2    -0.953014    0.005610 -169.875363  0.00000
## ma1    -0.212996    0.007621  -27.949488  0.00000
## ma2     0.922289    0.017379   53.068179  0.00000
## omega   0.000001    0.000039    0.016332  0.98697
## alpha1  0.000155    0.530460    0.000293  0.99977
## alpha2  0.153430    1.333935    0.115020  0.90843
## beta1   0.220285    2.872393    0.076690  0.93887
## beta2   0.638611    1.384399    0.461291  0.64459
## gamma1  0.015488    0.040636    0.381142  0.70310
## gamma2 -0.114706    0.934143   -0.122793  0.90227
## shape   1.236551    1.712930    0.721892  0.47036
## 
## LogLikelihood : 6138.273 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -8.4138
## Bayes        -8.3667
## Shibata      -8.4140
## Hannan-Quinn -8.3962
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       1.978  0.1596
## Lag[2*(p+q)+(p+q)-1][11]     4.940  0.9671
## Lag[4*(p+q)+(p+q)-1][19]     7.643  0.8408
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.4038  0.5251
## Lag[2*(p+q)+(p+q)-1][11]    2.0484  0.9573
## Lag[4*(p+q)+(p+q)-1][19]    3.2080  0.9929
## d.o.f=4
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[5]   0.01649 0.500 2.000  0.8978
## ARCH Lag[7]   0.59250 1.473 1.746  0.8720
## ARCH Lag[9]   0.67022 2.402 1.619  0.9698
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  331.5984
## Individual Statistics:               
## mu      0.15888
## ar1     0.08463
## ar2     0.27350
## ma1     0.07843
## ma2     0.37258
## omega  60.58513
## alpha1  0.27723
## alpha2  0.19546
## beta1   0.29713
## beta2   0.31509
## gamma1  0.30901
## gamma2  0.19094
## shape   0.09036
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          2.89 3.15 3.69
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                    t-value   prob sig
## Sign Bias           1.4359 0.1512    
## Negative Sign Bias  0.9581 0.3382    
## Positive Sign Bias  1.0120 0.3117    
## Joint Effect        2.3314 0.5065    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     32.54      0.02712
## 2    30     32.21      0.31055
## 3    40     47.85      0.15653
## 4    50     45.99      0.59583
## 
## 
## Elapsed time : 4.584688

Ước lượng cho chuỗi VNI

Garch11

VNI.garch11n.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "norm")
VNI.garch11n.fit <- ugarchfit(spec = VNI.garch11n.spec, data = data[, 2])

VNI.garch11t.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "std")
VNI.garch11t.fit <- ugarchfit(spec = VNI.garch11t.spec, data = data[, 2])
 
VNI.garch11st.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "sstd")
VNI.garch11st.fit <- ugarchfit(spec = VNI.garch11st.spec, data = data[, 2])

VNI.garch11g.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "ged")
VNI.garch11g.fit <- ugarchfit(spec = VNI.garch11g.spec, data = data[, 2])

VNI.garch11sg.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 1)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "sged")
VNI.garch11sg.fit <- ugarchfit(spec = VNI.garch11sg.spec, data = data[, 2])

print(VNI.garch11n.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(1,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : norm 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error    t value Pr(>|t|)
## mu     -0.000003    0.000003    -1.0491 0.294152
## ar1    -0.343553    0.029695   -11.5696 0.000000
## ar2     0.069775    0.029536     2.3624 0.018158
## ma1    -0.566212    0.000294 -1923.6895 0.000000
## ma2    -0.397267    0.000104 -3832.2267 0.000000
## omega   0.000001    0.000000     3.3765 0.000734
## alpha1  0.012469    0.005628     2.2157 0.026715
## beta1   0.876144    0.009637    90.9170 0.000000
## gamma1  0.135127    0.020536     6.5799 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error    t value Pr(>|t|)
## mu     -0.000003    0.000007   -0.46094 0.644842
## ar1    -0.343553    0.032244  -10.65483 0.000000
## ar2     0.069775    0.032073    2.17551 0.029592
## ma1    -0.566212    0.000576 -982.74020 0.000000
## ma2    -0.397267    0.000507 -782.98721 0.000000
## omega   0.000001    0.000002    0.51429 0.607050
## alpha1  0.012469    0.061467    0.20286 0.839242
## beta1   0.876144    0.010655   82.22620 0.000000
## gamma1  0.135127    0.066756    2.02421 0.042949
## 
## LogLikelihood : 5623.181 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -7.7118
## Bayes        -7.6791
## Shibata      -7.7119
## Hannan-Quinn -7.6996
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.1609  0.6883
## Lag[2*(p+q)+(p+q)-1][11]    1.6646  1.0000
## Lag[4*(p+q)+(p+q)-1][19]    4.2644  0.9988
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                         statistic p-value
## Lag[1]                    0.04302  0.8357
## Lag[2*(p+q)+(p+q)-1][5]   0.30110  0.9836
## Lag[4*(p+q)+(p+q)-1][9]   1.01114  0.9858
## d.o.f=2
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[3]    0.2515 0.500 2.000  0.6160
## ARCH Lag[5]    0.3841 1.440 1.667  0.9172
## ARCH Lag[7]    0.5929 2.315 1.543  0.9692
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  5.2131
## Individual Statistics:              
## mu     0.18428
## ar1    0.05301
## ar2    0.39377
## ma1    0.16005
## ma2    0.21255
## omega  0.84062
## alpha1 0.18961
## beta1  0.09532
## gamma1 0.08173
## 
## 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.3600 0.1740    
## Negative Sign Bias  0.3198 0.7491    
## Positive Sign Bias  0.8872 0.3751    
## Joint Effect        6.0620 0.1086    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     125.8    8.892e-18
## 2    30     135.6    1.031e-15
## 3    40     177.6    1.388e-19
## 4    50     178.3    1.397e-16
## 
## 
## Elapsed time : 0.9788561
print(VNI.garch11t.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(1,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : std 
## 
## Convergence Problem:
## Solver Message:
print(VNI.garch11st.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(1,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : sstd 
## 
## Convergence Problem:
## Solver Message:
print(VNI.garch11g.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(1,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : ged 
## 
## Convergence Problem:
## Solver Message:
print(VNI.garch11sg.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(1,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : sged 
## 
## Convergence Problem:
## Solver Message:

Garch12

VNI.garch12n.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 2)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "norm")
VNI.garch12n.fit <- ugarchfit(spec = VNI.garch12n.spec, data = data[, 2])

VNI.garch12t.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 2)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "std")
VNI.garch12t.fit <- ugarchfit(spec = VNI.garch12t.spec, data = data[, 2])
 
VNI.garch12st.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 2)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "sstd")
VNI.garch12st.fit <- ugarchfit(spec = VNI.garch12st.spec, data = data[, 2])

VNI.garch12g.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 2)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "ged")
VNI.garch12g.fit <- ugarchfit(spec = VNI.garch12g.spec, data = data[, 2])

VNI.garch12sg.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(1, 2)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "sged")
VNI.garch12sg.fit <- ugarchfit(spec = VNI.garch12sg.spec, data = data[, 2])

print(VNI.garch12n.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(1,2)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : norm 
## 
## Convergence Problem:
## Solver Message:
print(VNI.garch12t.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(1,2)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : std 
## 
## Convergence Problem:
## Solver Message:
print(VNI.garch12st.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(1,2)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : sstd 
## 
## Convergence Problem:
## Solver Message:
print(VNI.garch12g.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(1,2)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : ged 
## 
## Convergence Problem:
## Solver Message:
print(VNI.garch12sg.fit)
## 
## *---------------------------------*
## *          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     -0.000004    0.000000  -13.90189  0.00000
## ar1    -0.517914    0.014260  -36.31814  0.00000
## ar2     0.025232    0.016865    1.49615  0.13461
## ma1    -0.454202    0.000778 -583.55143  0.00000
## ma2    -0.505516    0.000758 -667.07936  0.00000
## omega   0.000001    0.000006    0.24951  0.80297
## alpha1  0.034149    0.093371    0.36573  0.71457
## beta1   0.633997    0.048078   13.18679  0.00000
## beta2   0.190418    0.022175    8.58713  0.00000
## gamma1  0.171236    0.155098    1.10405  0.26957
## skew    0.858082    0.023235   36.92994  0.00000
## shape   1.125937    0.054339   20.72044  0.00000
## 
## Robust Standard Errors:
##         Estimate  Std. Error    t value Pr(>|t|)
## mu     -0.000004    0.000096  -0.041922 0.966561
## ar1    -0.517914    0.788919  -0.656486 0.511512
## ar2     0.025232    0.671034   0.037602 0.970005
## ma1    -0.454202    0.016909 -26.860796 0.000000
## ma2    -0.505516    0.013964 -36.200489 0.000000
## omega   0.000001    0.000183   0.007917 0.993684
## alpha1  0.034149    3.024565   0.011290 0.990992
## beta1   0.633997    1.702291   0.372437 0.709567
## beta2   0.190418    0.070653   2.695136 0.007036
## gamma1  0.171236    5.036706   0.033998 0.972879
## skew    0.858082    0.051757  16.578967 0.000000
## shape   1.125937    0.220461   5.107189 0.000000
## 
## LogLikelihood : 5737.164 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -7.8642
## Bayes        -7.8207
## Shibata      -7.8644
## Hannan-Quinn -7.8480
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       3.087 0.07894
## Lag[2*(p+q)+(p+q)-1][11]     4.624 0.99286
## Lag[4*(p+q)+(p+q)-1][19]     6.766 0.92737
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.6962  0.4041
## Lag[2*(p+q)+(p+q)-1][8]     1.6441  0.9095
## Lag[4*(p+q)+(p+q)-1][14]    4.2894  0.8513
## d.o.f=3
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[4]    0.2391 0.500 2.000  0.6249
## ARCH Lag[6]    0.3726 1.461 1.711  0.9267
## ARCH Lag[8]    1.6701 2.368 1.583  0.8072
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  43.9813
## Individual Statistics:              
## mu     0.12391
## ar1    0.11358
## ar2    0.11856
## ma1    0.21827
## ma2    0.21413
## omega  5.14888
## alpha1 0.21126
## beta1  0.14111
## beta2  0.14373
## gamma1 0.16412
## skew   0.08672
## shape  0.07903
## 
## 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           1.9412 0.05243   *
## Negative Sign Bias  1.4411 0.14976    
## Positive Sign Bias  0.8525 0.39409    
## Joint Effect        8.0983 0.04402  **
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     21.28       0.3215
## 2    30     38.02       0.1218
## 3    40     48.51       0.1415
## 4    50     55.88       0.2322
## 
## 
## Elapsed time : 3.798047

Garch21

VNI.garch21n.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2, 1)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "norm")
VNI.garch21n.fit <- ugarchfit(spec = VNI.garch21n.spec, data = data[, 2])

VNI.garch21t.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2, 1)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "std")
VNI.garch21t.fit <- ugarchfit(spec = VNI.garch21t.spec, data = data[, 2])
 
VNI.garch21st.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2, 1)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "sstd")
VNI.garch21st.fit <- ugarchfit(spec = VNI.garch21st.spec, data = data[, 2])

VNI.garch21g.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2, 1)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "ged")
VNI.garch21g.fit <- ugarchfit(spec = VNI.garch21g.spec, data = data[, 2])

VNI.garch21sg.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2, 1)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "sged")
VNI.garch21sg.fit <- ugarchfit(spec = VNI.garch21sg.spec, data = data[, 2])

print(VNI.garch21n.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(2,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : norm 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error     t value Pr(>|t|)
## mu     -0.000003    0.000003 -1.0630e+00 0.287798
## ar1    -0.438523    0.030369 -1.4440e+01 0.000000
## ar2     0.076226    0.029017  2.6269e+00 0.008616
## ma1    -0.472096    0.000231 -2.0406e+03 0.000000
## ma2    -0.495979    0.000226 -2.1928e+03 0.000000
## omega   0.000001    0.000001  1.5002e+00 0.133553
## alpha1  0.000001    0.046459  2.1000e-05 0.999983
## alpha2  0.022825    0.049307  4.6291e-01 0.643430
## beta1   0.887626    0.010145  8.7492e+01 0.000000
## gamma1  0.242035    0.071945  3.3642e+00 0.000768
## gamma2 -0.135452    0.069968 -1.9359e+00 0.052880
## 
## Robust Standard Errors:
##         Estimate  Std. Error     t value Pr(>|t|)
## mu     -0.000003    0.000012 -2.4610e-01  0.80560
## ar1    -0.438523    0.076561 -5.7278e+00  0.00000
## ar2     0.076226    0.064111  1.1890e+00  0.23445
## ma1    -0.472096    0.000528 -8.9372e+02  0.00000
## ma2    -0.495979    0.000492 -1.0082e+03  0.00000
## omega   0.000001    0.000009  1.0755e-01  0.91435
## alpha1  0.000001    0.346371  3.0000e-06  1.00000
## alpha2  0.022825    0.142570  1.6009e-01  0.87281
## beta1   0.887626    0.019372  4.5821e+01  0.00000
## gamma1  0.242035    0.353489  6.8471e-01  0.49353
## gamma2 -0.135452    0.140483 -9.6418e-01  0.33495
## 
## LogLikelihood : 5626.752 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -7.7139
## Bayes        -7.6740
## Shibata      -7.7141
## Hannan-Quinn -7.6991
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                     0.02245  0.8809
## Lag[2*(p+q)+(p+q)-1][11]   2.10744  1.0000
## Lag[4*(p+q)+(p+q)-1][19]   4.61017  0.9974
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       0.800  0.3711
## Lag[2*(p+q)+(p+q)-1][8]      1.396  0.9389
## Lag[4*(p+q)+(p+q)-1][14]     4.054  0.8751
## d.o.f=3
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[4]    0.1022 0.500 2.000  0.7492
## ARCH Lag[6]    0.1547 1.461 1.711  0.9781
## ARCH Lag[8]    1.1388 2.368 1.583  0.9029
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  26.2358
## Individual Statistics:              
## mu     0.18984
## ar1    0.08391
## ar2    0.46571
## ma1    0.20525
## ma2    0.30275
## omega  3.08485
## alpha1 0.14861
## alpha2 0.08547
## beta1  0.06126
## gamma1 0.05122
## gamma2 0.04176
## 
## 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           1.8374 0.06635   *
## Negative Sign Bias  1.3399 0.18049    
## Positive Sign Bias  0.5483 0.58357    
## Joint Effect        6.3071 0.09759   *
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     122.8    3.328e-17
## 2    30     135.6    1.031e-15
## 3    40     150.8    4.575e-15
## 4    50     167.3    7.800e-15
## 
## 
## Elapsed time : 0.898603
print(VNI.garch21t.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(2,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : std 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error     t value Pr(>|t|)
## mu      0.000004    0.000002  2.0179e+00 0.043601
## ar1    -0.288331    0.029760 -9.6886e+00 0.000000
## ar2     0.061634    0.026289  2.3445e+00 0.019053
## ma1    -0.651611    0.000112 -5.8012e+03 0.000000
## ma2    -0.324252    0.000257 -1.2619e+03 0.000000
## omega   0.000001    0.000001  8.7233e-01 0.383031
## alpha1  0.000018    0.104502  1.7500e-04 0.999860
## alpha2  0.037914    0.098746  3.8396e-01 0.701011
## beta1   0.843354    0.033078  2.5496e+01 0.000000
## gamma1  0.364868    0.131784  2.7687e+00 0.005628
## gamma2 -0.197878    0.115534 -1.7127e+00 0.086762
## shape   3.832555    0.421594  9.0906e+00 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error     t value Pr(>|t|)
## mu      0.000004    0.000002  2.0490e+00 0.040463
## ar1    -0.288331    0.058096 -4.9630e+00 0.000001
## ar2     0.061634    0.035814  1.7210e+00 0.085255
## ma1    -0.651611    0.000135 -4.8147e+03 0.000000
## ma2    -0.324252    0.000218 -1.4843e+03 0.000000
## omega   0.000001    0.000011  1.1456e-01 0.908795
## alpha1  0.000018    0.386232  4.7000e-05 0.999962
## alpha2  0.037914    0.360973  1.0503e-01 0.916349
## beta1   0.843354    0.194211  4.3425e+00 0.000014
## gamma1  0.364868    0.398551  9.1549e-01 0.359936
## gamma2 -0.197878    0.163966 -1.2068e+00 0.227500
## shape   3.832555    0.815057  4.7022e+00 0.000003
## 
## LogLikelihood : 5731.316 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -7.8562
## Bayes        -7.8127
## Shibata      -7.8563
## Hannan-Quinn -7.8400
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.5036  0.4779
## Lag[2*(p+q)+(p+q)-1][11]    1.9279  1.0000
## Lag[4*(p+q)+(p+q)-1][19]    3.9456  0.9995
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       1.648  0.1992
## Lag[2*(p+q)+(p+q)-1][8]      2.521  0.7722
## Lag[4*(p+q)+(p+q)-1][14]     4.989  0.7708
## d.o.f=3
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[4]    0.1695 0.500 2.000  0.6806
## ARCH Lag[6]    0.4344 1.461 1.711  0.9101
## ARCH Lag[8]    1.4391 2.368 1.583  0.8509
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  68.694
## Individual Statistics:               
## mu      0.21926
## ar1     0.05821
## ar2     0.30284
## ma1     0.37367
## ma2     0.41182
## omega  13.99148
## alpha1  0.20798
## alpha2  0.17853
## beta1   0.17149
## gamma1  0.17097
## gamma2  0.14779
## shape   0.23364
## 
## 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           1.5379 0.12429    
## Negative Sign Bias  2.0523 0.04032  **
## Positive Sign Bias  0.7894 0.43001    
## Joint Effect        6.8109 0.07817   *
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     38.20    0.0055910
## 2    30     58.38    0.0009776
## 3    40     72.24    0.0009533
## 4    50     82.39    0.0019884
## 
## 
## Elapsed time : 1.274036
print(VNI.garch21st.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(2,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : sstd 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error     t value Pr(>|t|)
## mu     -0.000001    0.000003    -0.51472 0.606752
## ar1    -0.362262    0.028740   -12.60457 0.000000
## ar2     0.044761    0.026312     1.70120 0.088906
## ma1    -0.578157    0.000300 -1928.55203 0.000000
## ma2    -0.390991    0.000308 -1270.06883 0.000000
## omega   0.000001    0.000001     0.91168 0.361939
## alpha1  0.006296    0.043457     0.14487 0.884815
## alpha2  0.022793    0.045159     0.50473 0.613749
## beta1   0.868603    0.027155    31.98644 0.000000
## gamma1  0.346620    0.101967     3.39932 0.000676
## gamma2 -0.203859    0.094163    -2.16495 0.030392
## skew    0.836313    0.034724    24.08480 0.000000
## shape   4.209347    0.515075     8.17230 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error     t value Pr(>|t|)
## mu     -0.000001    0.000006    -0.25006 0.802543
## ar1    -0.362262    0.034282   -10.56721 0.000000
## ar2     0.044761    0.038621     1.15899 0.246462
## ma1    -0.578157    0.000426 -1357.75075 0.000000
## ma2    -0.390991    0.000417  -938.33901 0.000000
## omega   0.000001    0.000009     0.11471 0.908674
## alpha1  0.006296    0.056090     0.11224 0.910633
## alpha2  0.022793    0.078918     0.28882 0.772722
## beta1   0.868603    0.164887     5.26787 0.000000
## gamma1  0.346620    0.133192     2.60240 0.009257
## gamma2 -0.203859    0.128610    -1.58509 0.112945
## skew    0.836313    0.117135     7.13973 0.000000
## shape   4.209347    1.360548     3.09386 0.001976
## 
## LogLikelihood : 5743.455 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -7.8715
## Bayes        -7.8243
## Shibata      -7.8717
## Hannan-Quinn -7.8539
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.8657  0.3522
## Lag[2*(p+q)+(p+q)-1][11]    2.4867  1.0000
## Lag[4*(p+q)+(p+q)-1][19]    4.5237  0.9979
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       1.783  0.1817
## Lag[2*(p+q)+(p+q)-1][8]      2.537  0.7693
## Lag[4*(p+q)+(p+q)-1][14]     4.988  0.7710
## d.o.f=3
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[4]    0.1669 0.500 2.000  0.6829
## ARCH Lag[6]    0.3117 1.461 1.711  0.9423
## ARCH Lag[8]    1.3056 2.368 1.583  0.8749
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  111.2287
## Individual Statistics:               
## mu      0.16746
## ar1     0.06632
## ar2     0.25412
## ma1     0.23761
## ma2     0.26875
## omega  22.66056
## alpha1  0.17802
## alpha2  0.16753
## beta1   0.15757
## gamma1  0.15189
## gamma2  0.12873
## skew    0.13809
## shape   0.17779
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          2.89 3.15 3.69
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                    t-value    prob sig
## Sign Bias           1.6148 0.10658    
## Negative Sign Bias  2.0461 0.04092  **
## Positive Sign Bias  0.8177 0.41366    
## Joint Effect        7.0653 0.06984   *
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     26.23      0.12403
## 2    30     48.74      0.01230
## 3    40     61.91      0.01121
## 4    50     73.74      0.01269
## 
## 
## Elapsed time : 1.352411
print(VNI.garch21g.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(2,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : ged 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error     t value Pr(>|t|)
## mu      0.000004    0.000002  2.0822e+00 0.037328
## ar1    -0.117005    0.011062 -1.0577e+01 0.000000
## ar2     0.044145    0.018706  2.3599e+00 0.018278
## ma1    -0.844635    0.000033 -2.5513e+04 0.000000
## ma2    -0.136335    0.000174 -7.8421e+02 0.000000
## omega   0.000001    0.000001  7.5081e-01 0.452768
## alpha1  0.000020    0.039792  5.0900e-04 0.999594
## alpha2  0.034149    0.042162  8.0994e-01 0.417973
## beta1   0.861113    0.029241  2.9449e+01 0.000000
## gamma1  0.291217    0.091506  3.1825e+00 0.001460
## gamma2 -0.168520    0.088070 -1.9135e+00 0.055687
## shape   1.059345    0.054555  1.9418e+01 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error     t value Pr(>|t|)
## mu      0.000004    0.000002  2.0567e+00 0.039713
## ar1    -0.117005    0.005811 -2.0136e+01 0.000000
## ar2     0.044145    0.015724  2.8075e+00 0.004993
## ma1    -0.844635    0.000033 -2.5402e+04 0.000000
## ma2    -0.136335    0.000272 -5.0037e+02 0.000000
## omega   0.000001    0.000014  7.6457e-02 0.939056
## alpha1  0.000020    0.085207  2.3800e-04 0.999810
## alpha2  0.034149    0.050300  6.7890e-01 0.497200
## beta1   0.861113    0.225414  3.8201e+00 0.000133
## gamma1  0.291217    0.142331  2.0461e+00 0.040751
## gamma2 -0.168520    0.189075 -8.9129e-01 0.372776
## shape   1.059345    0.236952  4.4707e+00 0.000008
## 
## LogLikelihood : 5726.693 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -7.8499
## Bayes        -7.8063
## Shibata      -7.8500
## Hannan-Quinn -7.8336
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       1.704  0.1917
## Lag[2*(p+q)+(p+q)-1][11]     3.073  1.0000
## Lag[4*(p+q)+(p+q)-1][19]     5.083  0.9932
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       1.297  0.2547
## Lag[2*(p+q)+(p+q)-1][8]      1.864  0.8793
## Lag[4*(p+q)+(p+q)-1][14]     4.474  0.8314
## d.o.f=3
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[4]   0.07999 0.500 2.000  0.7773
## ARCH Lag[6]   0.19206 1.461 1.711  0.9704
## ARCH Lag[8]   1.12547 2.368 1.583  0.9051
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  70.1841
## Individual Statistics:               
## mu      0.39787
## ar1     0.04728
## ar2     0.12981
## ma1     0.42155
## ma2     0.44564
## omega  11.90414
## alpha1  0.19001
## alpha2  0.13259
## beta1   0.10392
## gamma1  0.11802
## gamma2  0.10241
## shape   0.10727
## 
## 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            1.593 0.11140    
## Negative Sign Bias   1.718 0.08596   *
## Positive Sign Bias   0.685 0.49348    
## Joint Effect         6.008 0.11122    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     44.44    0.0008206
## 2    30     58.30    0.0010005
## 3    40     68.73    0.0022997
## 4    50     86.45    0.0007705
## 
## 
## Elapsed time : 2.261734
print(VNI.garch21sg.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(2,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : sged 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error     t value Pr(>|t|)
## mu     -0.000004    0.000003 -1.3370e+00 0.181234
## ar1    -0.500451    0.020979 -2.3855e+01 0.000000
## ar2     0.030263    0.020705  1.4617e+00 0.143837
## ma1    -0.459507    0.000481 -9.5601e+02 0.000000
## ma2    -0.503516    0.000483 -1.0423e+03 0.000000
## omega   0.000001    0.000001  6.4426e-01 0.519408
## alpha1  0.000085    0.017937  4.7360e-03 0.996221
## alpha2  0.026837    0.013031  2.0595e+00 0.039444
## beta1   0.884302    0.030094  2.9385e+01 0.000000
## gamma1  0.301102    0.042588  7.0701e+00 0.000000
## gamma2 -0.190324    0.041869 -4.5457e+00 0.000005
## skew    0.857944    0.025094  3.4189e+01 0.000000
## shape   1.131733    0.062591  1.8081e+01 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error     t value Pr(>|t|)
## mu     -0.000004    0.000004   -1.038080 0.299233
## ar1    -0.500451    0.052844   -9.470304 0.000000
## ar2     0.030263    0.104212    0.290401 0.771510
## ma1    -0.459507    0.000886 -518.897267 0.000000
## ma2    -0.503516    0.001045 -481.736962 0.000000
## omega   0.000001    0.000016    0.054431 0.956591
## alpha1  0.000085    0.041290    0.002057 0.998358
## alpha2  0.026837    0.030796    0.871449 0.383509
## beta1   0.884302    0.303086    2.917665 0.003527
## gamma1  0.301102    0.148968    2.021249 0.043254
## gamma2 -0.190324    0.193973   -0.981188 0.326500
## skew    0.857944    0.118601    7.233878 0.000000
## shape   1.131733    0.358359    3.158100 0.001588
## 
## LogLikelihood : 5739.215 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -7.8657
## Bayes        -7.8185
## Shibata      -7.8658
## Hannan-Quinn -7.8481
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       2.454  0.1173
## Lag[2*(p+q)+(p+q)-1][11]     4.388  0.9983
## Lag[4*(p+q)+(p+q)-1][19]     6.494  0.9460
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       1.506  0.2197
## Lag[2*(p+q)+(p+q)-1][8]      2.143  0.8364
## Lag[4*(p+q)+(p+q)-1][14]     4.729  0.8023
## d.o.f=3
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[4]    0.1323 0.500 2.000  0.7160
## ARCH Lag[6]    0.2058 1.461 1.711  0.9674
## ARCH Lag[8]    1.2153 2.368 1.583  0.8903
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  112.6345
## Individual Statistics:               
## mu      0.14620
## ar1     0.09825
## ar2     0.14401
## ma1     0.20605
## ma2     0.22400
## omega  21.80956
## alpha1  0.16540
## alpha2  0.14280
## beta1   0.10315
## gamma1  0.12750
## gamma2  0.10712
## skew    0.08246
## shape   0.08317
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          2.89 3.15 3.69
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                    t-value    prob sig
## Sign Bias            2.022 0.04332  **
## Negative Sign Bias   2.006 0.04505  **
## Positive Sign Bias   0.532 0.59478    
## Joint Effect         7.663 0.05351   *
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     29.33     0.060973
## 2    30     43.26     0.043087
## 3    40     57.68     0.027323
## 4    50     80.54     0.003019
## 
## 
## Elapsed time : 5.160106

Garch22

VNI.garch22n.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2, 2)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "norm")
VNI.garch22n.fit <- ugarchfit(spec = VNI.garch22n.spec, data = data[, 2])

VNI.garch22t.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2, 2)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "std")
VNI.garch22t.fit <- ugarchfit(spec = VNI.garch22t.spec, data = data[, 2])
 
VNI.garch22st.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2, 2)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "sstd")
VNI.garch22st.fit <- ugarchfit(spec = VNI.garch22st.spec, data = data[, 2])

VNI.garch22g.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2, 2)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "ged")
VNI.garch22g.fit <- ugarchfit(spec = VNI.garch22g.spec, data = data[, 2])

VNI.garch22sg.spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder = c(2, 2)), mean.model 
= list(armaOrder = c(2, 2), include.mean = TRUE), distribution.model = "sged")
VNI.garch22sg.fit <- ugarchfit(spec = VNI.garch22sg.spec, data = data[, 2])

print(VNI.garch22n.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(2,2)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : norm 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error     t value Pr(>|t|)
## mu     -0.000003    0.000003 -1.0037e+00 0.315533
## ar1    -0.408781    0.031152 -1.3122e+01 0.000000
## ar2     0.075331    0.029173  2.5822e+00 0.009817
## ma1    -0.501909    0.000225 -2.2343e+03 0.000000
## ma2    -0.466795    0.000209 -2.2287e+03 0.000000
## omega   0.000001    0.000000  2.1710e+00 0.029928
## alpha1  0.000000    0.053339  8.0000e-06 0.999994
## alpha2  0.022567    0.050810  4.4415e-01 0.656936
## beta1   0.888226    0.110348  8.0493e+00 0.000000
## beta2   0.000004    0.102950  3.8000e-05 0.999970
## gamma1  0.241648    0.084700  2.8530e+00 0.004331
## gamma2 -0.135329    0.081119 -1.6683e+00 0.095258
## 
## Robust Standard Errors:
##         Estimate  Std. Error     t value Pr(>|t|)
## mu     -0.000003    0.000004   -0.805507 0.420527
## ar1    -0.408781    0.032704  -12.499448 0.000000
## ar2     0.075331    0.035159    2.142563 0.032148
## ma1    -0.501909    0.000686 -731.514413 0.000000
## ma2    -0.466795    0.000643 -725.688028 0.000000
## omega   0.000001    0.000004    0.239107 0.811023
## alpha1  0.000000    0.095570    0.000004 0.999997
## alpha2  0.022567    0.063826    0.353572 0.723659
## beta1   0.888226    1.259510    0.705216 0.480676
## beta2   0.000004    1.163731    0.000003 0.999997
## gamma1  0.241648    0.192686    1.254101 0.209805
## gamma2 -0.135329    0.366232   -0.369519 0.711741
## 
## LogLikelihood : 5626.748 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -7.7126
## Bayes        -7.6690
## Shibata      -7.7127
## Hannan-Quinn -7.6963
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                     0.02263  0.8804
## Lag[2*(p+q)+(p+q)-1][11]   2.06229  1.0000
## Lag[4*(p+q)+(p+q)-1][19]   4.56018  0.9977
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.7965  0.3721
## Lag[2*(p+q)+(p+q)-1][11]    2.6336  0.9086
## Lag[4*(p+q)+(p+q)-1][19]    6.0758  0.8677
## d.o.f=4
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[5] 0.0002196 0.500 2.000  0.9882
## ARCH Lag[7] 0.2499049 1.473 1.746  0.9598
## ARCH Lag[9] 1.4182162 2.402 1.619  0.8663
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  76.0931
## Individual Statistics:              
## mu     0.19732
## ar1    0.07445
## ar2    0.45796
## ma1    0.21145
## ma2    0.29975
## omega  3.17468
## alpha1 0.14854
## alpha2 0.08570
## beta1  0.06135
## beta2  0.06404
## gamma1 0.05162
## gamma2 0.04208
## 
## 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           1.8390 0.06613   *
## Negative Sign Bias  1.3388 0.18086    
## Positive Sign Bias  0.5479 0.58387    
## Joint Effect        6.3105 0.09744   *
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     121.3    6.390e-17
## 2    30     135.0    1.301e-15
## 3    40     154.3    1.225e-15
## 4    50     165.9    1.281e-14
## 
## 
## Elapsed time : 1.887014
print(VNI.garch22t.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(2,2)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : std 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error     t value Pr(>|t|)
## mu      0.000004    0.000002  2.0321e+00 0.042145
## ar1    -0.289930    0.027855 -1.0408e+01 0.000000
## ar2     0.061651    0.025879  2.3823e+00 0.017206
## ma1    -0.649935    0.000117 -5.5440e+03 0.000000
## ma2    -0.325887    0.000268 -1.2146e+03 0.000000
## omega   0.000001    0.000001  1.0001e+00 0.317261
## alpha1  0.000003    0.050522  6.4000e-05 0.999949
## alpha2  0.037860    0.051042  7.4175e-01 0.458241
## beta1   0.843289    0.272015  3.1002e+00 0.001934
## beta2   0.000002    0.213949  1.1000e-05 0.999991
## gamma1  0.363650    0.072899  4.9884e+00 0.000001
## gamma2 -0.197069    0.116893 -1.6859e+00 0.091817
## shape   3.843235    0.418923  9.1741e+00 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error     t value Pr(>|t|)
## mu      0.000004    0.000003  1.4854e+00 0.137445
## ar1    -0.289930    0.050454 -5.7464e+00 0.000000
## ar2     0.061651    0.032425  1.9013e+00 0.057258
## ma1    -0.649935    0.000229 -2.8401e+03 0.000000
## ma2    -0.325887    0.000380 -8.5763e+02 0.000000
## omega   0.000001    0.000008  1.6103e-01 0.872072
## alpha1  0.000003    0.051507  6.2000e-05 0.999950
## alpha2  0.037860    0.063238  5.9869e-01 0.549378
## beta1   0.843289    2.356155  3.5791e-01 0.720412
## beta2   0.000002    1.974747  1.0000e-06 0.999999
## gamma1  0.363650    0.858596  4.2354e-01 0.671901
## gamma2 -0.197069    1.303727 -1.5116e-01 0.879851
## shape   3.843235    0.613828  6.2611e+00 0.000000
## 
## LogLikelihood : 5731.316 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -7.8548
## Bayes        -7.8077
## Shibata      -7.8550
## Hannan-Quinn -7.8372
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.5009  0.4791
## Lag[2*(p+q)+(p+q)-1][11]    1.9261  1.0000
## Lag[4*(p+q)+(p+q)-1][19]    3.9441  0.9995
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       1.646  0.1995
## Lag[2*(p+q)+(p+q)-1][11]     3.705  0.7759
## Lag[4*(p+q)+(p+q)-1][19]     6.730  0.8097
## d.o.f=4
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[5]    0.1367 0.500 2.000  0.7116
## ARCH Lag[7]    0.3326 1.473 1.746  0.9404
## ARCH Lag[9]    1.6622 2.402 1.619  0.8227
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  186.6699
## Individual Statistics:               
## mu      0.21716
## ar1     0.05819
## ar2     0.30238
## ma1     0.37012
## ma2     0.40858
## omega  13.97019
## alpha1  0.20050
## alpha2  0.17177
## beta1   0.16387
## beta2   0.19469
## gamma1  0.16497
## gamma2  0.14284
## shape   0.23119
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          2.89 3.15 3.69
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                    t-value    prob sig
## Sign Bias           1.5378 0.12433    
## Negative Sign Bias  2.0521 0.04034  **
## Positive Sign Bias  0.7901 0.42961    
## Joint Effect        6.8126 0.07812   *
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     38.75    0.0047538
## 2    30     59.00    0.0008212
## 3    40     74.66    0.0005088
## 4    50     85.14    0.0010510
## 
## 
## Elapsed time : 2.545956
print(VNI.garch22st.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(2,2)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : sstd 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error     t value Pr(>|t|)
## mu     -0.000001    0.000003 -5.9526e-01 0.551671
## ar1    -0.377677    0.027972 -1.3502e+01 0.000000
## ar2     0.044959    0.026234  1.7138e+00 0.086572
## ma1    -0.562770    0.000309 -1.8205e+03 0.000000
## ma2    -0.405426    0.000299 -1.3552e+03 0.000000
## omega   0.000001    0.000001  1.3210e+00 0.186487
## alpha1  0.006566    0.043451  1.5112e-01 0.879883
## alpha2  0.022119    0.044346  4.9877e-01 0.617943
## beta1   0.869801    0.196227  4.4326e+00 0.000009
## beta2   0.000000    0.155622  1.0000e-06 0.999999
## gamma1  0.350075    0.076169  4.5960e+00 0.000004
## gamma2 -0.206884    0.068857 -3.0045e+00 0.002660
## skew    0.836431    0.029623  2.8236e+01 0.000000
## shape   4.200057    0.508228  8.2641e+00 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error    t value Pr(>|t|)
## mu     -0.000001    0.000008   -0.18997 0.849329
## ar1    -0.377677    0.086494   -4.36651 0.000013
## ar2     0.044959    0.058093    0.77391 0.438986
## ma1    -0.562770    0.000696 -808.26377 0.000000
## ma2    -0.405426    0.000613 -660.91683 0.000000
## omega   0.000001    0.000004    0.24848 0.803760
## alpha1  0.006566    0.058646    0.11196 0.910853
## alpha2  0.022119    0.038356    0.57667 0.564164
## beta1   0.869801    1.712514    0.50791 0.611517
## beta2   0.000000    1.483403    0.00000 1.000000
## gamma1  0.350075    0.775664    0.45132 0.651757
## gamma2 -0.206884    1.015204   -0.20378 0.838521
## skew    0.836431    0.067289   12.43051 0.000000
## shape   4.200057    0.667315    6.29397 0.000000
## 
## LogLikelihood : 5743.452 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -7.8701
## Bayes        -7.8193
## Shibata      -7.8703
## Hannan-Quinn -7.8512
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.8703  0.3509
## Lag[2*(p+q)+(p+q)-1][11]    2.4606  1.0000
## Lag[4*(p+q)+(p+q)-1][19]    4.4948  0.9980
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       1.816  0.1778
## Lag[2*(p+q)+(p+q)-1][11]     3.727  0.7729
## Lag[4*(p+q)+(p+q)-1][19]     6.757  0.8071
## d.o.f=4
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[5]   0.03449 0.500 2.000  0.8527
## ARCH Lag[7]   0.19690 1.473 1.746  0.9712
## ARCH Lag[9]   1.52543 2.402 1.619  0.8475
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  232.3586
## Individual Statistics:               
## mu      0.16195
## ar1     0.06821
## ar2     0.24459
## ma1     0.22454
## ma2     0.25622
## omega  23.49541
## alpha1  0.17642
## alpha2  0.16582
## beta1   0.15278
## beta2   0.18078
## gamma1  0.15511
## gamma2  0.13097
## skew    0.13757
## shape   0.17304
## 
## 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.606 0.10844    
## Negative Sign Bias   2.061 0.03948  **
## Positive Sign Bias   0.828 0.40781    
## Joint Effect         7.103 0.06868   *
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     26.39     0.119681
## 2    30     48.86     0.011941
## 3    40     59.60     0.018394
## 4    50     75.11     0.009614
## 
## 
## Elapsed time : 3.772026
print(VNI.garch22g.fit)
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(2,2)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : ged 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error     t value Pr(>|t|)
## mu      0.000004    0.000002  2.0485e+00 0.040513
## ar1    -0.106922    0.010589 -1.0098e+01 0.000000
## ar2     0.044289    0.012059  3.6727e+00 0.000240
## ma1    -0.854273    0.000034 -2.5257e+04 0.000000
## ma2    -0.126726    0.000179 -7.0959e+02 0.000000
## omega   0.000001    0.000001  1.1422e+00 0.253381
## alpha1  0.000010    0.053781  1.8700e-04 0.999851
## alpha2  0.033474    0.053299  6.2804e-01 0.529976
## beta1   0.862620    0.182785  4.7193e+00 0.000002
## beta2   0.000025    0.143558  1.7400e-04 0.999861
## gamma1  0.289947    0.092180  3.1454e+00 0.001658
## gamma2 -0.167992    0.045380 -3.7019e+00 0.000214
## shape   1.060805    0.049088  2.1610e+01 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error     t value Pr(>|t|)
## mu      0.000004    0.000002  1.9790e+00 0.047813
## ar1    -0.106922    0.007260 -1.4727e+01 0.000000
## ar2     0.044289    0.006660  6.6497e+00 0.000000
## ma1    -0.854273    0.000038 -2.2387e+04 0.000000
## ma2    -0.126726    0.000585 -2.1659e+02 0.000000
## omega   0.000001    0.000006  1.8929e-01 0.849867
## alpha1  0.000010    0.048600  2.0700e-04 0.999835
## alpha2  0.033474    0.053447  6.2631e-01 0.531111
## beta1   0.862620    1.915460  4.5035e-01 0.652461
## beta2   0.000025    1.664240  1.5000e-05 0.999988
## gamma1  0.289947    0.511952  5.6636e-01 0.571153
## gamma2 -0.167992    0.791394 -2.1227e-01 0.831894
## shape   1.060805    0.070733  1.4997e+01 0.000000
## 
## LogLikelihood : 5726.69 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -7.8485
## Bayes        -7.8013
## Shibata      -7.8486
## Hannan-Quinn -7.8309
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       1.665  0.1969
## Lag[2*(p+q)+(p+q)-1][11]     3.014  1.0000
## Lag[4*(p+q)+(p+q)-1][19]     5.026  0.9939
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       1.295  0.2551
## Lag[2*(p+q)+(p+q)-1][11]     3.079  0.8592
## Lag[4*(p+q)+(p+q)-1][19]     6.331  0.8463
## d.o.f=4
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[5]   0.04129 0.500 2.000  0.8390
## ARCH Lag[7]   0.15578 1.473 1.746  0.9793
## ARCH Lag[9]   1.38852 2.402 1.619  0.8714
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  189.1906
## Individual Statistics:              
## mu      0.3748
## ar1     0.0468
## ar2     0.1337
## ma1     0.3634
## ma2     0.4181
## omega  12.3674
## alpha1  0.1851
## alpha2  0.1296
## beta1   0.1016
## beta2   0.1164
## gamma1  0.1159
## gamma2  0.1013
## shape   0.1110
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          2.89 3.15 3.69
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                    t-value    prob sig
## Sign Bias           1.6127 0.10704    
## Negative Sign Bias  1.7235 0.08501   *
## Positive Sign Bias  0.6783 0.49768    
## Joint Effect        6.0734 0.10809    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     44.82    0.0007253
## 2    30     59.04    0.0008116
## 3    40     65.87    0.0045613
## 4    50     84.25    0.0012961
## 
## 
## Elapsed time : 3.447312
print(VNI.garch22sg.fit)
## 
## *---------------------------------*
## *          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     -0.000004    0.000003 -1.2776e+00 0.201377
## ar1    -0.498908    0.034163 -1.4604e+01 0.000000
## ar2     0.030443    0.063383  4.8030e-01 0.631017
## ma1    -0.461358    0.000492 -9.3852e+02 0.000000
## ma2    -0.501490    0.000472 -1.0630e+03 0.000000
## omega   0.000001    0.000002  5.5131e-01 0.581423
## alpha1  0.000029    0.033456  8.8000e-04 0.999298
## alpha2  0.027233    0.028775  9.4642e-01 0.343935
## beta1   0.882605    0.019626  4.4971e+01 0.000000
## beta2   0.000025    0.019652  1.2680e-03 0.998989
## gamma1  0.298213    0.062927  4.7390e+00 0.000002
## gamma2 -0.186028    0.068699 -2.7079e+00 0.006771
## skew    0.857728    0.026291  3.2624e+01 0.000000
## shape   1.131658    0.062019  1.8247e+01 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error     t value Pr(>|t|)
## mu     -0.000004    0.000007   -0.557997 0.576846
## ar1    -0.498908    0.305542   -1.632861 0.102498
## ar2     0.030443    0.615032    0.049498 0.960522
## ma1    -0.461358    0.002185 -211.141055 0.000000
## ma2    -0.501490    0.001024 -489.947384 0.000000
## omega   0.000001    0.000022    0.039429 0.968548
## alpha1  0.000029    0.163191    0.000180 0.999856
## alpha2  0.027233    0.041167    0.661535 0.508269
## beta1   0.882605    0.227950    3.871933 0.000108
## beta2   0.000025    0.097866    0.000255 0.999797
## gamma1  0.298213    0.314022    0.949657 0.342286
## gamma2 -0.186028    0.476136   -0.390703 0.696017
## skew    0.857728    0.170479    5.031284 0.000000
## shape   1.131658    0.358837    3.153685 0.001612
## 
## LogLikelihood : 5739.223 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -7.8643
## Bayes        -7.8135
## Shibata      -7.8645
## Hannan-Quinn -7.8454
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       2.490  0.1146
## Lag[2*(p+q)+(p+q)-1][11]     4.401  0.9981
## Lag[4*(p+q)+(p+q)-1][19]     6.509  0.9451
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       1.469  0.2255
## Lag[2*(p+q)+(p+q)-1][11]     3.344  0.8256
## Lag[4*(p+q)+(p+q)-1][19]     6.587  0.8232
## d.o.f=4
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[5]  0.003942 0.500 2.000  0.9499
## ARCH Lag[7]  0.158651 1.473 1.746  0.9788
## ARCH Lag[9]  1.490623 2.402 1.619  0.8537
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  218.9166
## Individual Statistics:               
## mu      0.14575
## ar1     0.10120
## ar2     0.14267
## ma1     0.20366
## ma2     0.21995
## omega  20.86131
## alpha1  0.17306
## alpha2  0.15078
## beta1   0.10864
## beta2   0.12344
## gamma1  0.13347
## gamma2  0.11320
## skew    0.08195
## shape   0.08388
## 
## 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           2.0225 0.04330  **
## Negative Sign Bias  1.9881 0.04699  **
## Positive Sign Bias  0.5307 0.59568    
## Joint Effect        7.6327 0.05425   *
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     29.58     0.057436
## 2    30     43.63     0.039781
## 3    40     58.67     0.022337
## 4    50     76.90     0.006638
## 
## 
## Elapsed time : 5.174909

LỰA CHỌN MO HINH GJR-GARCH

Lựa chọn mô hình biên phù hợp nhất cho chuỗi XAU.USD

XAU.model.list5 <- list(
  garch11t = XAU.garch11t.fit,
  garch11st = XAU.garch11st.fit,
  garch11g = XAU.garch11g.fit,
  garch11sg = XAU.garch11sg.fit,
  garch12n = XAU.garch12n.fit,
  garch12t = XAU.garch12t.fit,
  garch12st = XAU.garch12st.fit,
  garch12g = XAU.garch12g.fit,
  garch12sg = XAU.garch12sg.fit,
  garch21n = XAU.garch21n.fit,
  garch21t = XAU.garch21t.fit,
  garch21st = XAU.garch21st.fit,
  garch21g = XAU.garch21g.fit,
  garch21sg = XAU.garch21sg.fit,
  garch22n = XAU.garch22n.fit,
  garch22t = XAU.garch22t.fit,
  garch22st = XAU.garch22st.fit,
  garch22g = XAU.garch22g.fit,
  garch22sg = XAU.garch22sg.fit
)


XAU.model.list6 <- list(
  garch11t = XAU.garch11n.fit,
  garch11t = XAU.garch11t.fit,
  garch11st = XAU.garch11st.fit,
  garch11g = XAU.garch11g.fit,
  garch12n = XAU.garch12n.fit,
  garch12t = XAU.garch12t.fit,
  garch12st = XAU.garch12st.fit,
  garch12g = XAU.garch12g.fit,
  garch12sg = XAU.garch12sg.fit,
  garch21n = XAU.garch21n.fit,
  garch21t = XAU.garch21t.fit,
  garch21st = XAU.garch21st.fit,
  garch21g = XAU.garch21g.fit,
  garch21sg = XAU.garch21sg.fit,
  garch22n = XAU.garch22n.fit,
  garch22t = XAU.garch22t.fit,
  garch22st = XAU.garch22st.fit,
  garch22g = XAU.garch22g.fit,
  garch22sg = XAU.garch22sg.fit
)
results14 <- lapply(XAU.model.list5, function(model) {
  tryCatch({
    print(infocriteria(model))
  }, error = function(e) {
    message("Lỗi khi xử lý mô hình: ", e$message)
    return(NULL)  # Hoặc giá trị mặc định khác
  })
})
##                       
## Akaike       -8.410975
## Bayes        -8.374687
## Shibata      -8.411068
## Hannan-Quinn -8.397436
##                       
## Akaike       -8.411881
## Bayes        -8.371965
## Shibata      -8.411994
## Hannan-Quinn -8.396989
##                       
## Akaike       -8.413259
## Bayes        -8.376972
## Shibata      -8.413353
## Hannan-Quinn -8.399721
##                       
## Akaike       -8.413652
## Bayes        -8.373736
## Shibata      -8.413765
## Hannan-Quinn -8.398760
##                       
## Akaike       -8.347164
## Bayes        -8.310877
## Shibata      -8.347258
## Hannan-Quinn -8.333626
##                       
## Akaike       -8.409542
## Bayes        -8.369626
## Shibata      -8.409655
## Hannan-Quinn -8.394649
##                       
## Akaike       -8.410422
## Bayes        -8.366877
## Shibata      -8.410557
## Hannan-Quinn -8.394176
##                       
## Akaike       -8.413259
## Bayes        -8.376972
## Shibata      -8.413353
## Hannan-Quinn -8.399721
##                       
## Akaike       -8.413259
## Bayes        -8.376972
## Shibata      -8.413353
## Hannan-Quinn -8.399721
##                       
## Akaike       -8.349159
## Bayes        -8.309243
## Shibata      -8.349273
## Hannan-Quinn -8.334267
##                       
## Akaike       -8.409607
## Bayes        -8.366062
## Shibata      -8.409741
## Hannan-Quinn -8.393361
##                       
## Akaike       -8.410468
## Bayes        -8.363295
## Shibata      -8.410626
## Hannan-Quinn -8.392868
##                       
## Akaike       -8.412083
## Bayes        -8.368538
## Shibata      -8.412217
## Hannan-Quinn -8.395837
##                       
## Akaike       -8.412083
## Bayes        -8.368538
## Shibata      -8.412217
## Hannan-Quinn -8.395837
##                       
## Akaike       -8.351678
## Bayes        -8.308134
## Shibata      -8.351813
## Hannan-Quinn -8.335432
##                       
## Akaike       -8.411987
## Bayes        -8.364813
## Shibata      -8.412145
## Hannan-Quinn -8.394387
##                       
## Akaike       -8.412791
## Bayes        -8.361988
## Shibata      -8.412973
## Hannan-Quinn -8.393837
##                       
## Akaike       -8.413837
## Bayes        -8.366663
## Shibata      -8.413995
## Hannan-Quinn -8.396237
##                       
## Akaike       -8.413837
## Bayes        -8.366663
## Shibata      -8.413995
## Hannan-Quinn -8.396237
print(results14)
## $garch11t
##                       
## Akaike       -8.410975
## Bayes        -8.374687
## Shibata      -8.411068
## Hannan-Quinn -8.397436
## 
## $garch11st
##                       
## Akaike       -8.411881
## Bayes        -8.371965
## Shibata      -8.411994
## Hannan-Quinn -8.396989
## 
## $garch11g
##                       
## Akaike       -8.413259
## Bayes        -8.376972
## Shibata      -8.413353
## Hannan-Quinn -8.399721
## 
## $garch11sg
##                       
## Akaike       -8.413652
## Bayes        -8.373736
## Shibata      -8.413765
## Hannan-Quinn -8.398760
## 
## $garch12n
##                       
## Akaike       -8.347164
## Bayes        -8.310877
## Shibata      -8.347258
## Hannan-Quinn -8.333626
## 
## $garch12t
##                       
## Akaike       -8.409542
## Bayes        -8.369626
## Shibata      -8.409655
## Hannan-Quinn -8.394649
## 
## $garch12st
##                       
## Akaike       -8.410422
## Bayes        -8.366877
## Shibata      -8.410557
## Hannan-Quinn -8.394176
## 
## $garch12g
##                       
## Akaike       -8.413259
## Bayes        -8.376972
## Shibata      -8.413353
## Hannan-Quinn -8.399721
## 
## $garch12sg
##                       
## Akaike       -8.413259
## Bayes        -8.376972
## Shibata      -8.413353
## Hannan-Quinn -8.399721
## 
## $garch21n
##                       
## Akaike       -8.349159
## Bayes        -8.309243
## Shibata      -8.349273
## Hannan-Quinn -8.334267
## 
## $garch21t
##                       
## Akaike       -8.409607
## Bayes        -8.366062
## Shibata      -8.409741
## Hannan-Quinn -8.393361
## 
## $garch21st
##                       
## Akaike       -8.410468
## Bayes        -8.363295
## Shibata      -8.410626
## Hannan-Quinn -8.392868
## 
## $garch21g
##                       
## Akaike       -8.412083
## Bayes        -8.368538
## Shibata      -8.412217
## Hannan-Quinn -8.395837
## 
## $garch21sg
##                       
## Akaike       -8.412083
## Bayes        -8.368538
## Shibata      -8.412217
## Hannan-Quinn -8.395837
## 
## $garch22n
##                       
## Akaike       -8.351678
## Bayes        -8.308134
## Shibata      -8.351813
## Hannan-Quinn -8.335432
## 
## $garch22t
##                       
## Akaike       -8.411987
## Bayes        -8.364813
## Shibata      -8.412145
## Hannan-Quinn -8.394387
## 
## $garch22st
##                       
## Akaike       -8.412791
## Bayes        -8.361988
## Shibata      -8.412973
## Hannan-Quinn -8.393837
## 
## $garch22g
##                       
## Akaike       -8.413837
## Bayes        -8.366663
## Shibata      -8.413995
## Hannan-Quinn -8.396237
## 
## $garch22sg
##                       
## Akaike       -8.413837
## Bayes        -8.366663
## Shibata      -8.413995
## Hannan-Quinn -8.396237
XAU.info.mat <- sapply(XAU.model.list5, infocriteria)
XAU.info.mat
##       garch11t garch11st  garch11g garch11sg  garch12n  garch12t garch12st
## [1,] -8.410975 -8.411881 -8.413259 -8.413652 -8.347164 -8.409542 -8.410422
## [2,] -8.374687 -8.371965 -8.376972 -8.373736 -8.310877 -8.369626 -8.366877
## [3,] -8.411068 -8.411994 -8.413353 -8.413765 -8.347258 -8.409655 -8.410557
## [4,] -8.397436 -8.396989 -8.399721 -8.398760 -8.333626 -8.394649 -8.394176
##       garch12g garch12sg  garch21n  garch21t garch21st  garch21g garch21sg
## [1,] -8.413259 -8.413259 -8.349159 -8.409607 -8.410468 -8.412083 -8.412083
## [2,] -8.376972 -8.376972 -8.309243 -8.366062 -8.363295 -8.368538 -8.368538
## [3,] -8.413353 -8.413353 -8.349273 -8.409741 -8.410626 -8.412217 -8.412217
## [4,] -8.399721 -8.399721 -8.334267 -8.393361 -8.392868 -8.395837 -8.395837
##       garch22n  garch22t garch22st  garch22g garch22sg
## [1,] -8.351678 -8.411987 -8.412791 -8.413837 -8.413837
## [2,] -8.308134 -8.364813 -8.361988 -8.366663 -8.366663
## [3,] -8.351813 -8.412145 -8.412973 -8.413995 -8.413995
## [4,] -8.335432 -8.394387 -8.393837 -8.396237 -8.396237
XAU.inds <- which(XAU.info.mat == min(XAU.info.mat), arr.ind=TRUE)
 model.XAU <- colnames(XAU.info.mat)[XAU.inds[,2]]
 model.XAU
## [1] "garch22g"  "garch22sg"

Lựa chọn mô hình biên phù hợp nhất cho chuỗi VNI

VNI.model.list <- list(
  garch11n = VNI.garch11n.fit,
  garch11t = VNI.garch11t.fit,
  garch11st = VNI.garch11st.fit,
  garch11g = VNI.garch11g.fit,
  garch11sg = VNI.garch11sg.fit,
  garch12n = VNI.garch12n.fit,
  garch12t = VNI.garch12t.fit,
  garch12st =VNI.garch12st.fit,
  garch12g = VNI.garch12g.fit,
  garch21n = VNI.garch21n.fit,
  garch21t = VNI.garch21t.fit,
  garch21st = VNI.garch21st.fit,
  garch21g = VNI.garch21g.fit,
  garch21sg = VNI.garch21sg.fit,
  garch22n = VNI.garch22n.fit,
  garch22t = VNI.garch22t.fit,
  garch22st = VNI.garch22st.fit,
  garch22g = VNI.garch22g.fit,
  garch22sg = VNI.garch22sg.fit
)

VNI.model.list1 <- list(
  garch11n = VNI.garch11n.fit,
  garch21n = VNI.garch21n.fit,
  garch21t = VNI.garch21t.fit,
  garch21st = VNI.garch21st.fit,
  garch21g = VNI.garch21g.fit,
  garch21sg = VNI.garch21sg.fit,
  garch22n = VNI.garch22n.fit,
  garch22t = VNI.garch22t.fit,
  garch22st = VNI.garch22st.fit,
  garch22g = VNI.garch22g.fit,
  garch22sg = VNI.garch22sg.fit
)

VNI.model.list3 <- list(
  garch11n = VNI.garch11n.fit,
  garch11t = VNI.garch11t.fit,
  garch11st = VNI.garch11st.fit,
  garch11g = VNI.garch11g.fit,
  garch11sg = VNI.garch11sg.fit,
  garch12g = VNI.garch12g.fit,
  garch12sg = VNI.garch12sg.fit,
  garch21n = VNI.garch21n.fit,
  garch21t = VNI.garch21t.fit,
  garch21st = VNI.garch21st.fit,
  garch21g = VNI.garch21g.fit,
  garch21sg = VNI.garch21sg.fit,
  garch22n = VNI.garch22n.fit,
  garch22t = VNI.garch22t.fit,
  garch22st = VNI.garch22st.fit,
  garch22g = VNI.garch22g.fit,
  garch22sg = VNI.garch22sg.fit
)


results15 <- lapply(VNI.model.list, function(model) {
  tryCatch({
    print(infocriteria(model))
  }, error = function(e) {
    message("Lỗi khi xử lý mô hình: ", e$message)
    return(NULL)  # Hoặc giá trị mặc định khác
  })
})
##                       
## Akaike       -7.711787
## Bayes        -7.679128
## Shibata      -7.711862
## Hannan-Quinn -7.699602
## Warning in log(log(nObs)): NaNs produced
## Lỗi khi xử lý mô hình: replacement has length zero
## Warning in log(log(nObs)): NaNs produced
## Lỗi khi xử lý mô hình: replacement has length zero
## Warning in log(log(nObs)): NaNs produced
## Lỗi khi xử lý mô hình: replacement has length zero
## Warning in log(log(nObs)): NaNs produced
## Lỗi khi xử lý mô hình: replacement has length zero
## Warning in log(log(nObs)): NaNs produced
## Lỗi khi xử lý mô hình: replacement has length zero
## Warning in log(log(nObs)): NaNs produced
## Lỗi khi xử lý mô hình: replacement has length zero
## Warning in log(log(nObs)): NaNs produced
## Lỗi khi xử lý mô hình: replacement has length zero
## Warning in log(log(nObs)): NaNs produced
## Lỗi khi xử lý mô hình: replacement has length zero
##                       
## Akaike       -7.713945
## Bayes        -7.674029
## Shibata      -7.714058
## Hannan-Quinn -7.699053
##                       
## Akaike       -7.856204
## Bayes        -7.812659
## Shibata      -7.856338
## Hannan-Quinn -7.839957
##                       
## Akaike       -7.871504
## Bayes        -7.824330
## Shibata      -7.871661
## Hannan-Quinn -7.853904
##                       
## Akaike       -7.849853
## Bayes        -7.806308
## Shibata      -7.849987
## Hannan-Quinn -7.833607
##                       
## Akaike       -7.865680
## Bayes        -7.818506
## Shibata      -7.865837
## Hannan-Quinn -7.848080
##                       
## Akaike       -7.712566
## Bayes        -7.669021
## Shibata      -7.712700
## Hannan-Quinn -7.696320
##                       
## Akaike       -7.854829
## Bayes        -7.807655
## Shibata      -7.854987
## Hannan-Quinn -7.837229
##                       
## Akaike       -7.870126
## Bayes        -7.819323
## Shibata      -7.870308
## Hannan-Quinn -7.851172
##                       
## Akaike       -7.848475
## Bayes        -7.801301
## Shibata      -7.848633
## Hannan-Quinn -7.830875
##                       
## Akaike       -7.864317
## Bayes        -7.813514
## Shibata      -7.864499
## Hannan-Quinn -7.845363
print(results15)
## $garch11n
##                       
## Akaike       -7.711787
## Bayes        -7.679128
## Shibata      -7.711862
## Hannan-Quinn -7.699602
## 
## $garch11t
## NULL
## 
## $garch11st
## NULL
## 
## $garch11g
## NULL
## 
## $garch11sg
## NULL
## 
## $garch12n
## NULL
## 
## $garch12t
## NULL
## 
## $garch12st
## NULL
## 
## $garch12g
## NULL
## 
## $garch21n
##                       
## Akaike       -7.713945
## Bayes        -7.674029
## Shibata      -7.714058
## Hannan-Quinn -7.699053
## 
## $garch21t
##                       
## Akaike       -7.856204
## Bayes        -7.812659
## Shibata      -7.856338
## Hannan-Quinn -7.839957
## 
## $garch21st
##                       
## Akaike       -7.871504
## Bayes        -7.824330
## Shibata      -7.871661
## Hannan-Quinn -7.853904
## 
## $garch21g
##                       
## Akaike       -7.849853
## Bayes        -7.806308
## Shibata      -7.849987
## Hannan-Quinn -7.833607
## 
## $garch21sg
##                       
## Akaike       -7.865680
## Bayes        -7.818506
## Shibata      -7.865837
## Hannan-Quinn -7.848080
## 
## $garch22n
##                       
## Akaike       -7.712566
## Bayes        -7.669021
## Shibata      -7.712700
## Hannan-Quinn -7.696320
## 
## $garch22t
##                       
## Akaike       -7.854829
## Bayes        -7.807655
## Shibata      -7.854987
## Hannan-Quinn -7.837229
## 
## $garch22st
##                       
## Akaike       -7.870126
## Bayes        -7.819323
## Shibata      -7.870308
## Hannan-Quinn -7.851172
## 
## $garch22g
##                       
## Akaike       -7.848475
## Bayes        -7.801301
## Shibata      -7.848633
## Hannan-Quinn -7.830875
## 
## $garch22sg
##                       
## Akaike       -7.864317
## Bayes        -7.813514
## Shibata      -7.864499
## Hannan-Quinn -7.845363
VNI.info.mat <- sapply(VNI.model.list1, infocriteria)
VNI.info.mat
##       garch11n  garch21n  garch21t garch21st  garch21g garch21sg  garch22n
## [1,] -7.711787 -7.713945 -7.856204 -7.871504 -7.849853 -7.865680 -7.712566
## [2,] -7.679128 -7.674029 -7.812659 -7.824330 -7.806308 -7.818506 -7.669021
## [3,] -7.711862 -7.714058 -7.856338 -7.871661 -7.849987 -7.865837 -7.712700
## [4,] -7.699602 -7.699053 -7.839957 -7.853904 -7.833607 -7.848080 -7.696320
##       garch22t garch22st  garch22g garch22sg
## [1,] -7.854829 -7.870126 -7.848475 -7.864317
## [2,] -7.807655 -7.819323 -7.801301 -7.813514
## [3,] -7.854987 -7.870308 -7.848633 -7.864499
## [4,] -7.837229 -7.851172 -7.830875 -7.845363
VNI.inds <- which(VNI.info.mat == min(VNI.info.mat), arr.ind=TRUE)
 model.VNI <- colnames(VNI.info.mat)[VNI.inds[,2]]
 model.VNI
## [1] "garch21st"

Trích xuất chuỗi phần dư u của chuỗi XAU.USD

XAU.res <- residuals(XAU.garch22sg.fit)/sigma(XAU.garch22sg.fit)
fitdist(distribution = "sged", XAU.res, control = list())
## $pars
##         mu      sigma       skew      shape 
## -0.0151294  0.9966367  0.9469294  1.2428468 
## 
## $convergence
## [1] 0
## 
## $values
## [1] 2065.913 2015.530 2015.530
## 
## $lagrange
## [1] 0
## 
## $hessian
##           [,1]       [,2]       [,3]      [,4]
## [1,] 1978.3268  322.14833 -681.81296 -52.13820
## [2,]  322.1483 1866.93662  -83.69796 176.35211
## [3,] -681.8130  -83.69796 1127.91352  71.36227
## [4,]  -52.1382  176.35211   71.36227 281.80683
## 
## $ineqx0
## NULL
## 
## $nfuneval
## [1] 98
## 
## $outer.iter
## [1] 2
## 
## $elapsed
## Time difference of 0.287292 secs
## 
## $vscale
## [1] 1 1 1 1 1
uXAU <- pdist(distribution = "sged", q = XAU.res, mu = -0.0151294 , sigma = 0.9966367  ,skew = 0.9469294 ,shape =  1.2428468    )

Trích xuất chuỗi phần dư u của chuỗi VNI

VNI.res <- residuals(VNI.garch21st.fit)/sigma(VNI.garch21st.fit)
fitdist(distribution = "sstd", VNI.res, control = list())
## $pars
##          mu       sigma        skew       shape 
## -0.01023424  1.00199113  0.83094357  4.21974648 
## 
## $convergence
## [1] 0
## 
## $values
## [1] 2118.742 1940.301 1940.301
## 
## $lagrange
## [1] 0
## 
## $hessian
##            [,1]      [,2]       [,3]      [,4]
## [1,] 2085.69796  442.2572 -618.26810  24.79439
## [2,]  442.25716 1902.6492  160.10368 126.22200
## [3,] -618.26810  160.1037 1367.89391  21.24677
## [4,]   24.79439  126.2220   21.24677  13.09180
## 
## $ineqx0
## NULL
## 
## $nfuneval
## [1] 94
## 
## $outer.iter
## [1] 2
## 
## $elapsed
## Time difference of 0.136323 secs
## 
## $vscale
## [1] 1 1 1 1 1
uVNI = pdist("sstd",VNI.res, mu =-0.01023424   , sigma = 1.00199113   , skew = 0.83094357  , shape =  4.21974648   )

Các kiểm định sự phù hợp của mô hình biên

Kiểm định Anderson-Darling

library(kSamples)
## Warning: package 'kSamples' was built under R version 4.3.3
## Loading required package: SuppDists
## Warning: package 'SuppDists' was built under R version 4.3.3
## 
## Attaching package: 'kSamples'
## The following object is masked from 'package:goftest':
## 
##     ad.test
library(nortest)
## 
## Attaching package: 'nortest'
## The following object is masked from 'package:kSamples':
## 
##     ad.test
## The following objects are masked from 'package:goftest':
## 
##     ad.test, cvm.test
#test with Anderson-Darling
library(goftest)
ad_VNI <- ad.test(uVNI)
ad_XAU <- ad.test(uXAU)


#Kiểm định Cramer-von Mises
cvm_VNI <- cvm.test(uVNI)
## Warning in cvm.test(uVNI): p-value is smaller than 7.37e-10, cannot be computed
## more accurately
cvm_XAU <- cvm.test(uXAU)
## Warning in cvm.test(uXAU): p-value is smaller than 7.37e-10, cannot be computed
## more accurately
# Kiem dinh ks-test
ks_VNI <- ks.test(uVNI, "punif")
ks_XAU <- ks.test(uXAU, "punif")

#Trình bày kết quả
test <- data.frame(test = c('P_value VNI' ,'P_value XAU'),
                    AD = c(ad_VNI$p.value, ad_XAU$p.value),
                    CVM = c(cvm_VNI$p.value, cvm_XAU$p.value),
                   KS = c(ks_VNI$p.value,ks_XAU$p.value))

library(tidyverse)
library(kableExtra)
library(knitr)
print(test)
##          test      AD      CVM        KS
## 1 P_value VNI 3.7e-24 7.37e-10 0.2817218
## 2 P_value XAU 3.7e-24 7.37e-10 0.9361819

ƯỚC LƯỢNG THAM SỐ MÔ HÌNH COPULA

library(copula)
library(VineCopula)

# Assuming uXAU and uVNI are already uniform margins

# Copula selection
selectedCopula <- BiCopSelect(uXAU, uVNI, familyset = 1:9, selectioncrit="AIC", indeptest = FALSE, level = 0.05)
gau <- BiCopEst(uXAU,uVNI,family = 1, method = "mle", se = T, max.df = 10)
stu <- BiCopEst(uXAU,uVNI,family = 2, method = "mle", se = T, max.df = 10)
# Copula estimation
copulaFit <- BiCopEst(uXAU, uVNI, family = selectedCopula$family, method = "mle", se = T, max.df = 10)

# Summary of the fitted copula
summary(copulaFit)
## Family
## ------ 
## No:    34
## Name:  Rotated Gumbel 270 degrees
## 
## Parameter(s)
## ------------
## par:  -1.04  (SE = 0.02)
## 
## Dependence measures
## -------------------
## Kendall's tau:    -0.04 (empirical = -0.03, p value = 0.07)
## Upper TD:         0 
## Lower TD:         0 
## 
## Fit statistics
## --------------
## logLik:  5.28 
## AIC:    -8.55 
## BIC:    -3.27

Kết quả mô hình ARMA(2,2)-GJR-Garch(2,2)-Sged của biến XAU

library(tidyverse)
XAU.garch22sg.fit 
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(2,2)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : ged 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error    t value Pr(>|t|)
## mu      0.000176    0.000089   1.964712 0.049448
## ar1     0.207003    0.011185  18.507388 0.000000
## ar2    -0.953014    0.011582 -82.281821 0.000000
## ma1    -0.212996    0.014477 -14.712881 0.000000
## ma2     0.922289    0.014694  62.765824 0.000000
## omega   0.000001    0.000002   0.340910 0.733171
## alpha1  0.000155    0.020936   0.007419 0.994080
## alpha2  0.153430    0.048280   3.177906 0.001483
## beta1   0.220285    0.033345   6.606197 0.000000
## beta2   0.638611    0.118717   5.379260 0.000000
## gamma1  0.015488    0.038456   0.402747 0.687134
## gamma2 -0.114706    0.016169  -7.094165 0.000000
## shape   1.236551    0.054940  22.507188 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error     t value Pr(>|t|)
## mu      0.000176    0.000136    1.288739  0.19749
## ar1     0.207003    0.011916   17.372548  0.00000
## ar2    -0.953014    0.005610 -169.875363  0.00000
## ma1    -0.212996    0.007621  -27.949488  0.00000
## ma2     0.922289    0.017379   53.068179  0.00000
## omega   0.000001    0.000039    0.016332  0.98697
## alpha1  0.000155    0.530460    0.000293  0.99977
## alpha2  0.153430    1.333935    0.115020  0.90843
## beta1   0.220285    2.872393    0.076690  0.93887
## beta2   0.638611    1.384399    0.461291  0.64459
## gamma1  0.015488    0.040636    0.381142  0.70310
## gamma2 -0.114706    0.934143   -0.122793  0.90227
## shape   1.236551    1.712930    0.721892  0.47036
## 
## LogLikelihood : 6138.273 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -8.4138
## Bayes        -8.3667
## Shibata      -8.4140
## Hannan-Quinn -8.3962
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       1.978  0.1596
## Lag[2*(p+q)+(p+q)-1][11]     4.940  0.9671
## Lag[4*(p+q)+(p+q)-1][19]     7.643  0.8408
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.4038  0.5251
## Lag[2*(p+q)+(p+q)-1][11]    2.0484  0.9573
## Lag[4*(p+q)+(p+q)-1][19]    3.2080  0.9929
## d.o.f=4
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[5]   0.01649 0.500 2.000  0.8978
## ARCH Lag[7]   0.59250 1.473 1.746  0.8720
## ARCH Lag[9]   0.67022 2.402 1.619  0.9698
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  331.5984
## Individual Statistics:               
## mu      0.15888
## ar1     0.08463
## ar2     0.27350
## ma1     0.07843
## ma2     0.37258
## omega  60.58513
## alpha1  0.27723
## alpha2  0.19546
## beta1   0.29713
## beta2   0.31509
## gamma1  0.30901
## gamma2  0.19094
## shape   0.09036
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          2.89 3.15 3.69
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                    t-value   prob sig
## Sign Bias           1.4359 0.1512    
## Negative Sign Bias  0.9581 0.3382    
## Positive Sign Bias  1.0120 0.3117    
## Joint Effect        2.3314 0.5065    
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     32.54      0.02712
## 2    30     32.21      0.31055
## 3    40     47.85      0.15653
## 4    50     45.99      0.59583
## 
## 
## Elapsed time : 4.584688
library(knitr)

library(kableExtra)
#Trình bày kết quả

extract_garch_results <- function(fit) {
  coef <- coef(fit)
  se <- fit@fit$se.coef
  pvalues <- 2 * (1 - pnorm(abs(fit@fit$tval))) # tính giá trị p từ giá trị t
  results <- cbind(coef, se, pvalues)
  colnames(results) <- c("Estimate", "Std. Error", "Pr(>|z|)")
  return(results)
}
fit1 <- extract_garch_results(XAU.garch22sg.fit)
print(fit1)
##             Estimate   Std. Error     Pr(>|z|)
## mu      1.755142e-04 8.933332e-05 4.944762e-02
## ar1     2.070034e-01 1.118490e-02 0.000000e+00
## ar2    -9.530136e-01 1.158231e-02 0.000000e+00
## ma1    -2.129959e-01 1.447683e-02 0.000000e+00
## ma2     9.222895e-01 1.469413e-02 0.000000e+00
## omega   6.312975e-07 1.851799e-06 7.331710e-01
## alpha1  1.553254e-04 2.093577e-02 9.940804e-01
## alpha2  1.534296e-01 4.828010e-02 1.483426e-03
## beta1   2.202849e-01 3.334519e-02 3.943201e-11
## beta2   6.386107e-01 1.187172e-01 7.479253e-08
## gamma1  1.548803e-02 3.845598e-02 6.871344e-01
## gamma2 -1.147063e-01 1.616911e-02 1.301403e-12
## shape   1.236551e+00 5.494025e-02 0.000000e+00

Kết quả mô hình ARMA(2,2)-GJR-Garch(2,1)-Skewed Student của biến VNI

library(tidyverse)
VNI.garch21st.fit
## 
## *---------------------------------*
## *          GARCH Model Fit        *
## *---------------------------------*
## 
## Conditional Variance Dynamics    
## -----------------------------------
## GARCH Model  : gjrGARCH(2,1)
## Mean Model   : ARFIMA(2,0,2)
## Distribution : sstd 
## 
## Optimal Parameters
## ------------------------------------
##         Estimate  Std. Error     t value Pr(>|t|)
## mu     -0.000001    0.000003    -0.51472 0.606752
## ar1    -0.362262    0.028740   -12.60457 0.000000
## ar2     0.044761    0.026312     1.70120 0.088906
## ma1    -0.578157    0.000300 -1928.55203 0.000000
## ma2    -0.390991    0.000308 -1270.06883 0.000000
## omega   0.000001    0.000001     0.91168 0.361939
## alpha1  0.006296    0.043457     0.14487 0.884815
## alpha2  0.022793    0.045159     0.50473 0.613749
## beta1   0.868603    0.027155    31.98644 0.000000
## gamma1  0.346620    0.101967     3.39932 0.000676
## gamma2 -0.203859    0.094163    -2.16495 0.030392
## skew    0.836313    0.034724    24.08480 0.000000
## shape   4.209347    0.515075     8.17230 0.000000
## 
## Robust Standard Errors:
##         Estimate  Std. Error     t value Pr(>|t|)
## mu     -0.000001    0.000006    -0.25006 0.802543
## ar1    -0.362262    0.034282   -10.56721 0.000000
## ar2     0.044761    0.038621     1.15899 0.246462
## ma1    -0.578157    0.000426 -1357.75075 0.000000
## ma2    -0.390991    0.000417  -938.33901 0.000000
## omega   0.000001    0.000009     0.11471 0.908674
## alpha1  0.006296    0.056090     0.11224 0.910633
## alpha2  0.022793    0.078918     0.28882 0.772722
## beta1   0.868603    0.164887     5.26787 0.000000
## gamma1  0.346620    0.133192     2.60240 0.009257
## gamma2 -0.203859    0.128610    -1.58509 0.112945
## skew    0.836313    0.117135     7.13973 0.000000
## shape   4.209347    1.360548     3.09386 0.001976
## 
## LogLikelihood : 5743.455 
## 
## Information Criteria
## ------------------------------------
##                     
## Akaike       -7.8715
## Bayes        -7.8243
## Shibata      -7.8717
## Hannan-Quinn -7.8539
## 
## Weighted Ljung-Box Test on Standardized Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                      0.8657  0.3522
## Lag[2*(p+q)+(p+q)-1][11]    2.4867  1.0000
## Lag[4*(p+q)+(p+q)-1][19]    4.5237  0.9979
## d.o.f=4
## H0 : No serial correlation
## 
## Weighted Ljung-Box Test on Standardized Squared Residuals
## ------------------------------------
##                          statistic p-value
## Lag[1]                       1.783  0.1817
## Lag[2*(p+q)+(p+q)-1][8]      2.537  0.7693
## Lag[4*(p+q)+(p+q)-1][14]     4.988  0.7710
## d.o.f=3
## 
## Weighted ARCH LM Tests
## ------------------------------------
##             Statistic Shape Scale P-Value
## ARCH Lag[4]    0.1669 0.500 2.000  0.6829
## ARCH Lag[6]    0.3117 1.461 1.711  0.9423
## ARCH Lag[8]    1.3056 2.368 1.583  0.8749
## 
## Nyblom stability test
## ------------------------------------
## Joint Statistic:  111.2287
## Individual Statistics:               
## mu      0.16746
## ar1     0.06632
## ar2     0.25412
## ma1     0.23761
## ma2     0.26875
## omega  22.66056
## alpha1  0.17802
## alpha2  0.16753
## beta1   0.15757
## gamma1  0.15189
## gamma2  0.12873
## skew    0.13809
## shape   0.17779
## 
## Asymptotic Critical Values (10% 5% 1%)
## Joint Statistic:          2.89 3.15 3.69
## Individual Statistic:     0.35 0.47 0.75
## 
## Sign Bias Test
## ------------------------------------
##                    t-value    prob sig
## Sign Bias           1.6148 0.10658    
## Negative Sign Bias  2.0461 0.04092  **
## Positive Sign Bias  0.8177 0.41366    
## Joint Effect        7.0653 0.06984   *
## 
## 
## Adjusted Pearson Goodness-of-Fit Test:
## ------------------------------------
##   group statistic p-value(g-1)
## 1    20     26.23      0.12403
## 2    30     48.74      0.01230
## 3    40     61.91      0.01121
## 4    50     73.74      0.01269
## 
## 
## Elapsed time : 1.352411
library(knitr)

library(kableExtra)
#Trình bày kết quả

extract_garch_results <- function(fit) {
  coef <- coef(fit)
  se <- fit@fit$se.coef
  pvalues <- 2 * (1 - pnorm(abs(fit@fit$tval))) # tính giá trị p từ giá trị t
  results <- cbind(coef, se, pvalues)
  colnames(results) <- c("Estimate", "Std. Error", "Pr(>|z|)")
  return(results)
}
fit3 <- extract_garch_results(VNI.garch21st.fit)
print(fit3)
##             Estimate   Std. Error     Pr(>|z|)
## mu     -1.440339e-06 2.798324e-06 6.067523e-01
## ar1    -3.622618e-01 2.874050e-02 0.000000e+00
## ar2     4.476143e-02 2.631170e-02 8.890561e-02
## ma1    -5.781570e-01 2.997881e-04 0.000000e+00
## ma2    -3.909914e-01 3.078506e-04 0.000000e+00
## omega   1.032747e-06 1.132800e-06 3.619391e-01
## alpha1  6.295525e-03 4.345706e-02 8.848153e-01
## alpha2  2.279288e-02 4.515859e-02 6.137488e-01
## beta1   8.686032e-01 2.715535e-02 0.000000e+00
## gamma1  3.466197e-01 1.019675e-01 6.755452e-04
## gamma2 -2.038590e-01 9.416346e-02 3.039166e-02
## skew    8.363128e-01 3.472368e-02 0.000000e+00
## shape   4.209347e+00 5.150751e-01 2.220446e-16
library(copula)
library(VineCopula)
library(tidyverse)
library(kableExtra)
#Lựa chọn và ước lượng
opt_cop <- BiCopSelect(uXAU,uVNI,selectioncrit = "AIC",method = "mle")
est_opt_cop <- BiCopEst(uXAU,uXAU,family = opt_cop$family,method = "mle",max.df = 30)

#Trình bày kết quả
est_opt_cop_dt <- data.frame(mqh = c('VNI-XAU'),
                    Copula = est_opt_cop$familyname,
                    Thamso = est_opt_cop$par,
                  Thamso2 = est_opt_cop$par2,
                   duoiduoi = est_opt_cop$taildep$lower,
                  duoitren = est_opt_cop$taildep$upper,
                  tau = est_opt_cop$tau,
                  aic = est_opt_cop$AIC,
                  bic = est_opt_cop$BIC)

print(est_opt_cop_dt)
##       mqh                     Copula    Thamso Thamso2 duoiduoi duoitren
## 1 VNI-XAU Rotated Gumbel 270 degrees -1.000155       0        0        0
##             tau      aic      bic
## 1 -0.0001546443 2.527038 7.810487

VẼ COPULA

library(VC2copula)
copula <- VC2copula::r270GumbelCopula(param = est_opt_cop$par)
# Sử dụng hàm persp để vẽ đồ thị 3D
persp(copula, dCopula, xlab = "u", ylab = "v", col = "lightgreen",
      main = "Đồ thị PDF của mô hình r270GumbelCopula")