Re: Generating normally distributed randoms in CL
- From: Tamas K Papp <tkpapp@xxxxxxxxx>
- Date: 30 Jul 2008 09:00:20 GMT
On Tue, 29 Jul 2008 13:59:40 +0200, Pascal J. Bourguignon wrote:
"krzysztof.kielak@xxxxxxxxxxxxxx" <krzysztof.kielak@xxxxxxxxxxxxxx>
writes:
Is there a simple way to generate normally distributed random data in
CommonLisp?
Yes. Learning some probabilities.
I think this is a bad attitude in general. One can't know everything,
and one can't implement everything from scratch. Or even if you can,
sometimes your time is not worth it.
I'm looking for a package, that can handle this, and maybe also other
statistical stuff
Google gives:
(DEFUN NORMAL-RANDOM ()
(* (SQRT (* -2.0L0 (LOG (- 1.0L0 (RANDOM 1.0L0)))))
(COS (* 2.0L0 PI (RANDOM 1.0L0)))))
do we really need yet another package for this simple function?
In some cases you can find simple algorithms that you can easily
implement, but having more advanced algorithms that are already written,
debugged and tested (like the Ziggurat algorithm below) is always nice.
For example, to solve differential equations, you can program an RK4
solver really quickly. But you may not want to program a sophisticated
adaptive-stepsize algorithm that handles stiffness when one is already
available.
Tamas
.
- Follow-Ups:
- References:
- Generating normally distributed randoms in CL
- From: krzysztof.kielak@xxxxxxxxxxxxxx
- Re: Generating normally distributed randoms in CL
- From: Pascal J. Bourguignon
- Generating normally distributed randoms in CL
- Prev by Date: [PEPM 2009] Preliminary CFP
- Next by Date: Re: Diversion of the White Rabbit!
- Previous by thread: Re: Generating normally distributed randoms in CL
- Next by thread: Re: Generating normally distributed randoms in CL
- Index(es):
Relevant Pages
|