[
https://issues.apache.org/jira/browse/MATH-1220?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14709928#comment-14709928
]
Otmar Ertl commented on MATH-1220:
----------------------------------
Introduced rejection-inversion sampling approach with commits
* 484196fc2e11b632964895b6662dc783d4538b35 (3.6)
* 9c51e5316babbd370bc32aed0fee134216726ec9 (4.0)
> 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
> Assignee: Otmar Ertl
> Fix For: 4.0, 3.6
>
> Attachments: Zipf Rejection Inversion Sampling Notes.pdf, patch_v1,
> patch_v2, patch_v3
>
>
> 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)