vgMom(order, vgC = 0, sigma = 1, theta = 0, nu = 1,
param = c(vgC,sigma,theta,nu), momType = "raw", about = 0)
c(vgC,sigma,theta,nu)
.Inf
is
returned if the moment is infinite.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
$$\sum_{\ell = \lfloor(k+1)/2\rfloor}^{k}
a_{k, \ell}
\beta^{2\ell - k}
\lfloor\Gamma(\lambda+\ell)/\Gamma(\lambda)
2^\ell/(\alpha^2-\beta^2)^\ell\rfloor$$
where $k = \code{order}$ and $k > 0$ and
$a_{k, \ell}$ 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,
[]
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.vgCheckPars
, vgChangePars
,
vgMean
,
vgVar
, vgSkew
, vgKurt
,
is.wholenumber
,
momRecursion
,
momChangeAbout
and
momIntegrated
.### 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)
Run the code above in your browser using DataLab