Generates pseudorandom numbers from a Rayleigh distribution.
ALPHA — Parameter
of the Rayleigh distribution. (Input)
ALPHA must be greater
than 0.
R — Vector of length NR containing the random Rayleigh deviates. (Output)
NR — Number of
random numbers to generate. (Input)
Default: NR = size (R,1).
Generic: CALL RNRAL (ALPHA, R [,…])
Specific: The specific interface names are S_RNRAL and D_RNRAL.
Single: CALL RNRAL (NR, ALPHA, R)
Double: The double precision name is DRNRAL.
Routine RNRAL generates pseudorandom numbers from a Rayleigh distribution (see Chapter 17, Probability Distributions Functions and Inverses, routine RALDF).
The routine RNSET can be used to initialize the seed of the random number generator. The routine RNOPT can be used to select the form of the generator.
In this example, RNRAL is used to generate five pseudorandom deviates from a Rayleigh distribution with parameter ALPHA = 0.5.
USE
UMACH_INT
USE
RNRAL_INT
IMPLICIT NONE
INTEGER NR
PARAMETER (NR=5)
INTEGER NOUT
REAL ALPHA, R(NR)
CALL UMACH(2, NOUT)
CALL RNSET(123457)
ALPHA = 0.5
CALL RNRAL(ALPHA, R)
WRITE (NOUT, 99999) R
99999 FORMAT (' Rayleigh random deviates: ', 5F10.4)
END
Rayleigh random deviates: 0.1311 0.8199 0.3648 0.5307 0.2904
PHONE: 713.784.3131 FAX:713.781.9260 |