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$>
References: <hog2a0$c2n$> <hog428$cej$> <hog4oq$no4$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1269537319 10632 (25 Mar 2010 17:15:19 GMT)
NNTP-Posting-Date: Thu, 25 Mar 2010 17:15:19 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:620306

"John D'Errico" <> wrote in message <hog4oq$no4$>...
> 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