Returns a random variate from a normal distribution
Category: Random Number
Tip: If you want to change the seed value during execution, you must use the CALL RANNOR routine instead of the RANNOR function.
RANNOR ( seed )
seed
is an integer. If seed ‰ 0, the time of day is used to initialize the seed stream.
Range: seed < 2 31 -1
See: 'Seed Values' on page 257 for more information about seed values
The RANNOR function returns a variate that is generated from a normal distribution with mean 0 and variance 1. The Box-Muller transformation of RANUNI uniform variates is used.
A normal variate X with mean MU and variance S2 can be generated with this code:
x=MU+sqrt(S2)*rannor(seed);
A lognormal variate X with mean exp (MU + S2/2) and variance exp (2*MU + 2*S2) - exp (2*MU + S2) can be generated with this code:
x=exp(MU+sqrt(S2)*rannor(seed));
The CALL RANNOR routine, an alternative to the RANNOR function, gives greater control of the seed and random number streams.
Call routine:
'CALL RANNOR Routine' on page 373