Learn R Programming

ghyp (version 1.6.5)

ghyp-get: Get methods for objects inheriting from class ghyp

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. ghyp.data returns the data slot of a gyhp object. ghyp.dim returns the dimension of a gyhp object. ghyp.name returns the name of the distribution of a gyhp object.

Usage

ghyp.fit.info(object)

ghyp.data(object)

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

ghyp.dim(object)

Value

ghyp.fit.info returns list with components:

logLikelihoodThe maximized log-likelihood value.
aicThe Akaike information criterion.
fitted.paramsA boolean vector stating which parameters were fitted.
convergedA boolean whether optim converged or not.
n.iterThe number of iterations.
error.codeError code from optim.
error.messageError message from optim.
parameter.varianceParameter variance (only for univariate fits).
trace.parsTrace values of the parameters during the fitting procedure.

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. Depending on the arguments abbr and skew.attr one of the following is returned.

abbr == FALSE & skew.attr == TRUEabbr == TRUE & skew.attr == TRUE
(A)symmetric Generalized Hyperbolic(A)symm ghyp
(A)symmetric Hyperbolic(A)symm hyp
(A)symmetric Normal Inverse Gaussian(A)symm NIG
(A)symmetric Variance Gamma(A)symm VG
(A)symmetric Student-t(A)symm t
GaussianGauss
abbr == FALSE & skew.attr == FALSEabbr == TRUE & skew.attr == FALSE
Generalized Hyperbolicghyp
Hyperbolichyp
Normal Inverse GaussianNIG
Variance GammaVG
Student-tt
GaussianGauss

ghyp.dim returns the dimension of a ghyp object.

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.

Author

David Luethi

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 dimension
  ghyp.dim(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