Re: Generating normally distributed randoms in CL



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
.



Relevant Pages

  • Re: Illegal to do research on cryptography?
    ... >> good algorithm from scratch. ... by not knowing the standard ... >> algorithms I am more likely to create something new. ... I'm not trying to develop the perfect algo. ...
    (sci.crypt)
  • functional verification
    ... I will be in charge of implementing algorithms on FPGA (signal processing). ... Some people in the team are used to write the algorithms from scratch in ... I am a beginner in programming in VHDL, but from what I have seen in my ...
    (comp.lang.vhdl)
  • Re: Evo Devo ==> Genetic Algorithms?
    ... >> that the best algorithms of this nature are probably the ones thought ... > If you ever think one up "from scratch", ...
    (talk.origins)
  • Re: Illegal to do research on cryptography?
    ... Because I don't know the standard algorithms and I don't have the time ... to research the literature - this would take me longer than developing a ... good algorithm from scratch. ...
    (sci.crypt)