cgarchsim-methods: function: Copula-GARCH Simulation

Description Usage Arguments Details Value Author(s) References Examples

Description

Method for creating a Copula-GARCH simulation object.

Usage

1
2
3
4
cgarchsim(fit, n.sim = 1000, n.start = 0, m.sim = 1, startMethod = c("unconditional", "sample"), 
presigma = NULL, preresiduals = NULL, prereturns = NULL, preR = NULL, rseed = NULL, 
mexsimdata = NULL, vexsimdata = NULL, parallel = FALSE, parallel.control = list(pkg = c("multicore", 
"snowfall"), cores = 2), VAR.fit = NULL, ...)

Arguments

fit

A cGARCHfit object created by calling either cgarchfit.

n.sim

The simulation horizon.

n.start

The burn-in sample.

m.sim

The number of simulations.

startMethod

Starting values for the simulation. Valid methods are ‘unconditional’ for the expected values given the density, and ‘sample’ for the ending values of the actual data from the fit object.

presigma

Allows the starting sigma values to be provided by the user.

prereturns

Allows the starting return data to be provided by the user.

preresiduals

Allows the starting residuals to be provided by the user.

preR

Allows the starting correlation to be provided by the user.

rseed

Optional seeding value(s) for the random number generator. This should be of length equal to m.sim.

mexsimdata

A list (equal to the number of asset) of matrices of simulated external regressor-in-mean data with row length equal to n.sim + n.start. If the fit object contains external regressors in the mean equation, this must be provided else will be assumed to be zero.

vexsimdata

A list (equal to the number of asset) of matrices of simulated external regressor-in-variance data with row length equal to n.sim + n.start. If the fit object contains external regressors in the variance equation, this must be provided else will be assumed to be zero.

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

An optional VAR.fit list returned from calling the varxfilter function. This is not currently used but is for future expandability of the method to dispatch via a cGARCHspec object.

...

.

Details

Since there is no explicit forecasting routine, the user should use this method for incrementally building up n-ahead forecasts by simulating 1-ahead, obtaining the means of the returns, sigma, Rho etc and feeding them to the next round of simulation as starting values.

Value

A cGARCHsim object containing details of the Copula-GARCH simulation.

Author(s)

Alexios Ghalanos

References

Joe, H. Multivariate Models and Dependence Concepts, 1997, Chapman \& Hall, London.
Genest, C., Ghoudi, K. and Rivest, L. A semiparametric estimation procedure of dependence parameters in multivariate families of distributions, 1995, Biometrika, 82, 543-552.

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
## Not run: 
data(dji30ret)
Dat = dji30ret[, 1:3, drop = FALSE]
# Copula-Student (non time varying - Max Likelihood Estimation of Rho)
uspec = ugarchspec(mean.model = list(armaOrder = c(1,0)), variance.model = list(model = "sGARCH"), 
		distribution.model = "norm")
spec = cgarchspec(uspec = multispec( replicate(3, uspec) ), VAR = TRUE, VAR.opt = list(lag = 1, lag.max = 4, 
lag.criterion = c("AIC", "HQ", "SC", "FPE"), external.regressors = NULL), 
dccOrder = c(1,1), distribution.model = list(copula = c("mvnorm"), method = c("ML"),
time.varying = TRUE, transformation = "parametric"), start.pars = list(), fixed.pars = list())	

fit1 = cgarchfit(spec, data = Dat, spd.control = list(lower = 0.1, upper = 0.9, type = "pwm", kernel = "epanech"), 
		fit.control = list(eval.se = FALSE, trace = TRUE), solver = "solnp")
preR = last(rcor(fit1),1)[,,1]
diag(preR) = 1
# a '.fitlist' (univariate uGARCHmultifit) is always returns to the global environment when fitting 
# mgarch models.
sim1 = cgarchsim(fit1, n.sim = 1, n.start = 0, m.sim = 3500, presigma = tail(sigma(fit1), 1), 
startMethod = "sample", preR = preR, prereturns = tail( as.matrix(Dat), 4), 
preresiduals = tail(residuals(.fitlist), 1),rseed = 1:3500)

simmean1 = c(mean(sapply(sim1@msim$simX, FUN = function(x) x[,1])),
		mean(sapply(sim1@msim$simX, FUN = function(x) x[,2])),
		mean(sapply(sim1@msim$simX, FUN = function(x) x[,3])))

forcmean = round( rgarch:::varxforecast(X = Dat, Bcoef = fit1@mfit$vrmodel$Bcoef, p = 4, 
				out.sample = 0, n.ahead = 1, n.roll = 0, mregfor = NULL), 5)
tmp = data.frame(sim = round(simmean1,5), forc = round(as.numeric(forcmean),5), row.names = colnames(Dat))
print(tmp)	

## End(Not run)

rgarch documentation built on May 2, 2019, 5:22 p.m.