Learn R Programming

ghyp (version 1.1.0)

ghyp-data: Get methods for objects inheriting from class ghypbase

Description

These functions simply return data stored within generalized hyperbolic distribution objects, i.e. slots of the classes ghyp and mle.ghyp. ghyp.fit.info extracts information about the fitting procedure from objects of class mle.ghyp.

Usage

ghyp.fit.info(object)

ghyp.data(object)

ghyp.name(object, abbr = FALSE, skew.attr = TRUE)

Arguments

object
An object inheriting from class ghyp.
abbr
If TRUE the abbreviation of the ghyp distribution will be returned.
skew.attr
If TRUE an attribute will be added to the name of the ghyp distribution stating whether the distribution is symmetric or not.

Value

  • ghyp.fit.info returns list with components: rl{ logLikelihood The maximized log-likelihood value. aic The Akaike information criterion. fitted.params A boolean vector stating which parameters were fitted. converged A boolean whether optim converged or not. n.iter The number of iterations. error.code Error code from optim. error.message Error message from optim. parameter.variance Parameter variance (only for univariate fits). }

    ghyp.data returns NULL if no data is stored within the object, a vector if it is an univariate generalized hyperbolic distribution and matrix if it is an multivariate generalized hyperbolic distribution. ghyp.name returns the name of the ghyp distribution which can be the name of a special case.

See Also

coef, mean, vcov, logLik, AIC for other accessor functions, fit.ghypmv, fit.ghypuv, ghyp for constructor functions, optim for possible error messages.

Examples

Run this code
## multivariate generalized hyperbolic distribution
  ghyp.mv <- ghyp(lambda = 1, alpha.bar = 0.1, mu = rep(0, 2), sigma = diag(rep(1, 2)), 
                  gamma = rep(0, 2), data = matrix(rt(1000, df = 4), ncol = 2))

  ## Get data
  ghyp.data(ghyp.mv)
  
  ## Get the name of the ghyp object
  ghyp.name(ghyp(alpha.bar = 0))
  ghyp.name(ghyp(alpha.bar = 0, lambda = -4), abbr = TRUE)

  ## 'ghyp.fit.info' does only work when the object is of class 'mle.ghyp',
  ## i.e. is created by 'fit.ghypuv' etc.
  mv.fit <- fit.tmv(data = ghyp.data(ghyp.mv), control = list(abs.tol = 1e-3))
  ghyp.fit.info(mv.fit)

Run the code above in your browser using DataLab