[R-SIG-Finance] rgarch package - VAR in DCC model example

alexios alexios at 4dscape.com
Thu Jul 21 16:21:59 CEST 2011


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:
> Hi,
>
> I'm just looking for an example of how to use VAR in DCC model in rgarch
> package.
>
> Many thanks.
>
> Kind regards,
> Jacek
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- 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 mailing list