This is an old version, view current version.

18.7 Inverse gamma Distribution

18.7.1 Probability density function

If \(\alpha \in \mathbb{R}^+\) and \(\beta \in \mathbb{R}^+\), then for \(y \in \mathbb{R}^+\), \[ \text{InvGamma}(y|\alpha,\beta) = \frac{\beta^{\alpha}} {\Gamma(\alpha)} \ y^{-(\alpha + 1)} \, \exp \! \left( \! - \beta \, \frac{1}{y} \right) . \]

18.7.2 Sampling statement

y ~ inv_gamma(alpha, beta)

Increment target log probability density with inv_gamma_lupdf(y | alpha, beta).
Available since 2.0

18.7.3 Stan functions

real inv_gamma_lpdf(reals y | reals alpha, reals beta)
The log of the inverse gamma density of y given shape alpha and scale beta
Available since 2.12

real inv_gamma_lupdf(reals y | reals alpha, reals beta)
The log of the inverse gamma density of y given shape alpha and scale beta dropping constant additive terms
Available since 2.25

real inv_gamma_cdf(reals y, reals alpha, reals beta)
The inverse gamma cumulative distribution function of y given shape alpha and scale beta
Available since 2.0

real inv_gamma_lcdf(reals y | reals alpha, reals beta)
The log of the inverse gamma cumulative distribution function of y given shape alpha and scale beta
Available since 2.12

real inv_gamma_lccdf(reals y | reals alpha, reals beta)
The log of the inverse gamma complementary cumulative distribution function of y given shape alpha and scale beta
Available since 2.12

R inv_gamma_rng(reals alpha, reals beta)
Generate an inverse gamma variate with shape alpha and scale beta; may only be used in transformed data and generated quantities blocks. For a description of argument and return types, see section vectorized PRNG functions.
Available since 2.18