Generates pseudorandom numbers from an extreme value distribution.
AMU — The location parameter of the extreme value distribution. (Input)
BETA — The scale parameter of the extreme value distribution. (Input)
R — Vector of length NR containing the random extreme value deviates. (Output)
NR — Number of
random numbers to generate. (Input)
Default: NR = size (R,1).
Generic: CALL RNEXV (AMU, BETA, R [,…])
Specific: The specific interface names are S_RNEXV and D_RNEXV.
Single: CALL RNEXV (NR, AMU, BETA, R)
Double: The double precision name is DRNEXV.
Routine RNEXV generates
pseudorandom numbers from an extreme value distribution generated by evaluating
uniform variates, equating to the CDF, and
then solving for
by first computing
.
Where μ = AMU and β = BETA.
The routine ALNREL is used to
accurately evaluate the sub-expression.
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, RNEXV is used to generate five pseudorandom deviates from an extreme value distribution with location parameter equal to 0.0, and scale parameter 1.0.
USE
UMACH_INT
USE
RNEXV_INT
IMPLICIT NONE
INTEGER NR
PARAMETER (NR=5)
INTEGER NOUT
REAL AAMU, B, R(NR)
CALL UMACH(2, NOUT)
CALL RNSET(123457)
AAMU = 0.0
B = 1.0
CALL RNEXV(AAMU, B, R)
WRITE (NOUT, 99999) R
99999 FORMAT (' Extreme value random deviates: ', 5F10.4)
END
Extreme value random deviates: 1.2202 -1.1971 0.3740 -0.1715 0.6223
PHONE: 713.784.3131 FAX:713.781.9260 |