# create model specification
spec <- CreateSpec()
# load data
data("SMI", package = "MSGARCH")
# fit the model on the data by ML
fit <- FitML(spec = spec, data = SMI)
summary(fit)
# custom optimizer example
if (FALSE) {
f_custom_optim <- function(vPw, f_nll, spec, data, do.plm){
out <- stats::optim(vPw, f_nll, spec = spec, data = data,
do.plm = do.plm, method = "Nelder-Mead")
return(out)
}
set.seed(123)
fit <- FitML(spec, data = SMI, ctr = list(OptimFUN = f_custom_optim))
summary(fit)
}
Run the code above in your browser using DataLab