Documentation for package rsm.rand


Author : R. Scott McIntire

Version: 1.2

Overview:

This package provides a discrete random number generator.

Export Summary:

make-standard-rangen: Make a new random number generator based on a list of 
                      value-density pairs.
               Example: (rsm.rand:make-standard-randgen 
                          '((1 0.2) (2 0.25) (3 0.25) (4 0.3)))
               makes a random generator object that has values 1,2,3,4 with
               corresponding probability density values 0.2, 0.25, 0.25, 0.3.
clone        : Clone a random generator object.
next-rand    : Get a random number (or numbers) from the a random number object.
rand-val-dens: Set the value-density pairs for the random number object.
rand-dist    : Get the distribution function (array) from a random 
               generator object.
bin-rand     : Form an ASCII display that describes the distribution of 
               the random number object.

bin-rand   (rand &optional (num-of-trials 1000))

Create an ASCII display of bining <num-of-trials> random numbers from the
random generator object, <rand>.

clone   (rand)

Clone a randgen object <rand>.

make-standard-randgen   (val-dens)

Makes a standard random generator object.
Example: (rsm.rand:make-standard-randgen '((1 0.2) (2 0.25) (3 0.25) (4 0.3)))
makes a random generator object that has values: 1,2,3,4 with corresponding probability density values: 0.2, 0.25, 0.25, 0.3.

next-rand   (rand &optional (n 1))

Get the next <n> random numbers from <rand>.

rand-dist   (rand)

Gets the probability distribution of the random number generator object as a
vector.

rand-val-dens   (rand)

Gets the values and probability density of the random number generator
object in the form ((val dens) ...).