dinvgamma: Inverse gamma distribution

Description Usage Arguments Details Value References See Also

Description

We follow Gelman et al's (2014) parameterization. If X\sim Gamma(a,b), then 1/X\sim InvGamma(a,b). Note that some authors use alternative parameterizations; see especially dinvrootgamma.

Usage

1
2
3
4
5
dinvgamma(x, shape, scale, log = FALSE)

rinvgamma(n, shape, scale)

pinvgamma(q, shape, scale, log = FALSE)

Arguments

x

vector of quantiles

shape

shape parameter alpha; must be positive

scale

scale parameter beta; must be positive

log

logical; if TRUE, probabilities p are given as log(p).

n

number of random deviates to draw

q

vector of quantiles

Details

The density function with shape α and rate β is

\frac{β ^{α } x^{-α -1} \exp\{-\frac{β }{x}\}}{Γ (α )}.

The cdf with shape α and scale β is

\frac{Γ ≤ft(α ,\frac{β }{x}\right)}{Γ (α )}.

Value

'dinvgamma' gives the density and 'rinvgamma' generates random deviates.

References

Gelman, A., Carlin, J. B., Stern, H. S., & Rubin, D. B. (2014). Bayesian data analysis (3E). Boca Raton, FL, USA: Chapman & Hall/CRC.

See Also

Other gamma: dinvrootgamma


kuperov/bdist documentation built on May 23, 2019, 7:20 a.m.