Skip to content
Prev 8246 / 15274 Next

rgarch package - VAR in DCC model example

See ?dccspec

Code example follows:

# start code
library(rgarch)
data(dji30ret)
X = as.matrix(dji30ret[,1:5])

# univariate spec for 5 variables
uspec = multispec( replicate( 5, ugarchspec() ) )

# multivariate spec. VAR with 1 lag...(The robust version is slower but 
# uses a least trimmed squares procedure (see the references).
mspec = dccspec(uspec, VAR = TRUE, VAR.opt = list(robust = FALSE,
lag = 1, lag.max = NULL, lag.criterion = c("AIC", "HQ", "SC",
"FPE"), external.regressors = NULL, robust.control = list(gamma = 0.25,
delta = 0.01, nc = 10, ns = 500)), dccOrder = c(1, 1), distribution = 
c("mvnorm", "mvt", "mvlaplace")[1])

# see ?dccfit for option of passing the VAR estimate seperately at this 
# stage and the methods applicable to the dccfit object
# (?"DCCfit-class")
fit = dccfit(spec = mspec, X)

# end code

Now any mean forecast or simulation (via dccforecast or dccsim) will be 
based on the VAR estimate. Note that the DCC model is a 3-step 
estimation in the case of VAR (VAR -> univariate GARCH -> DCC), whilst 2 
step when using a univariate mean specification via ugarchspec().

Regards,

Alexios
On 21/07/2011 11:58, Jacek Ernie wrote: