Skip to content

rgarch package - VAR in DCC model example

6 messages · Jacek Ernie, zoe_zhang, Jacek +1 more

#
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:
#
Hello,
sorry to bother.
 I am trying to use rgarch package too. But I have problems to load the
package. Coule you please give me some guidance?
I download the rgarch package from
https://r-forge.r-project.org/R/?group_id=339 and then put it in the library
but it still doesn't work.

Thank you so much

cheers,
Zoe

--
View this message in context: http://r.789695.n4.nabble.com/rgarch-package-VAR-in-DCC-model-example-tp3683371p3684370.html
Sent from the Rmetrics mailing list archive at Nabble.com.
#
Thank you very much Alexios.

May I just ask a few questions related to this code:

1. lag.max=NULL means you force the lag length to be equal 1 (lag=1)?

2. if lag.max=3 then lag length will be chosen according to the information
criterion from 1 to 3?

3. if after this code you write "fit" then you see univariate and DCC
estimates but no VAR (why?). Is this is the right why to get them:
fit at mfit$model$vrmodel$Bcoef ?

4. "see ?dccfit for option of passing the VAR estimate seperately at this
stage" - using varxfilter? But varxfilter doesn't find the optimal lag
length right? 

5. In the desription to rgarch package is writen that "For high frequency
data, the user should make use of non-named representation such as matrix".
So if I want to use it for intraday data this code should be working as it
is?

Thank you in advance!

Kind regards,
Jacek

--
View this message in context: http://r.789695.n4.nabble.com/rgarch-package-VAR-in-DCC-model-example-tp3683371p3686647.html
Sent from the Rmetrics mailing list archive at Nabble.com.
#
On 22/07/2011 14:13, Jacek wrote:
Correct(or whatever lag is).
Correct.
VAR estimate too big to fit on screen. Yes, use 
fit at mfit$model$vrmodel$Bcoef (will add a method in next release to make 
it more easily accessible).
Correct.
Yes.
HTH.
Alexios