InvGamma {MCMCpack}R Documentation

The Inverse Gamma Distribution

Description

Density function and random generation from the inverse gamma distribution.

Usage

rinvgamma(n, shape, scale = 1)
dinvgamma(x, shape, scale = 1)

Arguments

x Scalar location to evaluate density.
n Number of draws from the distribution.
shape Scalar shape parameter.
scale Scalar scale parameter (default value one).

Details

An inverse gamma random variable with shape a and scale b has mean b/(a-1) (assuming a>1) and variance (b^2)/((a-1)^2 (a-2)) (assuming a>2).

Value

dinvgamma evaluates the density at x. rinvgamma takes n draws from the inverse Gamma distribution. The parameterization is consistent with the Gamma Distribution in the stats package.

See Also

GammaDist

Examples

density <- dinvgamma(4.2, 1.1)
draws <- rinvgamma(10, 3.2)

[Package MCMCpack version 0.7-4 Index]