Description Usage Arguments Details Value Author(s) References Examples
Method for creating a DCC-GARCH forecast object.
1 2 |
fit |
A |
n.ahead |
The forecast horizon. |
n.roll |
The no. of rolling forecasts to create beyond the first one (see details). |
external.forecasts |
A list with forecasts for the external regressors in the mean and/or variance equations if specified (see details). |
parallel |
Whether to make use of parallel processing on multicore systems. |
parallel.control |
The parallel control options including the type of package for performing the parallel calculations (‘multicore’ for non-windows O/S and ‘snowfall’ for all O/S), and the number of cores to make use of. |
... |
. |
When using n.roll, it is assumed that dccfit
was called with argument ‘out.sample’
being large enough to cover n.rolls.
When n.roll = 0, all forecasts are based on an unconditional n-ahead forecast routine based on the
approximation method described in ENGLE and SHEPPARD (2001) paper (see reference below). If any
external regressors are present, then the user must pass in their unconditional forecasts in the
‘external.forecasts’ list, as matrices with dimensions equal to n.ahead x n.assets. This assumes
that the univariate GARCH specifications share common external regressors (this may change in the future).
When n.roll>0 and n.ahead = 1, then this is a pure rolling forecast based on the available out.sample
data provided for in the call to the fit routine. It is also assumed that if any external regressors
were passed to the fit routine that they contained enough values to cover the out.sample period so
that they could be used in this forecast scenario.
When n.roll > 0 AND n.ahead > 1, then what the routine does is first generate whatever available
rolling 1-ahead forecasts are possible based on the amount of out.sample data, and then generates
the remainder of the forecasts (n.ahead - 1) using the unconditional method so that we have a
combination of n.roll + n.ahead forecasts (see example). If any external regressors are present,
then they should contain enough out.sample points (passed to the fitting routine) to cover the
n.roll forecast, but the user must also pass n.ahead - 1 unconditional forecasts in the
‘external.forecasts’ list, as matrices with dimensions equal to n.ahead x n.assets.
A DCCforecast
object containing details of the DCC-GARCH forecast.
Alexios Ghalanos
Engle, R.F. and Sheppard, K. Theoretical and empirical properties of dynamic conditional
correlation multivariate GARCH, 2001, NBER Working Paper.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ## Not run:
data(dji30ret)
Dat = dji30ret[, 1:4, drop = FALSE]
uspec1 = ugarchspec(mean.model = list(armaOrder = c(1,0)), variance.model = list(model = "apARCH"),
distribution.model = "norm")
uspec2 = ugarchspec(mean.model = list(armaOrder = c(2,0)), variance.model = list(model = "gjrGARCH"),
distribution.model = "norm")
uspec3 = ugarchspec(mean.model = list(armaOrder = c(0,0)), variance.model = list(model = "sGARCH"),
distribution.model = "norm")
uspec4 = ugarchspec(mean.model = list(armaOrder = c(1,0)), variance.model = list(model = "sGARCH",
garchOrder = c(2, 1)), distribution.model = "norm")
uspec = c( uspec1, uspec2, uspec3, uspec4 )
spec = dccspec(uspec = multispec( uspec ), dccOrder = c(1,1), distribution = "mvt")
# fit the model
fit = dccfit(data = Dat, spec = spec, out.sample = 100, solver = "solnp",
fit.control = list(scale = TRUE, eval.se = FALSE))
# rolling forecast
forc1 = dccforecast(fit, n.ahead = 1, n.roll = 99)
# unconditional forecast
forc2 = dccforecast(fit, n.ahead = 100, n.roll = 0)
# combination of the 2
forc3 = dccforecast(fit, n.ahead = 2, n.roll = 99)
H1 = rcov(forc1)
H3 = rcov(forc3)
cat("\nDCC Forecast Summary:\n")
(forc1)
(forc2)
(forc3)
cat("\nRolling and mixed Rolling Forecast DCC model Conditional Covariance check:\n")
cat("\nFirst:\n")
print( H1[[1]][,,1] == H3[[1]][,,1] )
cat("\n100:\n")
print( H1[[100]][,,1] == H3[[100]][,,1] )
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.