#clear rm(list=ls()) #set directory getwd() setwd("C:/Users/Isariya/Desktop") ############################################################## # COPULA-GARCH MODELING ############################################################## # install.packages("rmgarch") library(rmgarch) library(xlsx) library(fGarch) # import data temp <- tempfile() download.file("http://freakonometrics.free.fr/oil.xls",temp) oil=read.xlsx(temp,sheetName="DATA",dec=",") # DCC-GARCH (GARCH ???????????? ??? ?????????) garch11.spec = ugarchspec( mean.model = list(armaOrder = c(2,1)), variance.model = list(garchOrder = c(1,1), model = "GARCH"), distribution.model = "norm" ) dcc.garch11.spec = dccspec( uspec = multispec( replicate(3, garch11.spec)), dccOrder = c(1,1), distribution = "mvnorm") dcc.fit= dccfit(dcc.garch11.spec,data = dat) fcst=dccforecast(dcc.fit,n.ahead=200) plot(fcst)