You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Paul Cowan <ap...@funkwit.com> on 2008/01/17 05:56:11 UTC

[math] proposal: ZipfDistribution (code available)

Hi all,

I'd like to propose adding a Zipf (or Zipfian) integer distribution to 
commons-math.

The Zipf distribution is a distribution which (approximately) reflects 
many 'real-world' phenomena, e.g. the frequency of use of words in a 
language.

I have a patch available, including test case; per 
http://commons.apache.org/math/developers.html, I will add it to the 
wishlist and to Bugzilla (or Jira? I gather commons math uses Jira now 
but the page still says Bugzilla) and attach my patch if the response 
here is generally positive to the idea.

Note that the patch isn't perfect; in particular I've just stuck a 
method to calculate generalized harmonic numbers in the 
ZipfDistributionImpl class itself. I would suggest that a) it almost 
certainly shouldn't go there, and b) it could most certainly be done 
more efficiently (I'm using a simple cumulative loop), but I would like 
guidance on solving both of those issues from people who know the 
project and are better than me at mathematics (respectively).

Cheers,

Paul Cowan.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [math] proposal: ZipfDistribution (code available)

Posted by Luc Maisonobe <Lu...@free.fr>.
Paul Cowan a écrit :
> Hi all,
> 
> I'd like to propose adding a Zipf (or Zipfian) integer distribution to 
> commons-math.
> 
> The Zipf distribution is a distribution which (approximately) reflects 
> many 'real-world' phenomena, e.g. the frequency of use of words in a 
> language.

This is a good idea.

> 
> I have a patch available, including test case; per 
> http://commons.apache.org/math/developers.html, I will add it to the 
> wishlist and to Bugzilla (or Jira? I gather commons math uses Jira now 
> but the page still says Bugzilla) and attach my patch if the response 
> here is generally positive to the idea.

You should open a ticket in Jira.

We are currently working on the 1.2 release. This addition will not be 
included in this release. The next one will be 2.0.

> 
> Note that the patch isn't perfect; in particular I've just stuck a 
> method to calculate generalized harmonic numbers in the 
> ZipfDistributionImpl class itself. I would suggest that a) it almost 
> certainly shouldn't go there, and b) it could most certainly be done 
> more efficiently (I'm using a simple cumulative loop), but I would like 
> guidance on solving both of those issues from people who know the 
> project and are better than me at mathematics (respectively).

This will be discussed in the Jira comments system.

Thanks
Luc

> 
> Cheers,
> 
> Paul Cowan.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org