(uniform-rand 50)will generate a list of 50 independent uniform random variables. The functions "2D normal-rand and "2D cauchy-rand work similarly. Other generating functions require additional arguments to specify distribution parameters. Here is a list of the functions available for dealing with probability distributions:
normal-cdf | normal-quant | normal-rand | normal-dens |
cauchy-cdf | cauchy-quant | cauchy-rand | cauchy-dens |
beta-cdf | beta-quant | beta-rand | beta-dens |
gamma-cdf | gamma-quant | gamma-rand | gamma-dens |
chisq-cdf | chisq-quant | chisq-rand | chisq-dens |
t-cdf | t-quant | t-rand | t-dens |
f-cdf | f-quant | f-rand | f-dens |
binomial-cdf | binomial-quant | binomial-rand | binomial-pmf |
poisson-cdf | poisson-quant | poisson-rand | poisson-pmf |
The state of the internal random number generator can be ``randomly'' reseeded, and the current value of the generator state can be saved. The mechanism used is the standard Common Lisp mechanism. The current random state is held in the variable "2D *random-state*. The function "2D make-random-state can be used to set and save the state. It takes an optional argument. If the argument is NIL or omitted "2D make-random-state returns a copy of the current value of "2D *random-state*. If the argument is a state object a copy of it is returned. If the argument is "2D t a new, ``randomly'' initialized state object is produced and returned. 6