Random Number Generator

The key part of the program for generating synthetic samples of lb
(and
of the similar program, not shown, for generating synthetic samples of

I_) is the random number generator which consists of two subroutines,
"BMs" and "D." Subroutine "DMS" generates uniformly distributed random

numbers on the interval (0,1).
It operates as follows:
First a "seed"
number x_, 0 SX, < 199,017, is stored in register 9.
The seed is substituted in Equation 3, which generates a new seed, i.e.,

X.

itl

= [(24,298x, + 99,991) mod 199,017]
1

.

(3)

The operations indicated by "mod 199,017" are (see program steps 019039) as follows:
First, p = 24,298x, + 99,991 is divided by 199,017.
Then the decimal portion of p is multiplied by 199,017, and the new

seed, Xj4,

is stored in register 9.

Then (see program steps 040-053)

the new seed is divided by 199,017 and multiplied by 10°.

Finally,

integral portion of this intermediate result is divided by 10°.

The

the

result is u., a uniformly distributed random number on the interval

(0,1).

Subroutine 'D" generates normally distributed random numbers, having the

means and standard deviations specified by the input data, by calling

subroutine "DMS" for two uniformly distributed random numbers, uj, and

u2, which are substituted in Equation 4, which follows:
x =¥-2 In u, cos(2Tu2)o + u
where
and

(4)

u is the population mean estimated by Xg,
o is the standard deviation estimated by sg.

Lognormal Versus Normal Distributions
Note that the program is designed to operate on the means and standard

deviations of the logarithms of lognormally distributed variables, but

it can be modified to operate on the arithmetic means and standard
deviations of the same variables.
There is, however, one caveat:
If
the arithmetic standard deviations are large compared to their means,
some of the synthetic sample values may be negative.
If this happens,
attempting to calculate the mean and standard deviation of the logarithms
of the synthetic samples will result in an error condition as the logarithms of negative numbers are imaginary.

508

Select target paragraph3