Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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

share|improve this answer
    
Thank you so much! The book is great! –  JeanValjean Dec 19 '12 at 11:46
    
You are welcome! –  Learner Dec 19 '12 at 12:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.