[ 
https://issues.apache.org/jira/browse/MATH-585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13045326#comment-13045326
 ] 

Mikkel Meyer Andersen commented on MATH-585:
--------------------------------------------

I know that it is indeed important, and I will look into it as soon as time 
allows me to. R is GPL, so using their implementation is a no-go. But the help 
file provides the methods they have implemented:
{quote}
‘rgamma’ for ‘shape >= 1’ uses

Ahrens, J. H. and Dieter, U. (1982).  Generating gamma variates by
a modified rejection technique.  _Communications of the ACM_,
*25*, 47-54,

and for ‘0 < shape < 1’ uses

Ahrens, J. H. and Dieter, U. (1974).  Computer methods for
sampling from gamma, beta, Poisson and binomial distributions.
_Computing_, *12*, 223-246.
{quote}

Again, thanks for reporting this - we'll do our best to improve our 
implementation.

> Very slow generation of gamma random variates
> ---------------------------------------------
>
>                 Key: MATH-585
>                 URL: https://issues.apache.org/jira/browse/MATH-585
>             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: http://www.atlassian.com/software/jira

Reply via email to