Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Generation of gamma random variables without using the random function from Statistical toolbox
Date: Thu, 25 Mar 2010 17:15:19 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 15
Message-ID: <hog5n7$ac8$1@fred.mathworks.com>
References: <hog2a0$c2n$1@fred.mathworks.com> <hog428$cej$1@fred.mathworks.com> <hog4oq$no4$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1269537319 10632 172.30.248.38 (25 Mar 2010 17:15:19 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 25 Mar 2010 17:15:19 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:620306

"John D'Errico" <woodchips@rochester.rr.com> wrote in message <hog4oq$no4$1@fred.mathworks.com>...
> Let me just add that the trick is to use the inverse 
> incomplete gamma function for this, inverting
> the results from rand through it. This works because
> the incomplete gamma function is identical to the
> gamma CDF, at least when you then scale the
> incomplete gamma function by dividing by the
> complete gamma (which you get from gamma.m)
> 
> HTH,
> John

  Yes, you're right, John, that would be preferable.

Roger Stafford