[R] DCC model estimation with t-Student distribution rmgarch
jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Fri Aug 23 04:06:31 CEST 2019
This seems squarely in the "asking for statistical expertise" area, rather than the "how do I make R implement this theory I understand" area, so it is off topic on this mailing list. You might be in better company on Stack Exchange.
On August 22, 2019 5:55:43 AM PDT, Tommaso Ferrari <tomferri93 using gmail.com> wrote:
>I was analyzing and implementing the DCC model (Dynamic Conditional
>Correlation) for the one-day forecast calculation of the
>variance-covariance matrix of a system consisting of, approximately,
>30 stocks. For each title I consider a historical series of logarithmic
>daily returns of 250 samples.
>In particular, I was interested in the simulation of this model using
>In this regard I was using the "rugarch" and "rmgarch" packages.
>According to the examples found in the literature, I run my analysis in
>1) specification of the univariate garch model for each stock passing
>number of degrees of freedom of the t-Student distribution as input
>2) multifitting of the univariate garch models
>3) specification of DCC model with a multivariate t-Student
>(degrees of freedom are not passed as input, in this case)
>4) fitting of the DCC model
>5) variance-covariance matrix forecasting
>I give an example of the code I'm running (qxts is the time series
>mshape is the number of degrees of freedom):
># GARCH(1,1) specification
>garch11.spec = ugarchspec(mean.model = list(armaOrder = c(0, 0)),
>variance.model = list(garchOrder = c(1, 1), model = "sGARCH"),
>distribution.model = "std", fixed.pars = list(shape = mshape))
># replicate Garch(1,1) spec for both time series
>uspec = multispec(replicate(ncol(qxts), garch11.spec))
># Fit Garch models: hybrid -> in case of non convergence, all solvers
>multf = multifit(uspec, qxts, solver = "hybrid", fit.control =
># Dcc model spec
>dcc.garch11.spec = dccspec(uspec = uspec, dccOrder = c(1, 1),
>= "mvt", model = "DCC")
># Fitting parameters of DCC
>dcc.fit = dccfit(dcc.garch11.spec, qxts, fit = multf, fit.control =
>list(scale = TRUE))
># dcc.fit = dccfit(dcc.garch11.spec, qxts, fit = multf, fit.control =
>list(scale = 1))
>dcc.fcst = dccforecast(dcc.fit, n.ahead = 1)
>varmat = rcov(dcc.fcst)[[dt_cov]][,, 1]
>However, using a number of degrees of freedom of 2.5, I get the
>Error in solve.default(A) : system is computationally singular:
>condition number = 1.19994e-18
>If, for example, I change the degrees of freedom from 2.5 to 2.6, the
>no longer appears.
>I would like to know if there is a way to allow the calculation to be
>performed even using a number of degrees of freedom equals to 2.5, as I
>cannot find any reference in the literature that addresses this
>I also tried the following idea.
>I don't pass the number of degrees of freedom as input, but I make sure
>that, for each title, the number of degrees of freedom is calculated
>internally by the function multifit.
>Obviously, I get different degrees of freedom depending on the stock
>In this case, however, passing the calculated parameters of the
>the dccfunction, leads to the following error:
>'data' must be of a vector type, was 'NULL'
>even if the data sample I pass as input contains no null value.
>I would like to know if these problems are due solely to the numerical
>values of the data passed as input or if I am conceptually wrong in the
>implementation of the method.
>Thanks to all
> [[alternative HTML version deleted]]
>R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.
Sent from my phone. Please excuse my brevity.
More information about the R-help