Learn R Programming

ghyp (version 1.1.0)

stepAIC.ghyp: Perform a model selection based on the AIC

Description

This function performs a model selection in the scope of the generalized hyperbolic distribution class based on the Akaike information criterion. stepAIC.ghyp can be used for the univariate as well as for the multivariate case.

Usage

stepAIC.ghyp(data, dist=c("ghyp","hyp","NIG","VG","t"), 
             symmetric=NULL, ...)

Arguments

data
A vector, matrix or data.frame.
dist
A character vector of distributions from where the best fit will be identified.
symmetric
Either NULL, TRUE or FALSE. NULL means that both symmetric and asymmetric models will be fitted. For symmetric models select TRUE and for asymmetric mo
...
Arguments passed to fit.ghypuv or fit.ghypmv.

Value

  • A list with components:
  • best.modelThe model minimizing the AIC.
  • all.modelsAll fitted models.
  • fit.tableA data.frame with columns model, symmetric, lambda, alpha.bar, aic, llh (log-Likelihood), converged, n.iter (number of iterations) sorted according to the aic. In the univariate case three additional columns containing the parameters mu, sigma and gamma are added.

See Also

lik.ratio.test, fit.ghypuv and fit.ghypmv.

Examples

Run this code
data(smi.stocks)
  
  # Multivariate case:
  stepAIC.ghyp(smi.stocks[, 2:5], dist = c("ghyp", "hyp", "t"), symmetric = NULL,
               control = list(maxit = 500), silent = T, nit = 500)
               
  # Univariate case:
  stepAIC.ghyp(smi.stocks[, "SMI"], dist = c("ghyp", "NIG", "VG"), symmetric = TRUE,
               control = list(maxit = 500), silent = T)

Run the code above in your browser using DataLab