igam: The Inverse-Gamma (IGam) Distribution

igamR Documentation

The Inverse-Gamma (IGam) Distribution

Description

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

Usage

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

rigam(n, a, b)

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

qigam(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.

lower.tail

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

p

vector of probabilities.

Details

The inverse-Gamma distribution has density given by

f(x; a, b) = \frac{b^a}{\Gamma(a)}x^{-a-1}\exp( -\frac{b}{x}),

where x>0 and a,b>0.

Value

digam gives the density, pigam gives the distribution function, qigam gives the quantile function, and rigam 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.

See Also

dnig, dgig

Examples

rigam(100, a = 1, b = 1)
pigam(0.4, a = 1, b = 1)
qigam(0.8, a = 1, b = 1)
plot(function(x){digam(x, a = 1, b = 1)}, main =
"Inverse-Gamma density", ylab = "Probability density",
xlim = c(0,10))

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