Fitting generalized hyperbolic distributions to univariate data
This function performs a maximum likelihood parameter estimation for univariate generalized hyperbolic distributions.
fit.ghypuv(data, lambda = 1, alpha.bar = 0.5, mu = median(data), sigma = mad(data), gamma = 0, opt.pars = c(lambda = TRUE, alpha.bar = TRUE, mu = TRUE, sigma = TRUE, gamma = !symmetric), symmetric = FALSE, standardize = FALSE, save.data = TRUE, na.rm = TRUE, silent = FALSE, ...) fit.hypuv(data, opt.pars = c(alpha.bar = TRUE, mu = TRUE, sigma = TRUE, gamma = !symmetric), symmetric = FALSE, ...) fit.NIGuv(data, opt.pars = c(alpha.bar = TRUE, mu = TRUE, sigma = TRUE, gamma = !symmetric), symmetric = FALSE, ...) fit.VGuv(data, lambda = 1, opt.pars = c(lambda = TRUE, mu = TRUE, sigma = TRUE, gamma = !symmetric), symmetric = FALSE, ...) fit.tuv(data, nu = 3.5, opt.pars = c(nu = TRUE, mu = TRUE, sigma = TRUE, gamma = !symmetric), symmetric = FALSE, ...) fit.gaussuv(data, na.rm = TRUE, save.data = TRUE)
data |
An object coercible to a |
lambda |
Starting value for the shape parameter |
alpha.bar |
Starting value for the shape parameter |
nu |
Starting value for the shape parameter |
mu |
Starting value for the location parameter |
sigma |
Starting value for the dispersion parameter |
gamma |
Starting value for the skewness parameter |
opt.pars |
A named logical |
symmetric |
If |
standardize |
If |
save.data |
If |
na.rm |
If |
silent |
If |
... |
Arguments passed to |
An object of class mle.ghyp
.
The variance gamma distribution becomes singular when x - mu = 0. This singularity is catched and the reduced density function is computed. Because the transition is not smooth in the numerical implementation this can rarely result in nonsensical fits.
Providing both arguments, opt.pars
and symmetric
respectively, can result in a conflict when opt.pars['gamma']
and symmetric
are TRUE
. In this case symmetric
will dominate and opt.pars['gamma']
is set to FALSE
.
Wolfgang Breymann, David Luethi
ghyp
-package vignette in the doc
folder or on https://cran.r-project.org/package=ghyp.
fit.ghypmv
, fit.hypmv
, fit.NIGmv
,
fit.VGmv
, fit.tmv
for multivariate fitting routines.
ghyp.fit.info
for information regarding the fitting procedure.
data(smi.stocks) nig.fit <- fit.NIGuv(smi.stocks[,"SMI"], opt.pars = c(alpha.bar = FALSE), alpha.bar = 1, control = list(abstol = 1e-8)) nig.fit summary(nig.fit) hist(nig.fit)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.