Inverse Gamma Distribution Sample Generator

Inverse Gamma Distribution Sample Generator

Generate random samples from an Inverse Gamma distribution.

* Enter the shape parameter \(\alpha>0\), scale parameter \(\beta>0\), and the number of samples.

Step 1: Enter Parameters

e.g., 2

e.g., 3

e.g., 10

How It Works

The Inverse Gamma distribution is defined by the PDF: $$ f(y;\alpha,\beta)=\frac{\beta^\alpha}{\Gamma(\alpha)}\,y^{-\alpha-1}e^{-\beta/y},\quad y>0. $$

A useful relationship is that if $$ X \sim \text{Gamma}\left(\alpha,\, \text{scale}=\frac{1}{\beta}\right), $$ then $$ Y = \frac{1}{X} \sim \text{Inverse Gamma}(\alpha,\beta). $$

This calculator generates Gamma random variables using the Marsaglia and Tsang method (with a transformation if \(\alpha < 1\)), and then outputs their reciprocals to produce Inverse Gamma samples.

Mean of Inverse Gamma: \( \frac{\beta}{\alpha-1} \) (for \(\alpha > 1\)); Variance: \( \frac{\beta^2}{(\alpha-1)^2(\alpha-2)} \) (for \(\alpha > 2\)).

Related Calculators