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 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 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 inherited from AbstractRealDistribution. Doesn't the >> sampling method differ between distributions (e.g. gaussian vs gamma vs >> beta vs etc)? >> >> Best Regards, >> Paul >> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org