[Math] How to sample from a Gamma distribution with shape not integer

gamma functionprobability distributionssampling

I'm looking for an effective method to sample from a Gamma distribution that has the shape parameter not integer.

However, I found everywhere the method to sample from a Gamma with an integer shape (that is as a matter of fact an Erlang distribution).

I found this paper about an method for sampling from a Gamma. Unfortunately, I don't understand how to implement it!

Any suggestion?

Best Answer

See Devroye "Non-Uniform Random Variate Generation" Section IX.3.2 (it is freely available online). Several algorithms are explained in detail there with pseudo-code, so it will be quick to code.

-- Monseigneur Myriel

Related Question