gig: The Generalised Inverse-Gaussian (GIG) Distribution

gigR Documentation

The Generalised Inverse-Gaussian (GIG) Distribution

Description

Density, distribution function, quantile function and random generation for the generalised inverse-Gaussian distribution with parameters p, a and b.

Usage

dgig(x, p, a, b, log = FALSE)

rgig(n, p, a, b, seed = 0)

pgig(q, p, a, b, lower.tail = TRUE, log.p = FALSE)

qgig(prob, p, a, b, lower.tail = TRUE, log.p = FALSE)

Arguments

x, q

vector of quantiles.

p

parameter p.

a, b

parameters a and b. Must be positive.

log, log.p

logical; if TRUE, probabilities/densities p are returned as log(p).

n

number of observations.

seed

Seed for the random generation.

lower.tail

logical; if TRUE, probabilities are P[X\leq x], otherwise, P[X>x].

prob

vector of probabilities.

Details

The generalised inverse-Gaussian distribution has density given by

f(x; p, a, b) = ((a/b)^{p/2})/(2K_p(\sqrt{ab})) x^{p-1} \exp\{-(a/2)x - (b/2)/x\},

where K_p is modified Bessel function of the second kind of order p, x>0, a,b>0 and p\in\mathbb{R}. See Jørgensen (1982) for further details.

Value

dgig gives the density, pgig gives the distribution function, qgig gives the quantile function, and rgig generates random deviates.

Invalid arguments will result in return value NaN, with a warning.

The length of the result is determined by n for rgig.

References

Jørgensen, Bent (1982). Statistical Properties of the Generalized Inverse Gaussian Distribution. Lecture Notes in Statistics. 9. New York–Berlin: Springer-Verlag. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/978-1-4612-5698-4")}

See Also

dnig, dig, digam

Examples

rgig(20, p = 1, a = 1, b = 1)
pgig(0.4, p = 1, a = 1, b = 1)
qgig(0.8, p = 1, a = 1, b = 1)
plot(function(x){dgig(x, p = 1, a = 1, b = 1)}, main =
"Generalised inverse-Gaussian density", ylab = "Probability density",
xlim = c(0,10))

ngme2 documentation built on May 20, 2026, 9:10 a.m.