Egig {lqr} | R Documentation |
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.
Usage
Egig(lambda, chi, psi, func = c("x", "logx", "1/x", "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.
|
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.
Value
Egig
gives the expected value
of either x
, 1/x
, log(x)
or the variance if func
equals var
.
Author(s)
David Luethi and Ester Pantaleo
References
Dagpunar, J.S. (1989). An easily implemented generalised inverse Gaussian generator. Commun. Statist. -Simula., 18, 703–710.
Michael, J. R, Schucany, W. R, Haas, R, W. (1976). Generating random variates using transformations with multiple roots, The American Statistican, 30, 88–90.
See Also
Examples
Egig(lambda = 10, chi = 1, psi = 1, func = "x")
Egig(lambda = 10, chi = 1, psi = 1, func = "var")
Egig(lambda = 10, chi = 1, psi = 1, func = "1/x")