R: Calculate Moments of the Variance Gamma Distribution
vgMom
R Documentation
Calculate Moments of the Variance Gamma Distribution
Description
This function can be used to calculate raw moments, mu moments, central
moments and moments about any other given location for the variance gamma
(VG) distribution.
Numeric. The order of the moment to be calculated. Not
permitted to be a vector. Must be a positive whole number except for
moments about zero.
vgC
The location parameter c, default is 0.
sigma
The spread parameter sigma, default is 1,
must be positive.
theta
The asymmetry parameter theta, default is 0.
nu
The shape parameter nu, default is 1, must be
positive.
param
Specifying the parameters as a vector which takes the form
c(vgC,sigma,theta,nu).
momType
Common types of moments to be calculated, default is "raw".
See Details.
about
Numeric. The point around which the moment is to be
calculated, default is 0. See Details.
Details
For the parameters of the variance gamma distribution, users may
either specify the values individually or as a vector. If both forms
are specified but with different values, then the values specified by
vector param will always overwrite the other ones. In
addition, the parameters values are examined by calling the function
vgCheckPars to see if they are valid for the VG distribution.
order is also checked by calling the function
is.wholenumber in DistributionUtils package to see whether
a whole number is given.
momType can be either "raw" (moments about zero), "mu"
(moments about vgC), or "central" (moments about mean). If one of
these moment types is specified, then there is no need to specify the
about value. For moments about any other location, the
about value must be specified. In the case that both
momType and about are specified and contradicting, the
function will always calculate the moments based on about
rather than momType.
To calculate moments of the VG distribution, the function first
calculates mu moments by the formula defined below and then transforms mu
moments to central moments or raw moments or moments about any other
location as required by calling momChangeAbout in
DistributionUtils package.
To calculate mu moments of the variance gamma distribution, the function
first transforms the parameterization of
c,sigma,theta,nu to the generalized hyperbolic
distribution's parameterization of
lambda,alpha,beta,mu
(see vgChangePars for details).
Then, the mu moments of the variance gamma distribution are given by
where k = order and k > 0 and
a_{k, l} is the recursive coefficient
(see momRecursion for details).
This formula is developed from the mu moments formula of the
generalized hyperbolic distribution given in Scott,
W<c3><bc>rtz and Tran (2008). Note that the part in []
of this equation is actually equivalent to the formula of raw moments
of the gamma distribution. So the function calls gammaRawMom in
GeneralizedHyperbolic package when implementing the computations.
Value
The moment specified. In the case of raw moments, Inf is
returned if the moment is infinite.
Paolella, Marc S. (2007)
Intermediate Probability: A Computational Approach,
Chichester: Wiley
Scott, D. J., W<c3><bc>rtz, D. and Tran, T. T. (2008)
Moments of the Generalized Hyperbolic Distribution. Preprint.
### Raw moments of the VG distribution
vgMom(3, param=c(2,1,2,1), momType = "raw")
### Mu moments of the VG distribution
vgMom(2, param=c(2,1,2,1), momType = "mu")
### Central moments of the VG distribution
vgMom(4, param=c(2,1,2,1), momType = "central")
### Moments about any locations
vgMom(4, param=c(2,1,2,1), about = 1)