RNEXV
Generates pseudorandom numbers from an extreme value distribution.
Required Arguments
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)
Optional Arguments
NR — Number of random numbers to generate. (Input)
Default: NR = size (R,1).
FORTRAN 90 Interface
Generic: CALL RNEXV (AMU, BETA, R [, …])
Specific: The specific interface names are S_RNEXV and D_RNEXV.
FORTRAN 77 Interface
Single: CALL RNEXV (NR, AMU, BETA, R)
Double: The double precision name is DRNEXV.
Description
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 log(1 ‑ ui).
Comments
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.
Example
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
Output
Extreme value random deviates: 1.2202 -1.1971 0.3740 -0.1715 0.6223