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