Learn R Programming

ghyp (version 0.9.3)

fit.ghypuv: Fitting generalized hyperbolic distributions to univariate data

Description

This function performs a maximum likelihood parameter estimation for univariate generalized hyperbolic distributions.

Usage

fit.ghypuv(data, lambda = 1, alpha.bar = 0.1, mu = mean(data), 
           sigma = sqrt(var(data)), gamma = 0, 
           opt.pars = c(lambda = T, alpha.bar = T, mu = T, 
                        sigma = T, gamma = !symmetric), 
           symmetric = 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 = 4, opt.pars = c(nu = T, mu = T, sigma = T, gamma = !symmetric), symmetric = F, ...)

Arguments

data
A vector or univariate data.frame.
lambda
Shape parameter.
alpha.bar
Shape parameter.
nu
Shape parameter only used in case of a student-t distribution. It determines the degree of freedom and is defined as -2*lambda.
mu
Location parameter.
sigma
Dispersion parameter.
gamma
Skewness parameter.
opt.pars
A named logical vector which states which parameters should be fitted.
symmetric
If TRUE the skewness parameter gamma keeps zero.
save.data
If TRUE data will be stored within the mle.ghypuv 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.

Value

Details

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.

See Also

fit.ghypmv, fit.hypmv, fit.NIGmv, fit.VGmv, fit.tmv for multivariate fitting routines.

Examples

Run this code
data(smi.stocks)
  fit.NIGuv(data=smi.stocks[,"SMI"],opt.pars=c(alpha.bar=FALSE),alpha.bar=1,
            control=list(abs.tol = 1e-5, maxit = 100))

Run the code above in your browser using DataLab