dccroll-methods: function: DCC-GARCH Rolling Forecast

Description Usage Arguments Value Author(s) Examples

Description

Method for creating a DCC-GARCH rolling forecast object.

Usage

1
2
3
4
dccroll(spec, data, n.ahead = 1, forecast.length = 50, refit.every = 25, 
refit.window = c("recursive", "moving"), solver = "solnp", fit.control = list(eval.se = TRUE),  
parallel = FALSE, parallel.control = list(pkg = c("multicore", "snowfall"), cores = 2), 
solver.control = list(), save.fit = FALSE, save.wdir = NULL, trace = FALSE, ...)

Arguments

spec

A DCCspec object with fixed parameters.

data

A multivariate dataset as ‘matrix’ or ‘data.frame’.

n.ahead

The number of periods to forecast.

forecast.length

The length of the total forecast for which out of sample data from the dataset will be excluded for testing.

refit.every

Determines every how many periods the model is re-estimated.

refit.window

Whether the refit is done on an expanding window including all the previous data or a moving window, the length of the window determined by the argument above (“refit.every”).

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.

solver

The solver to use.

fit.control

Control parameters parameters passed to the fitting function.

solver.control

Control parameters passed to the solver.

save.fit

Whether to save the fitted objects of class DCCfit during the estimation of each (“refit.every”). If true, the directory to save must be provided (see below). The function will not save this by default for reasons of memory management, but can save it as an “.rda” file in the user's chosen directory for further analysis.

save.wdir

If “save.fit” is true, the directory in which to save the DCCfit objects (1 for each “refit.every”).

trace

Traces out each roll iteration.

...

.

Value

A DCCroll object containing details of the DCC-GARCH forecast.

Author(s)

Alexios Ghalanos

Examples

 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
## Not run: 
data(dji30ret)
Dat = dji30ret[, 1:5, 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")
uspec5 = ugarchspec(mean.model = list(armaOrder = c(1,1)), variance.model = list(model = "eGARCH",
		garchOrder = c(1, 1)), distribution.model = "norm")

uspec = c( uspec1, uspec2, uspec3, uspec4, uspec5 )
spec = dccspec(uspec = multispec( uspec ), dccOrder = c(1,1), distribution = "mvt")

roll = dccroll(spec, data = Dat, n.ahead = 1, forecast.length = 100, refit.every = 25, 
		refit.window = "moving", solver = "solnp", 
		fit.control = list(eval.se = FALSE), solver.control = list(), 
		save.fit = FALSE, save.wdir = NULL, trace = TRUE)

roll
cat("\nAverage Log-Likelihood Across Rolls:\n")
print( round( likelihood(object)/object@spec$n.data, 2) )

cat("\nCorrelation from roll object\n")
cat("\nis(rcor(roll, roll = 1))[1]\n")
is(rcor(roll))[1]
cat("\nThere are 4 rolls (forecast.length/refit.every).")
cat("\nEach rolling window correlation is a list of arrays of Length = refit.every,")
cat("\nwith each array equal to m x m (no. assets) by n.ahead.\n")
cat("\nSince n.ahead = 1, reshape list to array:.")
cat("\narray(unlist(rcor(roll, roll = 1)) , dim = c(5,5,25))\n")
array(unlist(rcor(roll)) , dim = c(5,5,25))

## End(Not run)

rgarch documentation built on May 31, 2017, 3:20 a.m.