Description Usage Arguments Details Value Note Author(s) References See Also Examples
Perform a maximum likelihood estimation of the parameters of a multivariate generalized hyperbolic distribution by using an Expectation Maximization (EM) based algorithm.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 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, standardize = F, nit = 2000, reltol = 1e-8,
abstol = reltol * 10, na.rm = F, silent = FALSE, save.data = T,
trace = TRUE, ...)
fit.hypmv(data,
opt.pars = c(alpha.bar = T, mu = T, sigma = T, gamma = !symmetric),
symmetric = F, ...)
fit.NIGmv(data,
opt.pars = c(alpha.bar = T, mu = T, sigma = T, gamma = !symmetric),
symmetric = F, ...)
fit.VGmv(data, lambda = 1,
opt.pars = c(lambda = T, mu = T, sigma = T, gamma = !symmetric),
symmetric = F, ...)
fit.tmv(data, nu = 3.5,
opt.pars = c(lambda = T, mu = T, sigma = T, gamma = !symmetric),
symmetric = F, ...)
fit.gaussmv(data, na.rm = T, save.data = T)
|
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 matrix |
gamma |
Starting value for the skewness vecotr |
opt.pars |
A named logical |
symmetric |
If |
standardize |
If |
save.data |
If |
trace |
If |
na.rm |
If |
silent |
If |
nit |
Maximal number of iterations of the expectation maximation algorithm. |
reltol |
Relative convergence tolerance. |
abstol |
Absolute convergence tolerance. |
... |
Arguments passed to |
This function uses a modified EM algorithm which is called Multi-Cycle
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.
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
Alexander J. McNeil, Ruediger Frey, Paul Embrechts (2005)
Quantitative Risk Management, Concepts, Techniques and Tools
ghyp
-package vignette in the doc
folder or on
http://cran.r-project.org/web/packages/ghyp/.
S-Plus and R library QRMlib (see http://www.math.ethz.ch/~mcneil/book/QRMlib.html)
fit.ghypuv
, fit.hypuv
,
fit.NIGuv
, fit.VGuv
,
fit.tuv
for univariate fitting routines.
ghyp.fit.info
for information regarding the
fitting procedure.
1 2 3 4 | 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), reltol = 0.01)
|
Loading required package: numDeriv
Loading required package: gplots
Attaching package: 'gplots'
The following object is masked from 'package:stats':
lowess
[1] "iter: 1; rel.closeness: 2.115095E-03; log-likelihood: 3.369511E+04; alpha.bar: 4.517930E-01; lambda: 2.000000E+00"
Asymmetric Generalized Hyperbolic Distribution:
Parameters:
lambda alpha.bar
2.000000 0.451793
mu:
[1] 4.753714e-04 5.186091e-05 1.096489e-03 3.598621e-04 -8.221299e-05
[6] 1.394202e-05
sigma:
SMI Novartis CS Nestle Swisscom
SMI 1.307894e-04 1.112537e-04 1.942046e-04 9.713797e-05 5.697247e-05
Novartis 1.112537e-04 1.681405e-04 1.218900e-04 7.943443e-05 3.837582e-05
CS 1.942046e-04 1.218900e-04 4.794662e-04 1.024638e-04 9.627204e-05
Nestle 9.713797e-05 7.943443e-05 1.024638e-04 1.589988e-04 2.866632e-05
Swisscom 5.697247e-05 3.837582e-05 9.627204e-05 2.866632e-05 1.750700e-04
Swiss.Re 1.535229e-04 1.134522e-04 2.372356e-04 1.014689e-04 6.032607e-05
Swiss.Re
SMI 1.535229e-04
Novartis 1.134522e-04
CS 2.372356e-04
Nestle 1.014689e-04
Swisscom 6.032607e-05
Swiss.Re 3.741635e-04
gamma:
[1] -3.896619e-04 1.058337e-04 -1.048821e-03 -1.277625e-04 -4.019208e-05
[6] -2.628001e-04
log-likelihood:
33695.11
Call:
fit.ghypmv(data = smi.stocks, lambda = 2, opt.pars = c(lambda = FALSE), reltol = 0.01, control = list(rel.tol = 1e-05, abs.tol = 1e-05))
Warning messages:
1: In (psi + skewness.norm) * (chi + Q) :
Recycling array of length 1 in array-vector arithmetic is deprecated.
Use c() or as.vector() instead.
2: In (psi + skewness.norm) * (chi + Q) :
Recycling array of length 1 in array-vector arithmetic is deprecated.
Use c() or as.vector() instead.
3: In log.const.top + log.top :
Recycling array of length 1 in array-vector arithmetic is deprecated.
Use c() or as.vector() instead.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.