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

Thomas Neidhart edited comment on MATH-1220 at 4/29/15 7:39 PM:
----------------------------------------------------------------

btw. is the implemented rejection method published anywhere?

The most recent paper about sampling from a Zipf distribution that I could find 
is available here: http://epub.wu.ac.at/1176/ which refers to two older methods 
from Devroye and Dagpunar.

Edit: I did a lot of tests and research already on the topic, and it seems that 
the proposed method improves the current state of the art, but I could not find 
any reference or published version of the algorithm. Do you plan to publish it?


was (Author: tn):
btw. is the implemented rejection method published anywhere?

The most recent paper about sampling from a Zipf distribution that I could find 
is available here: http://epub.wu.ac.at/1176/ which refers to two older methods 
from Devroye and Dagpunar.

> More efficient sample() method for ZipfDistribution
> ---------------------------------------------------
>
>                 Key: MATH-1220
>                 URL: https://issues.apache.org/jira/browse/MATH-1220
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Otmar Ertl
>         Attachments: patch_v1
>
>
> Currently, sampling from a ZipfDistribution is very inefficient. Random 
> values are generated by inverting the CDF. However, the current 
> implementation uses O(N) power function evaluations to calculate the CDF for 
> some point. (Here N is the number of points of the Zipf distribution.) I 
> propose to use rejection sampling instead, which allows the generation of a 
> single random value in constant time.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to