Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 76EAF6E5C for ; Tue, 7 Jun 2011 08:48:22 +0000 (UTC) Received: (qmail 17547 invoked by uid 500); 7 Jun 2011 08:48:22 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 17466 invoked by uid 500); 7 Jun 2011 08:48:22 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 17458 invoked by uid 99); 7 Jun 2011 08:48:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jun 2011 08:48:22 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jun 2011 08:48:19 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id ECFB3105FDD for ; Tue, 7 Jun 2011 08:47:58 +0000 (UTC) Date: Tue, 7 Jun 2011 08:47:58 +0000 (UTC) From: "Mikkel Meyer Andersen (JIRA)" To: issues@commons.apache.org Message-ID: <1437631674.3124.1307436478967.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1440803169.68751.1307212727362.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (MATH-585) Very slow generation of gamma random variates MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/MATH-585?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D130453= 26#comment-13045326 ]=20 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} =E2=80=98rgamma=E2=80=99 for =E2=80=98shape >=3D 1=E2=80=99 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 =E2=80=980 < shape < 1=E2=80=99 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 impleme= ntation. > 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 ca= refully constructed rejection procedure is used. To give an idea of the mag= nitude of the problem, the Gamma variate generation in Parallel COLT is rou= ghly 50 times faster than in Commons Math.=20 -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira