An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20110721/9b0583f1/attachment.pl>
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:
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.
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:
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)?
Correct(or whatever lag is).
2. if lag.max=3 then lag length will be chosen according to the information criterion from 1 to 3?
Correct.
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 ?
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).
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?
Correct.
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?
Yes.
Thank you in advance! Kind regards, Jacek
HTH. Alexios
-- 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.
_______________________________________________ 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.
Thank you very much once again Alexios! Kind regards, Jacek -- View this message in context: http://r.789695.n4.nabble.com/rgarch-package-VAR-in-DCC-model-example-tp3683371p3688600.html Sent from the Rmetrics mailing list archive at Nabble.com.