RANTRI Function


Returns a random variate from a triangular distribution

Category: Random Number

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

Syntax

RANTRI ( seed,h )

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

h

  • is a numeric SAS value.

  • range: 0 < h < 1

Details

The RANTRI function returns a variate that is generated from the triangular distribution on the interval (0,1) with parameter h , which is the modal value of the distribution. An inverse transform method applied to a RANUNI uniform variate is used.

A triangular distribution X on the interval [A,B] with mode C, where A C B, can be generated:

 x=(b-a)*rantri(seed,(c-a)/(b-a))+a; 

Comparisons

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

See Also

Call routine:

'CALL RANTRI Routine' on page 382




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