Learn R Programming

ghyp (version 0.9.3)

fit.ghypmv: Fitting generalized hyperbolic distributions to multivariate data

Description

Perform a maximum likelihood estimation of the parameters of a multivariate generalized hyperbolic distribution by using an Expectation Maximization (EM) based algorithm.

Usage

fit.ghypmv(data, lambda = 1, alpha.bar = 1, mu = NULL, sigma = NULL, 
           gamma = NULL, opt.pars = c(lambda = T, alpha.bar = T, mu = T, 
                                      sigma = T, gamma = !symmetric), 
           symmetric = F, nit = 2000, reltol = 1e-10, abstol = reltol * 10, 
           na.rm = F, silent = FALSE, save.data = T, ...)   
           
fit.hypmv(data, 
          opt.pars = c(alpha.bar = T, mu = T, sigma = T, gamma = T), ...)

fit.NIGmv(data, opt.pars = c(alpha.bar = T, mu = T, sigma = T, gamma = T), ...)

fit.VGmv(data, lambda = 1, opt.pars = c(lambda = T, mu = T, sigma = T, gamma = T), ...)

fit.tmv(data, nu = 4, opt.pars = c(lambda = T, mu = T, sigma = T, gamma = T), ...)

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.ghypmv object.
na.rm
If TRUE missing values will be removed from data.
silent
If TRUE no prompts will appear in the console.
nit
Maximal number of iterations of the expectation maximation algorithm.
reltol
Relative convergence tolerance.
abstol
Absolute convergence tolerance.
...
Arguments passed to optim and to fit.ghypmv when fitting special cases of the generalized hyperbolic distribution.

Value

Details

This function uses a modified EM algorithm which is called Multicycle Expectation Conditional Maximization (MCECM) algorithm. This algorithm is sketched in the vignette of this package which can be found in the doc folder. A more detailed description is provided by the book Quantitative Risk Management, Concepts, Techniques and Tools (see References). The general-purpose optimization routine optim is used to maximize the loglikelihood function of the univariate mixing distribution. 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.

References

Alexander J. McNeil, R�diger Frey, Paul Embrechts (2005) Quantitative Risk Management, Concepts, Techniques and Tools S-Plus library QRMlib (see http://www.math.ethz.ch/~mcneil/book/QRMlib.html).

See Also

fit.ghypuv, fit.hypuv, fit.NIGuv, fit.VGuv, fit.tuv for univariate fitting routines.

Examples

Run this code
data(smi.stocks)
  fit.ghypmv(data=smi.stocks,opt.pars=c(lambda=FALSE),lambda=2,
             control=list(rel.tol=1e-5, abs.tol=1e-5), abstol=0.01, reltol=0.01)

Run the code above in your browser using DataLab