ig: The Inverse-Gaussian (IG) Distribution

igR Documentation

The Inverse-Gaussian (IG) Distribution

Description

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

Usage

dig(x, a, b, log = FALSE)

rig(n, a, b, seed = 0)

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

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

Arguments

x, q

vector of quantiles.

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].

p

vector of probabilities.

Details

The inverse-Gaussian distribution has density given by

f(x; a, b) = \frac{\sqrt{b}}{\sqrt{2\pi x^3}}\exp( -\frac{a}{2}x -\frac{b}{2x} + \sqrt{ab}),

where x>0 and a,b>0. In this parameterization, E(X) = \sqrt{b}/\sqrt{a}. See Tweedie (1957a, 1957b) for further details.

Value

dig gives the density, pig gives the distribution function, qig gives the quantile function, and rig generates random deviates.

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

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

References

Tweedie, M. C. K. (1957a). "Statistical Properties of Inverse Gaussian Distributions I". Annals of Mathematical Statistics. 28 (2): 362–377. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/aoms/1177706964")}

Tweedie, M. C. K. (1957b). "Statistical Properties of Inverse Gaussian Distributions II". Annals of Mathematical Statistics. 28 (3): 696–705. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/aoms/1177706881")}

See Also

dnig, dgig, digam

Examples

rig(100, a = 1, b = 1)
pig(0.4, a = 1, b = 1)
qig(0.8, a = 1, b = 1)
plot(function(x){dig(x, a = 1, b = 1)}, main =
"Inverse-Gaussian density", ylab = "Probability density",
xlim = c(0,10))

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