Egig: Moments of the Generalized Inverse Gaussian Distribution
Description
Expected value of X, log(X), 1/X and variance for the generalized
inverse gaussian distribution. This function has been recycled from the ghyp R package.
Egig gives the expected value
of either x, 1/x, log(x) or the variance if func equals var.
Arguments
lambda
A shape and scale and parameter.
chi, psi
Shape and scale parameters. Must be positive.
func
The transformation function when computing the expected value.
x is the expected value (default), log x returns the
expected value of the logarithm of x, 1/x returns the
expected value of the inverse of x and var returns the
variance.
Author
David Luethi and Ester Pantaleo
Details
Egig with func = "log x" uses
grad from the R package numDeriv. See
the package vignette for details regarding the expectation of GIG
random variables.
Michael, J. R, Schucany, W. R, Haas, R, W. (1976). Generating
random variates using transformations with multiple roots, The
American Statistican, 30, 88--90.