# create specification
spec <- CreateSpec()
# load data
data("SMI", package = "MSGARCH")
# predict from specification
par <- c(0.1, 0.1, 0.8, 0.2, 0.1, 0.8, 0.99, 0.01)
set.seed(1234)
pred <- predict(object = spec, par = par, newdata = SMI, nahead = 5L)
head(pred)
plot(pred)
# predict from ML fit
fit <- FitML(spec = spec, data = SMI)
set.seed(1234)
pred <- predict(object = fit, nahead = 5L, do.return.draw = TRUE)
head(pred)
plot(pred)
if (FALSE) {
set.seed(1234)
fit <- FitMCMC(spec = spec, data = SMI)
pred <- predict(object = fit, nahead = 5L, do.return.draw = TRUE)
plot(pred)
}
Run the code above in your browser using DataLab