Egig | R Documentation |
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(lambda, chi, psi, func = c("x", "logx", "1/x", "var"))
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.
|
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.
Egig
gives the expected value
of either x
, 1/x
, log(x)
or the variance if func
equals var
.
David Luethi and Ester Pantaleo
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.
best.lqr
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.