Description Usage Arguments Value Author(s) Examples
Method for creating a DCC-GARCH filter object.
1 2 3 |
spec |
A |
data |
A multivariate data object as ‘matrix’ or ‘data.frame’. |
out.sample |
A positive integer indicating the number of periods before the last to keep for out of sample forecasting. |
filter.control |
Control arguments passed to the filtering routine. |
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. |
VAR.fit |
(optional) A previously estimated VAR list returned from calling the
|
... |
. |
A DCCfilter
object containing details of the DCC-GARCH filter.
Alexios Ghalanos
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 | ## 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 = "mvlaplace")
# fit the model
fit = dccfit(data = Dat, spec = spec, out.sample = 100, solver = "solnp",
fit.control = list(scale = TRUE, eval.se = FALSE))
# check the filter
spec2 = spec
# fix the dcc parameters
spec2@mspec$optimization.model$fixed.pars = coef(fit, type = "dcc")
# fix the garchpars
for(i in 1:4) spec2@uspec@spec[[i]]@optimization.model$fixed.pars = coef(fit@ufit@fit[[i]])
filt = dccfilter(spec = spec2, data = Dat, out.sample = 100)
# do a small comparison:
cat("Fit and Filtered DCC models Conditional Correlation check:")
print( rcov(fit)[,,1] == rcov(filt)[,,1] )
print( rcov(fit)[,,100] == rcov(filt)[,,100] )
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.