Chapter Contents |
Previous |
Next |
RANNOR |
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. |
Syntax | |
Arguments | |
Details | |
Comparisons | |
See Also |
Syntax |
RANNOR(seed) |
Range: | seed < 231-1 |
Note: | If seed 0, the time of day is used to initialize the seed stream. |
Details |
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));
Comparisons |
See Also |
Call routine:
CALL RANNOR |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.