[R-lang] Power law / Zipf random number generator

Stefan Evert stefan.evert at uos.de
Thu Jul 19 08:29:15 PDT 2007


On 19 Jul 2007, at 16:49, David Reitter wrote:

> Does anyone on this list have some R code that implements a random  
> number generator for power law / Zipfian distributions analogous to  
> what the runif/rnorm/... family of functions provides?

You could try our zipfR package, available from

http://www.cogsci.uni-osnabrueck.de/~severt/zipfR/

(it's also on CRAN, but not the latest version).  Amongst other  
things, this package implements random samples from populations that  
follow the Zipf-Mandelbrot law (in the form of the "ZM" and "fZM"  
LNRE models).

If you decide to use it, I can give you a few lines of sample code to  
help you get started.




Best regards,
Stefan Evert

[ stefan.evert at uos.de | http://purl.org/stefan.evert ]




More information about the R-lang mailing list