[R-SIG-Finance] Question
BABAGANA ABUBAKAR
@bub@k@rb@b@g@n@001 @end|ng |rom gm@||@com
Mon Jul 17 06:37:50 CEST 2023
Good day Sir,
I was trying to select the best asymmetric GARCH model by Monte Carlo
simulation, but I'm having some difficulties running the code.
Below is the code that I tried, but I'm getting error messages:
library(rugach)
spec = ugarchspec(mean.model = list(armaOrder = c(0,0), include.mean =
TRUE),
variance.model = list(model = "gjrGARCH"),
distribution.model = "norm",
fixed.pars = list("mu" =0, "omega" = 0.2, "alpha1" = 0.1,
"beta1" = 0.7, "gamma1" = 0.2))
par(mfrow = c(2, 2))
x_obj <- ugarchpath(spec, n.sim = 1000, n.start = 1000, rseed = 12345)
show(x_obj)
for (i in 1:4) {
plot(x_obj, which = i)
}
##The actual series
x1 <- x_obj using path$seriesSim
plot.ts(x1)
# Fit GARCH (1, 1)
fit <- ugarchfit(spec = spec, data = x1, out.sample = out.sample,)
show(fit).
Kind regards
[[alternative HTML version deleted]]
More information about the R-SIG-Finance
mailing list