[R-SIG-Finance] rgarch package - VAR in DCC model example
alexios at 4dscape.com
Thu Jul 21 16:21:59 CEST 2011
Code example follows:
# start code
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"))
# see ?dccfit for option of passing the VAR estimate seperately at this
# stage and the methods applicable to the dccfit object
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().
On 21/07/2011 11:58, Jacek Ernie wrote:
> I'm just looking for an example of how to use VAR in DCC model in rgarch
> Many thanks.
> Kind regards,
> [[alternative HTML version deleted]]
> R-SIG-Finance at r-project.org mailing list
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.
More information about the R-SIG-Finance