Re: Generating normally distributed randoms in CL
- From: carlos.ungil@xxxxxxxxx
- Date: Thu, 31 Jul 2008 06:17:58 -0700 (PDT)
Is there a simple way to generate normally distributed random data in
CommonLisp? I'm looking for a package, that can handle this, and maybe
also other statistical stuff
Depending on you needs, the following might be good enough (passes
general normality tests for a few hundreds of numbers):
(- (loop for i from 1 to 12 sum (random 1d0)) 6)
From there you can go as far as you want to obtain the desiredaccuracy (including tail corrections if needed). There is a recent
review of algorithms here:
http://www.cse.cuhk.edu.hk/~phwl/mt/public/archives/papers/grng_acmcs07.pdf
Personally I find methods based on the inverse normal cumulative
function simpler to understand and safer to use. Transformation and
rejection methods are clever, but they are sensible to problems with
the pseudo-random sequence (and using them with low-discrepancy
sequences is difficult, when possible at all).
Carlos
.
- References:
- Generating normally distributed randoms in CL
- From: krzysztof.kielak@xxxxxxxxxxxxxx
- Generating normally distributed randoms in CL
- Prev by Date: Re: The Fundamental Confusion of Xah
- Next by Date: Re: Lisp Machine keyboard usage
- Previous by thread: Re: Generating normally distributed randoms in CL
- Next by thread: Collecting like-labelled sublists of a list
- Index(es):