RANUNI Function


Returns a random variate from a uniform distribution

Category: Random Number

Tip: If you want to change the seed value during execution, you must use the CALL RANUNI routine instead of the RANUNI function.

Syntax

RANUNI ( seed )

Arguments

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

Details

The RANUNI function returns a number that is generated from the uniform distribution on the interval (0,1) using a prime modulus multiplicative generator with modulus 2 31 - and multiplier 397204094 (Fishman and Moore 1982) (See 'References' on page 926).

You can use a multiplier to change the length of the interval and an added constant to move the interval. For example,

 random_variate=a*ranuni(seed)+b; 

returns a number that is generated from the uniform distribution on the interval (b,a+b).

Comparisons

The CALL RANUNI routine, an alternative to the RANUNI function, gives greater control of the seed and random number streams.

See Also

Call routine:

'CALL RANUNI Routine' on page 384




SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 704

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net