ghyp-constructors | R Documentation |
Constructor functions for univariate and multivariate generalized hyperbolic distribution objects and their special cases in one of the parametrizations “chi/psi”, “alpha.bar” and “alpha/delta”.
ghyp(lambda = 0.5, chi = 0.5, psi = 2, mu = 0, sigma = diag(rep(1, length(mu))),
gamma = rep(0, length(mu)), alpha.bar = NULL, data = NULL)
ghyp.ad(lambda = 0.5, alpha = 1.5, delta = 1, beta = rep(0, length(mu)),
mu = 0, Delta = diag(rep(1, length(mu))), data = NULL)
hyp(chi = 0.5, psi = 2, mu = 0, sigma = diag(rep(1, length(mu))),
gamma = rep(0, length(mu)), alpha.bar = NULL, data = NULL)
hyp.ad(alpha = 1.5, delta = 1, beta = rep(0, length(mu)), mu = 0,
Delta = diag(rep(1, length(mu))), data = NULL)
NIG(chi = 2, psi = 2, mu = 0, sigma = diag(rep(1, length(mu))),
gamma = rep(0, length(mu)), alpha.bar = NULL, data = NULL)
NIG.ad(alpha = 1.5, delta = 1, beta = rep(0, length(mu)), mu = 0,
Delta = diag(rep(1, length(mu))), data = NULL)
student.t(nu = 3.5, chi = nu - 2, mu = 0, sigma = diag(rep(1, length(mu))),
gamma = rep(0, length(mu)), data = NULL)
student.t.ad(lambda = -2, delta = 1, beta = rep(0, length(mu)), mu = 0,
Delta = diag(rep(1, length(mu))), data = NULL)
VG(lambda = 1, psi = 2*lambda, mu = 0, sigma = diag(rep(1, length(mu))),
gamma = rep(0, length(mu)), data = NULL)
VG.ad(lambda = 2, alpha = 1.5, beta = rep(0, length(mu)), mu = 0,
Delta = diag(rep(1, length(mu))), data = NULL)
gauss(mu = 0, sigma = diag(rep(1, length(mu))), data = NULL)
lambda |
Shape parameter. Common for all parametrizations. |
nu |
Shape parameter only used in case of a Student-t distribution in the “chi/psi” and “alpha.bar” parametrization . It determines the degree of freedom. |
chi |
Shape parameter of the “chi/psi” parametrization. |
psi |
Shape parameter of the “chi/psi” parametrization. |
alpha |
Shape parameter of the “alpha/delta” parametrization. |
delta |
Shape parameter of the “alpha/delta” parametrization. |
alpha.bar |
Shape parameter of the “alpha.bar” parametrization. Supplying “alpha.bar” makes the parameters “chi” and “psi” redundant. |
mu |
Location parameter. Either a scalar or a vector. Common for all parametrizations. |
sigma |
Dispersion parameter of the “chi/psi” parametrization. Either a scalar or a matrix. |
Delta |
Dispersion parameter. Must be a matrix with a determinant of 1. This parameter is only used in the multivariate case of the “alpha.beta” parametrization. |
gamma |
Skewness parameter of the “chi/psi” parametrization. Either a scalar or a vector. |
beta |
Skewness parameter of the “alpha/delta” parametrization. Either a scalar or a vector. |
data |
An object coercible to a |
These functions serve as constructors for univariate and multivariate
objects.
ghyp
, hyp
and NIG
are constructor functions
for both the “chi/psi” and the “alpha.bar”
parametrization. Whenever alpha.bar
is not NULL
it is
assumed that the “alpha.bar” parametrization is used and the
parameters “chi” and “psi” become redundant.
Similarly, the variance gamma (VG) and the Student-t distribution
share the same constructor function for both the chi/psi
and
alpha.bar
parametrization. To initialize them in the
alpha.bar
parametrization simply omit the argument psi
and chi
, respectively. If psi
or chi
are
submitted, the “chi/psi” parametrization will be used.
ghyp.ad
, hyp.ad
, NIG.ad
, student.t.ad
and
VG.ad
use the “alpha/delta” parametrization.
The following table gives the constructors for each combination of distribution and parametrization.
Parametrization | |||
Distribution | “chi/psi” | “alpha.bar” | “alpha/delta” |
GH | ghyp(...) | ghyp(..., alpha.bar=x) | ghyp.ad(...) |
hyp | hyp(...) | hyp(..., alpha.bar=x) | hyp.ad(...) |
NIG | NIG(...) | NIG(..., alpha.bar=x) | NIG.ad(...) |
Student-t | student.t(..., chi=x) | student.t(...) | student.t.ad(...) |
VG | VG(..., psi=x) | VG(...) | VG.ad(...) |
Have a look on the vignette of this package in the doc
folder
for further information regarding the parametrization and for the
domains of variation of the parameters.
An object of class ghyp
.
The Student-t parametrization obtained via the “alpha.bar”
parametrization slightly differs from the common Student-t
parametrization: The parameter sigma
denotes the standard
deviation in the univariate case and the variance in the multivariate
case. Thus, set \sigma = \sqrt{\nu /(\nu - 2)}
in the univariate case to get the same results as with the
standard R implementation of the Student-t distribution.
In case of non-finite variance, the “alpha.bar” parametrization
does not work because sigma
is defined to be the standard
deviation. In this case the “chi/psi” parametrization can be
used by submitting the parameter chi
. To obtain equal results
as the standard R implmentation use student.t(nu = nu, chi =
nu)
(see Examples).
Have a look on the vignette of this package in the
doc
folder for further information.
Once an object of class ghyp
is created the
methods Xghyp
have to be used even when the distribution is a
special case of the GH distribution. E.g. do not use dVG
. Use
dghyp
and submit a variance gamma distribution created
with VG()
.
David Luethi
ghyp
-package vignette in the doc
folder or on https://cran.r-project.org/package=ghyp
ghyp-class
for a summary of generic methods assigned to ghyp
objects,
coef
for switching between different parametrizations,
d/p/q/r/ES/gyhp
for density, distribution function et cetera,
fit.ghypuv
and fit.ghypmv
for fitting routines.
## alpha.bar parametrization of a univariate GH distribution
ghyp(lambda=2, alpha.bar=0.1, mu=0, sigma=1, gamma=0)
## lambda/chi parametrization of a univariate GH distribution
ghyp(lambda=2, chi=1, psi=0.5, mu=0, sigma=1, gamma=0)
## alpha/delta parametrization of a univariate GH distribution
ghyp.ad(lambda=2, alpha=0.5, delta=1, mu=0, beta=0)
## alpha.bar parametrization of a multivariate GH distribution
ghyp(lambda=1, alpha.bar=0.1, mu=2:3, sigma=diag(1:2), gamma=0:1)
## lambda/chi parametrization of a multivariate GH distribution
ghyp(lambda=1, chi=1, psi=0.5, mu=2:3, sigma=diag(1:2), gamma=0:1)
## alpha/delta parametrization of a multivariate GH distribution
ghyp.ad(lambda=1, alpha=2.5, delta=1, mu=2:3, Delta=diag(c(1,1)), beta=0:1)
## alpha.bar parametrization of a univariate hyperbolic distribution
hyp(alpha.bar=0.3, mu=1, sigma=0.1, gamma=0)
## lambda/chi parametrization of a univariate hyperbolic distribution
hyp(chi=1, psi=2, mu=1, sigma=0.1, gamma=0)
## alpha/delta parametrization of a univariate hyperbolic distribution
hyp.ad(alpha=0.5, delta=1, mu=0, beta=0)
## alpha.bar parametrization of a univariate NIG distribution
NIG(alpha.bar=0.3, mu=1, sigma=0.1, gamma=0)
## lambda/chi parametrization of a univariate NIG distribution
NIG(chi=1, psi=2, mu=1, sigma=0.1, gamma=0)
## alpha/delta parametrization of a univariate NIG distribution
NIG.ad(alpha=0.5, delta=1, mu=0, beta=0)
## alpha.bar parametrization of a univariate VG distribution
VG(lambda=2, mu=1, sigma=0.1, gamma=0)
## alpha/delta parametrization of a univariate VG distribution
VG.ad(lambda=2, alpha=0.5, mu=0, beta=0)
## alpha.bar parametrization of a univariate t distribution
student.t(nu = 3, mu=1, sigma=0.1, gamma=0)
## alpha/delta parametrization of a univariate t distribution
student.t.ad(lambda=-2, delta=1, mu=0, beta=1)
## Obtain equal results as with the R-core parametrization
## of the t distribution:
nu <- 4
standard.R.chi.psi <- student.t(nu = nu, chi = nu)
standard.R.alpha.bar <- student.t(nu = nu, sigma = sqrt(nu /(nu - 2)))
random.sample <- rnorm(3)
dt(random.sample, nu)
dghyp(random.sample, standard.R.chi.psi) # all implementations yield...
dghyp(random.sample, standard.R.alpha.bar) # ...the same values
random.quantiles <- runif(4)
qt(random.quantiles, nu)
qghyp(random.quantiles, standard.R.chi.psi) # all implementations yield...
qghyp(random.quantiles, standard.R.alpha.bar) # ...the same values
## If nu <= 2 the "alpha.bar" parametrization does not exist, but the
## "chi/psi" parametrization. The case of a Cauchy distribution:
nu <- 1
standard.R.chi.psi <- student.t(nu = nu, chi = nu)
dt(random.sample, nu)
dghyp(random.sample, standard.R.chi.psi) # both give the same result
pt(random.sample, nu)
pghyp(random.sample, standard.R.chi.psi) # both give the same result
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.