commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Cowan (JIRA)" <>
Subject [jira] Updated: (MATH-178) Implement Zipf distribution
Date Tue, 22 Jan 2008 23:44:34 GMT


Paul Cowan updated MATH-178:

    Attachment: ZipfDistribution2.patch

Attached is a version which addresses the test failure (note to self: rerun the tests after
that 'one last tidy-up before submitting the patch, that's what they're FOR!)

1) No real opinion as to whether this is 1.2-worthy or should wait for 2.0. We have no pressing
need for it to be included; if it's ready + everyone's happy with it in time for 1.2, well
and good, if not, then 2.0 is fine.

2) I will move the harmonic stuff into its own class. Should this just live in o.a.commons.math.special,
or is there a more suitable place?

3) I'll admit I don't know a better algorithm. I'm working on it, but the math is WAY over
my head. Wikipedia gives a generating function
at ("where Lim(z) is the polylogarithm, and | z | < 1. ") but my math skills are so atrophied
that working out whether that can be converted into an easy generating algorithm (and if so,
how) is a little beyond me. There's some interesting info at
-- it looks like Knuth covers harmonic numbers in SOME way in TAOCP, volume 1, but I don't
have a copy to hand.

I'll keep looking at this; if no such number can be found precomputing a lookup table may
be the best bet (perhaps multiple implementations of ZipfDistribution could exist; one which
does it 'naively' but slowly, one which caches an array of size [numberOfElements] on first
access (speed at the cost of memory)

> Implement Zipf distribution
> ---------------------------
>                 Key: MATH-178
>                 URL:
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Paul Cowan
>            Priority: Minor
>         Attachments: ZipfDistribution.patch, ZipfDistribution2.patch
> Per my post to commons-dev --
-- I'd like to propose adding a Zipf distribution to commons-math.
> I have a patch, but it's incomplete and somewhat inefficient; I'd like to throw it up
for discussion though. To follow.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message