# NOT RUN {
# create model specification
# MS(2)-GARCH(1,1)-Normal (default)
spec <- CreateSpec()
# generate process
par.sim <- c(0.1,0.6,0.2,0.2,0.8,0.1,0.99,0.01)
set.seed(123)
sim <- Sim(object = spec, n.ahead = 1000L, n.sim = 1L, par = par.sim, n.burnin = 500L)
plot(sim)
# generate process after filtering for fitted model
# load data
data("SMI", package = "MSGARCH")
# fit the model on the data with ML estimation
fit <- FitML(spec = spec, data = SMI)
set.seed(123)
sim <- Sim(fit, n.ahead = 30L, n.sim = 1000L)
plot(sim)
# }
Run the code above in your browser using DataLab