[R-SIG-Finance] Help specifying "ugarchsim" function

Gareth McEwan mcewan.gareth at gmail.com
Wed Mar 4 15:58:43 CET 2015


Hi there

I was wondering if someone can help me correctly specify the "ugarchsim( )"
function?

I used an external regressor in the variance equation, and 2 external
regressors in the mean equation, as follows:

data <- diff(log(price series))

spec <- ugarchspec(variance.model = list(model = "gjrGARCH", garchOrder =
c(1,1),
          submodel = NULL, *external.regressors = matrix(c5, ncol = 1)*,
variance.targeting = T),
          mean.model = list(armaOrder = c(0,0), include.mean = T,
          *external.regressors = matrix(c(c1, c2), ncol = 2)*,
          arfima = F, archpow = 1, archm = F), distribution.model = "sstd")

*garchfit.GMC1* <- ugarchfit(spec = spec, data = data, solver = "hybrid")

I then work through SPD fitting to get the associated uniform variates.
They go through a copula fitting procedure, with
other variables, from which I later generate random variates (using
"rMvdc"). I then transform, say, column 4 of the
random variates matrix back to uniform variates to standardized residuals,
contained in a "qspd" object, *nf.SPD.sim.4*

I wish to correctly specify the "ugarchsim" function. I put the
pre-recorded innovations in the "custom.dist" slot, but I
am not sure how (or if) I should use "pre-sampled external regressor data
for use with models which were defined with
such (mexsimdata for conditional mean and vexsimdata for conditional
variance)".

nf.sim.GMC1.SPD.1 <- ugarchsim(*garchfit.GMC1*, n.sim = 100000, m.sim = 1,
          startMethod = "sample", n.start = 0,
          custom.dist = list(name = "sample", distfit = matrix(
*nf.SPD.sim.4*, ncol = 1), type = "z"))

Can anybody help me?

Also, please note: length(regressor data) = length(c5) = length(c1) =
length(c2) used in "ugarchspec" = 241, whereas the
number of observations I wish to simulate = 100,000.

Many thanks
Gareth

	[[alternative HTML version deleted]]



More information about the R-SIG-Finance mailing list