# load data
data("sp500")
sp500 = sp500[1:1000]
# create model specification
spec = MSGARCH::create.spec()
# fit the model on the data with ML estimation using DEoptim intialization
set.seed(123)
fit = MSGARCH::fit.mle(spec = spec, y = sp500, ctr = list(do.init = FALSE))
# run pdf method in-sample
cdf.its = MSGARCH::cdf(object = fit, log = FALSE, do.its = TRUE)
# create mesh
x = seq(-3,3,0.01)
# run cdf method on mesh at T + 1
cdf = MSGARCH::cdf(object = fit, x = x, log = FALSE, do.its = FALSE)
plot(cdf)
Run the code above in your browser using DataLab