Skip to content

dccfit (RMGARCH): using uGARCHmultifit

3 messages · borkrese@rch m@iii@g oii gm@ii@com, Alexios Ghalanos

#
Anyone tried the function input uGARCHmultifit of the dccfit function from rmgarch? If so can you provide an example of how you used it and how to setup the uGARCHmultifit object? I can't figure it out.

According to the documentation <https://www.rdocumentation.org/packages/rmgarch/versions/1.3-7/topics/dccfit-methods>  it should be possible to use the fit argument in dccfit where

*	" fit: (A previously estimated univariate '>uGARCHmultifit object (see details)."

I'd like to input my fits of several GARCH models directly into the final DCC estimation because the GARCH models where difficult to estimate (I used several optimizers).
#
Take a look at the examples in the inst/rmgarch.tests folder of the source package or this post from 7+ years ago: 

http://www.unstarched.net/2013/01/03/the-garch-dcc-model-and-2-stage-dccmvt-estimation/

-Alexios

  
  
#
Thanks Alexios for providing me references to examples. However, I?m not able to add a fit to the multifit object. How can I do this? See example below

 

library(rmgarch)

library(parallel)

data(dji30retw)

Dat = dji30retw[, 1:10, drop = FALSE]

 

# Ten-asset example from http://www.unstarched.net/2013/01/03/the-garch-dcc-model-and-2-stage-dccmvt-estimation/

 

# (1) Replicate example

xspec = ugarchspec(mean.model = list(armaOrder = c(1, 1)), variance.model = list(garchOrder = c(1,1), model = 'sGARCH'), distribution.model = 'norm')

uspec = multispec(replicate(10, xspec))

spec1 = dccspec(uspec = uspec, dccOrder = c(1, 1), distribution = 'mvnorm')

 

cl = makePSOCKcluster(10)

multf = multifit(uspec, Dat, cluster = cl)

multf at fit

 

fit1 = dccfit(spec1, data = Dat, fit.control = list(eval.se = TRUE), fit = multf, cluster = cl)

fit1 at mfit$matcoef

 

# (2) subset of 9 assets. 

uspec9 = multispec(replicate(9, xspec))

cl9 = makePSOCKcluster(9)

multf9 = multifit(uspec9, Dat[,1:9], cluster = cl9)

multf9 at fit

 

# (3) Suppose we want to add an additional fit (imagine it was hard to estimate)

fit10 <- ugarchfit(spec=xspec,data=Dat[,10],solver.control=list(trace=0))

 

multf10 <- multf9

multf10 at fit[[10]] <- fit10   # to be used in  dccfit(spec10, data = cbind(Dat[,1:9],Dat[,10]), fit.control = list(eval.se = TRUE), fit = multf10, cluster = cl)

 

## the last line does not seem to work: 

# Error in `colnames<-`(`*tmp*`, value = asset.names) 

#   attempt to set 'colnames' on an object with less than two dimensions

 

Thanks, Lasse

 

From: Alexios Galanos <alexios at 4dscape.com> 
Sent: 05 November 2020 08:16
To: borkresearch at gmail.com
Cc: R-SIG-Finance at r-project.org
Subject: Re: [R-SIG-Finance] dccfit (RMGARCH): using uGARCHmultifit

 

Take a look at the examples in the inst/rmgarch.tests folder of the source package or this post from 7+ years ago: 

http://www.unstarched.net/2013/01/03/the-garch-dcc-model-and-2-stage-dccmvt-estimation/

 

-Alexios
On Nov 4, 2020, at 10:48 PM, borkresearch at gmail.com <mailto:borkresearch at gmail.com> wrote:
?Anyone tried the function input uGARCHmultifit of the dccfit function from rmgarch? If so can you provide an example of how you used it and how to setup the uGARCHmultifit object? I can't figure it out.

According to the documentation <https://www.rdocumentation.org/packages/rmgarch/versions/1.3-7/topics/dccfit-methods>  it should be possible to use the fit argument in dccfit where

*    " fit: (A previously estimated univariate '>uGARCHmultifit object (see details)."

I'd like to input my fits of several GARCH models directly into the final DCC estimation because the GARCH models where difficult to estimate (I used several optimizers).





_______________________________________________
R-SIG-Finance at r-project.org <mailto: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.