window.zoo <- get("window.zoo", envir = asNamespace("zoo"))
rt <- window.zoo(SP500, end = "2002-12-31")
# Multistep forecasting (EGARCH with cond. normal distr.)
model1 <- fEGarch(spec = egarch_spec(), rt)
fcast1 <- predict(model1, n.ahead = 10)
fcast1
# Rolling one-step forecasts (EGARCH with cond. normal distr.)
model2 <- fEGarch(spec = egarch_spec(), rt, n_test = 250)
fcast2 <- predict_roll(model2, step_size = 1)
fcast2
Run the code above in your browser using DataLab