Random Variables

The ∝ scope of this chapter is the generation of independent random variables X1 X2, ...with a given distribution function F or probability density function (pdf) f. We assume that we have access to a supply (Ui) of random numbers, independent samples from the uniform distribution on (0, 1). Our task is to transform (Ui) into (Xi). In most cases we will have the choice of several algorithms for doing so. Usually there will be no universal best choice; different methods might be recommended for once-off use and for adding to a computer center’s mathematical library.

When choosing algorithms we will consider the following points.

(a)   The method should be easy to understand and to program. It is all too easy to make mistakes while implementing sophisticated methods.

(b)   The programs produced should be compact. This may only be important on small machines but can considerably reduce overheads in interpreted languages.

(c)   The final code should execute reasonably rapidly. This point has been emphasized in the literature almost to the exclusion of the other two. Andrews (1976) cites a study in which generating the random variables cost 0.2% of the total computer usage of a simulation study. It is rarely important to save generation costs.

(d)   The algorithms will be used with pseudo-random numbers and should not accentuate their deficiencies.

Experience has shown that the relative speeds of different algorithms vary surprisingly little across different ...

Get Stochastic Simulation now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.