[R-SIG-Finance] A question about function: dccsim in rmgarch package

alexios ghalanos alexios at 4dscape.com
Mon Sep 3 13:24:53 CEST 2012


Hi ZHU Cai,

The returned object is of class "DCCsim" and more generally "mGARCHsim". 
All mGARCHsim classes have an "msim" and "model" slot:
slotNames(dccsim)
[1] "msim"  "model"

names(dccsim at msim)
[1] "simH"   "simR"   "simQ"   "simX"   "simZ"   "simRes" "rseed"

- simH (conditional covariance) is a list of 3d arrays of length m.sim 
and array length no.assets x no.assets x n.sim

- simR (conditional correlation) is a list of 3d arrays of length m.sim 
and array length no.assets x no.assets x n.sim

- simQ (conditional correlation DCC proxy process) is a list of 3d 
arrays of length m.sim and array length no.assets x no.assets x n.sim

- simX (conditional mean)  is a list of matrices of length m.sim and 
dimensions n.sim x no.assets.

Therefore, to obtain the m.sim x no.assets matrix of the simulated 
1-ahead conditional mean:

t(sapply(dccsim at msim$simX, FUN = function(x) x))


Regards,
Alexios

On 03/09/2012 09:33, cai zhu wrote:
> Dear All:
>
> Recently, I need to do a asset allocation exercise in R using rmgarch
> package. One-step ahead out of sample returns is needed. I use the
> following code:
>
> uspec <- ugarchspec(mean.model=list(armaOrder=c(1,0), include.mean=FALSE),
>                      variance.model=list(garchOrder=c(1,1), model="sGARCH"),
>                      distribution.model="norm")
>
> mspec <- multispec(replicate(2, uspec))
>
> dspec <- dccspec(mspec, VAR=FALSE, robust=FALSE, lag=1,
>                   dccOrder=c(1, 1), asymmetric=FALSE, type="2-step",
>                   distribution = "mvnorm")
>
> dccgarch <- dccfit(dspec, subdata, solver="solnp",
> solver.control=list(trace=TRUE))
> dccsim <- dccsim(dccgarch, n.sim=1, m.sim=10000, startMethod="sample")
>
> Basically, I need 10000 different 1-step ahead returns for a 2-dimension
> time series. However, I do not know how to extract simulated returns from
> dccsim. I have read the rmgarch.tests, but still get no clue about it. Any
> help is appreciated. Thank you very much.
>
> Regards
>                              ZHU Cai
>
> 	[[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