Mail Archives: djgpp/1999/11/24/03:41:34
Hans-Bernhard Broeker <broeker AT acp3bf DOT knirsch DOT de> wrote:
> 'Other languages'; you're sure? I don't think I ever saw a programming
> *language* that has gaussian-distributed pseudo random numbers in its
> definition of 'must-have' library functions.
Maybe we can call Matlab a language? :)
>> it is quite a common thing..has anyone thought about possibly
>> including functions like this in libm?
IIRC, some RNGs and several distributions are implemented in the
libg++ (libgpp in DJGPP) library which used to come with G++.
> The typical method works by transforming the distribution. The trick
> is that the cumulative version of any distribution is equally
> distributed between 0.0 and 1.0, i.e. you can randomly choose a
> 'percentile', and map that back to a value distributed as
> prescribed, by the inverse of the cumulative distribution function
> (the 'inverse error function', in the case of Gaussian).
Yes, or conversion from polar coordinates, as any book on this will
mention. The Gaussian inverse cdf is difficult to calculate.
--
Groeten, *Michel* _http://www.cs.vu.nl/~mdruiter_
____________
\ /====\ / "You know, Beavis, you need things that suck,
\/ \/ to have things that are cool", Butt-Head.
- Raw text -