represents an inverse gamma distribution with shape parameter α and scale parameter β.

represents a generalized inverse gamma distribution with shape parameters α and γ, scale parameter β, and location parameter μ.

# Background & Context

• InverseGammaDistribution[α,β,γ,μ] represents a continuous statistical distribution defined over the interval and parametrized by a real number μ (called a "location parameter"), two positive real numbers α and γ (called "shape parameters"), and a positive real number β (called a "scale parameter"). Overall, the probability density function (PDF) of an inverse gamma distribution is unimodal with a single "peak" (i.e. a global maximum), with the parameter μ determining the horizontal location of the PDF and the parameters α, β, and γ determining its overall shape (its height, its spread, and its concentration near the axis). In addition, the tails of the PDF are "thin" in the sense that the PDF decreases exponentially rather than decreasing algebraically for large values of . (This behavior can be made quantitatively precise by analyzing the SurvivalFunction of the distribution.) The four-parameter version is sometimes referred to as the generalized inverse gamma distribution, while the two-parameter form (which is equivalent to InverseGammaDistribution[α,β,1,0]) is often referred to as "the" inverse gamma distribution.
• InverseGammaDistribution[α,β,γ,μ] is the distribution followed by the reciprocal of a generalized gamma-distributed random variable. In other words, if is a random variable and XGammaDistribution[α,β,γ,μ] (where denotes "is distributed as"), then 1/XInverseGammaDistribution[α,β,γ,μ]. In Bayesian probability, the inverse gamma distribution is used as a marginal posterior or as a conjugate prior distribution in inferencing of normally-distributed data whose variance is unknown if an uninformative prior or if an informative prior is used, respectively. The inverse gamma distribution and its generalization are also used in other miscellaneous Bayesian applications in addition to being used as tools of study in various areas including reliability theory, manufacturing systems, machine learning, and survival analysis.
• RandomVariate can be used to give one or more machine- or arbitrary-precision (the latter via the WorkingPrecision option) pseudorandom variates from an inverse gamma distribution. Distributed[x,InverseGammaDistribution[α,β,γ,μ]], written more concisely as xInverseGammaDistribution[α,β,γ,μ], can be used to assert that a random variable x is distributed according to an inverse gamma distribution. Such an assertion can then be used in functions such as Probability, NProbability, Expectation, and NExpectation.
• The probability density and cumulative distribution functions for inverse gamma distributions may be given using PDF[InverseGammaDistribution[α,β,γ,μ],x] and CDF[InverseGammaDistribution[α,β,γ,μ],x]. The mean, median, variance, raw moments, and central moments may be computed using Mean, Median, Variance, Moment, and CentralMoment, respectively.
• DistributionFitTest can be used to test if a given dataset is consistent with an inverse gamma distribution, EstimatedDistribution to estimate an inverse gamma parametric distribution from given data, and FindDistributionParameters to fit data to an inverse gamma distribution. ProbabilityPlot can be used to generate a plot of the CDF of given data against the CDF of a symbolic inverse gamma distribution, and QuantilePlot to generate a plot of the quantiles of given data against the quantiles of a symbolic inverse gamma distribution.
• TransformedDistribution can be used to represent a transformed inverse gamma distribution, CensoredDistribution to represent the distribution of values censored between upper and lower values, and TruncatedDistribution to represent the distribution of values truncated between upper and lower values. CopulaDistribution can be used to build higher-dimensional distributions that contain an inverse gamma distribution, and ProductDistribution can be used to compute a joint distribution with independent component distributions involving inverse gamma distributions.
• InverseGammaDistribution is closely related to a number of other distributions. For example, InverseGammaDistribution is related to InverseChiSquareDistribution (and hence to ChiSquareDistribution) in that the PDF of InverseGammaDistribution[ν/2,1/2] is precisely the same as InverseChiSquareDistribution[ν,1/ν]. InverseGammaDistribution is generalized by PearsonDistribution, generalizes LevyDistribution, and is closely related to a number of other distributions including MoyalDistribution, LogGammaDistribution, ErlangDistribution, BetaDistribution, ExpGammaDistribution, RayleighDistribution, ChiDistribution, WeibullDistribution, and StudentTDistribution.

# Examples

open allclose all

## Basic Examples(8)

Probability density function:

Cumulative distribution function:

Mean and variance:

Median:

Probability density function for the generalized inverse gamma distribution:

Cumulative distribution function for the generalized inverse gamma distribution:

Mean and variance of the generalized inverse gamma distribution:

Median:

## Scope(10)

Generate a sample of pseudorandom numbers from an inverse gamma distribution:

Compare its histogram to the PDF:

Generate a set of pseudorandom numbers that have generalized inverse gamma distribution:

Compare its histogram to the PDF:

Distribution parameters estimation:

Estimate the distribution parameters from sample data:

Compare the density histogram of the sample with the PDF of the estimated distribution:

Skewness depends only on shape parameter α:

As α gets larger, the distribution becomes more symmetric:

The generalized case depends on both α and γ:

Kurtosis depends only on shape parameter α:

The kurtosis approaches the kurtosis of as α approaches :

The generalized case depends on both α and γ:

Different moments with closed forms as functions of parameters:

Different moments of generalized inverse gamma distribution:

Hazard function:

Hazard function of generalized inverse gamma distribution:

Quantile function:

Generalized inverse gamma distribution:

Consistent use of Quantity in parameters yields QuantityDistribution:

Find the mean amount:

## Applications(1)

The present value of one-dollar stochastic perpetuity when the rate obeys a Wiener process with shift and volatility follows InverseGaussianDistribution:

Find the expected present value:

Compute the novolatility limit:

Compare with the built-in result:

Find the probability that the present value is smaller than the novolatility limit:

Compute the probability when r0.06 and σ0.01:

## Properties & Relations(8)

Inverse gamma distribution is closed under scaling by a positive factor:

Generalized inverse gamma distribution is closed under translation and scaling by a positive factor:

Relationships to other distributions:

InverseChiSquareDistribution is a special case of inverse gamma distribution:

Generalized InverseChiSquareDistribution is a special case of inverse gamma distribution:

Inverse gamma distribution and GammaDistribution have an inverse relationship:

LevyDistribution[0,σ] is a special case of inverse gamma distribution:

Inverse gamma distribution is a special case of type 5 PearsonDistribution:

Generalized inverse gamma distribution simplifies to inverse gamma distribution:

## Possible Issues(2)

InverseGammaDistribution is not defined when either α or β is not a positive real number:

Substitution of invalid parameters into symbolic outputs gives results that are not meaningful:

## Neat Examples(1)

PDFs for different β values with CDF contours: