From: Charles Mills Date: 2004-08-15T02:28:55+09:00 Subject: Re: Random variable library? On Aug 14, 2004, at 1:07 AM, Mauricio Fern�ndez wrote: > On Sat, Aug 14, 2004 at 03:43:36PM +0900, Gavin Sinclair wrote: >> On Friday, August 13, 2004, 5:41:22 PM, Mauricio wrote: >> >>> On Fri, Aug 13, 2004 at 11:26:22AM +0900, Gavin Sinclair wrote: >>>> The work I'm doing now doesn't strictly require, but would benefit >>>> from a >>>> random number generator that: >>>> - obeyed the distribution you want, with the parameters you want >> >>> You can do that easily by taking a uniform random variable and >>> feeding >>> it into the distribution function you want. >> >> Thanks for the tip. How do you write a distribution function? > If your really interested in how to use a uniform random variable to generate other random variables 'Simulation' by Sheldon M Ross is a good book on the subject. You could also google the "inverse transform method" and that will probably turn up something. -Charlie > Well, that's more or less what the rand.rb mentioned somewhere else in > this thread does, at least for some distributions. Basically, once you > know the probability density function you want, you integrate it to > obtain > the distribution function. Note that in some cases the pdf. cannot be > integrated analytically, so you'd have to either generate an instance > of > the random var through other means or use some numerical > approximations. > > After a surprisingly long search (compared to what one is used to > regarding google :) I found the following: > http://www.causascientia.org/math_stat/Dists/Compendium.pdf > -- > Running Debian GNU/Linux Sid (unstable) > batsman dot geo at yahoo dot com > >