| compare_models | R Documentation |
Fits each model with estimate_parameters and returns a table ranked by AIC.
compare_models(
data,
models = c("gaussian", "t", "leverage", "skew_gaussian", "skew_gaussian_leverage",
"skew_t", "skew_t_leverage"),
...
)
data |
A vector of observations. |
models |
Character vector of models. See |
... |
Additional arguments passed to |
The table also shows if the optimizer converged and if the Hessian is positive definite. A model that fails one of
these checks has unreliable estimates and standard errors, even when its AIC is small. A model that gives an error
is reported with NA values and the error message.
A data.table with one row for each model, ordered by AIC, and the columns model,
n_par, log_lik, aic, bic, delta_aic (the difference to the smallest AIC),
converged, pd_hessian and message. The fitted models are in the attribute "fits",
a named list of stochvolTMB objects.
comparison <- compare_models(spy$log_return, models = c("gaussian", "t", "leverage"))
comparison
best <- attr(comparison, "fits")[[comparison$model[1]]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.