Sampling a population

Brian Quinlan brian at sweetapp.com
Sat Jun 3 02:11:44 EDT 2006


Robert Kern wrote:
 > [numpy implementation snipped]

> Ed Schofield has an implementation of an algorithm by Marsaglia[1] which turns
> sampling into a fast table lookup. If your probabilities have limited precision
> (2**-30 or so rather than the full double precision 2**-52 or so), then this
> might be an attractive option.
> 
> [1]  http://www.jstatsoft.org/v11/i03/v11i03.pdf
> 

Thanks a lot for the numpy implementation and for the literature 
reference! I'll try to figure out how little precision I need in my 
sampling.

Cheers,
Brian



More information about the Python-list mailing list