# create specification
spec <- CreateSpec()
# simulation from specification
par <- c(0.1, 0.1, 0.8, 0.2, 0.1, 0.8, 0.99, 0.01)
set.seed(1234)
sim <- simulate(object = spec, nsim = 1L, nahead = 1000L,
nburn = 500L, par = par)
head(sim)
plot(sim)
# load data
data("SMI", package = "MSGARCH")
# simulation from ML fit
fit <- FitML(spec = spec, data = SMI)
set.seed(1234)
sim <- simulate(object = fit, nsim = 1L, nahead = 1000L,
nburn = 500L)
head(sim)
plot(sim)
if (FALSE) {
# simulation from MCMC fit
fit <- FitMCMC(spec = spec, data = SMI)
set.seed(1234)
sim <- simulate(object = fit, nahead = 100L, nburn = 500L)
head(sim)
plot(sim)
}
Run the code above in your browser using DataLab