fit.ghypuv {ghyp} | R Documentation |
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 = T, alpha.bar = T, mu = T, sigma = T, gamma = !symmetric), symmetric = F, standardize = F, save.data = T, na.rm = T, silent = FALSE, ...) fit.hypuv(data, opt.pars = c(alpha.bar = T, mu = T, sigma = T, gamma = !symmetric), symmetric = F, ...) fit.NIGuv(data, opt.pars = c(alpha.bar = T, mu = T, sigma = T, gamma = !symmetric), symmetric = F, ...) fit.VGuv(data, lambda = 1, opt.pars = c(lambda = T, mu = T, sigma = T, gamma = !symmetric), symmetric = F, ...) fit.tuv(data, nu = 3.5, opt.pars = c(nu = T, mu = T, sigma = T, gamma = !symmetric), symmetric = F, ...) fit.gaussuv(data, na.rm = T, save.data = T)
data |
An object coercible to a vector . |
lambda |
Starting value for the shape parameter lambda . |
alpha.bar |
Starting value for the shape parameter alpha.bar . |
nu |
Starting value for the shape parameter nu (only used in case of a student-t distribution. It determines
the degree of freedom and is defined as -2*lambda .) |
mu |
Starting value for the location parameter mu . |
sigma |
Starting value for the dispersion parameter sigma . |
gamma |
Starting value for the skewness parameter gamma . |
opt.pars |
A named logical vector which states which parameters should be fitted. |
symmetric |
If TRUE the skewness parameter gamma keeps zero. |
standardize |
If TRUE the sample will be standardized before fitting.
Afterwards, the parameters and log-likelihood et cetera will be back-transformed. |
save.data |
If TRUE data will be stored within the
mle.ghyp object. |
na.rm |
If TRUE missing values will be removed from data . |
silent |
If TRUE no prompts will appear in the console. |
... |
Arguments passed to optim and to fit.ghypuv when
fitting special cases of the generalized hyperbolic distribution. |
The general-purpose optimization routine optim
is used to
maximize the loglikelihood function. The default method is that of
Nelder and Mead which uses only function values. Parameters of
optim
can be passed via the ... argument of the fitting
routines.
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 http://cran.r-project.org/web/packages/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(abs.tol = 1e-8)) nig.fit summary(nig.fit) hist(nig.fit)