RNNOS
Generates pseudorandom order statistics from a standard normal distribution.
Required Arguments
IFIRST — First order statistic to generate. (Input)
ILAST — Last order statistic to generate. (Input)
ILAST must be greater than or equal to IFIRST. The full set of order statistics from IFIRST to ILAST is generated. If only one order statistic is desired, set ILAST = IFIRST.
N — Size of the sample from which the order statistics arise. (Input)
R — Vector of length ILAST + 1 ‑ IFIRST containing the random order statistics in ascending order. (Output)
The first element of R is the IFIRST‑th order statistic in a random sample of size N from the standard normal distribution.
FORTRAN 90 Interface
Generic: CALL RNNOS (IFIRST, ILAST, N, R)
Specific: The specific interface names are S_RNNOS and D_RNNOS.
FORTRAN 77 Interface
Single: CALL RNNOS (IFIRST, ILAST, N, R)
Double: The double precision name is DRNNOS.
Description
Routine RNNOS generates the IFIRST through the ILAST order statistics from a pseudorandom sample of size N from a normal (0, 1) distribution. Routine RNNOS uses the routine RNUNO to generate order statistics from the uniform (0, 1) distribution and then obtains the normal order statistics using the inverse CDF transformation.
Each call to RNNOS yields an independent event so order statistics from different calls may not have the same order relations with each other.
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, RNNOS is used to generate the fifteenth through the nineteenth order statistics from a sample of size twenty.
USE RNNOS_INT
USE UMACH_INT
USE RNSET_INT
IMPLICIT NONE
INTEGER IFIRST, ILAST, ISEED, N, NOUT
REAL R(5)
!
CALL UMACH (2, NOUT)
IFIRST = 15
ILAST = 19
N = 20
! Initialize seed of random number
! generator.
ISEED = 123457
CALL RNSET (ISEED)
CALL RNNOS (IFIRST, ILAST, N, R)
WRITE (NOUT,99999) R
99999 FORMAT (' The 15th through the 19th order statistics from a', &
/, ' random sample of size 20 from a normal distribution' &
, /, 5F8.4)
END
Output
The 15th through the 19th order statistics from a
random sample of size 20 from a normal distribution
0.4056 0.4681 0.4697 0.9067 0.9362