commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Darren Wilkinson (JIRA)" <>
Subject [jira] [Commented] (MATH-585) Very slow generation of gamma random variates
Date Mon, 06 Jun 2011 20:04:58 GMT


Darren Wilkinson commented on MATH-585:

It is not urgent in the sense that I can use Parallel COLT! :-/ But it is quite a big deal
for anyone wanting to use Commons Math and doing serious Monte Carlo work. Not only is the
gamma distribution itself very important, but the gamma generator is used as the basis for
simulating variates from many other distributions (including inverse gamma, chi-square, inverse
chi-square, beta, Dirichlet, ...), so a slow gamma generator has lots of knock-on effects.
It is certainly the next most important non-uniform generator to provide after Gaussian. It
is not trivial to implement well, so I recommend copying or porting another implementation
if possible, though I'm not an expert on open source software licenses so I don't know how
practical that is. The GSL and R are GNU projects which have good C implementations, which
I think are based on slightly better algorithms than the Ahrens and Dieter algorithm you mention

> Very slow generation of gamma random variates
> ---------------------------------------------
>                 Key: MATH-585
>                 URL:
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 2.2, 3.0
>         Environment: All
>            Reporter: Darren Wilkinson
>              Labels: Gamma, Random
>   Original Estimate: 6h
>  Remaining Estimate: 6h
> The current implementation of gamma random variate generation works, but uses an inversion
method. This is well-known to be a bad idea. Usually a carefully constructed rejection procedure
is used. To give an idea of the magnitude of the problem, the Gamma variate generation in
Parallel COLT is roughly 50 times faster than in Commons Math. 

This message is automatically generated by JIRA.
For more information on JIRA, see:

View raw message