Re: [math] Gamma Distribution Algorithm

2012-03-29 Thread Mikkel Meyer Andersen
Hi Paul, Have you looked at the nextGamma in org.apache.commons.math.random? It should be much faster than using the inversion method. Cheers, Mikkel. 2012/3/29 Ted Dunning ted.dunn...@gmail.com: Yes the sample method is inherited, but the inverse cumulative distribution function is not. On

Re: [math] Gamma Distribution Algorithm

2012-03-29 Thread Gilles Sadowski
Hi. Have you looked at the nextGamma in org.apache.commons.math.random? It should be much faster than using the inversion method. Whenever there is a specific (thus faster) implementation (in RandomDataImpl), it should be called from the sample method of the corresponding distribution class.

Re: [math] Gamma Distribution Algorithm

2012-03-29 Thread Mikkel Meyer Andersen
Dear all, I have created MATH-774 https://issues.apache.org/jira/browse/MATH-774 and assigned it to myself. I will check if other of the implemented methods in oacm.random are not used either and open new issues if that is the case. Thanks for making us aware of this, Paul. Cheers, Mikkel.

Re: [math] Gamma Distribution Algorithm

2012-03-29 Thread Sébastien Brisard
Hi Mikkel, I have created MATH-774 https://issues.apache.org/jira/browse/MATH-774 and assigned it to myself. I will check if other of the implemented methods in oacm.random are not used either and open new issues if that is the case. Thanks for making us aware of this, Paul. Cheers,

Re: [math] Gamma Distribution Algorithm

2012-03-29 Thread Paul Rivera
Thanks for all the info guys! As Ted Dunning mentioned, the inverse cumulative function is specific to GammaDistributionImpl (I'm actually using commons math 2.2). What then is the algorithm that GammaDistributionImpl.sample() uses? The link

Re: [math] Gamma Distribution Algorithm

2012-03-28 Thread Paul Rivera
Hi Guys, I heard that there's lots of way to sample from a Gamma distribution. What is commons-math using when I call GammaDistribution.sample()? From the API, it says that sample() uses the Inversion method from: http://en.wikipedia.org/wiki/Inverse_transform_sampling But this function is

Re: [math] Gamma Distribution Algorithm

2012-03-28 Thread Ted Dunning
Yes the sample method is inherited, but the inverse cumulative distribution function is not. On Wed, Mar 28, 2012 at 7:11 PM, Paul Rivera paulriver...@gmail.com wrote: Hi Guys, I heard that there's lots of way to sample from a Gamma distribution. What is commons-math using when I call