RNFDF

Generates pseudorandom numbers from the F distribution.

Required Arguments

DFN — Numerator degrees of freedom. (Input)
DFN must be positive.

DFD — Denominator degrees of freedom. (Input)
DFD must be positive.

R — Vector of length NR containing the random F deviates. (Output)

Optional Arguments

NR — Number of random numbers to generate. (Input)
Default: NR = size (R,1).

FORTRAN 90 Interface

Generic: CALL RNFDF (DFN, DFD, R [])

Specific: The specific interface names are S_RNFDF and D_RNFDF.

FORTRAN 77 Interface

Single: CALL RNFDF (NR, DFN, DFD, R)

Double: The double precision name is DRNFDF.

Description

Routine RNFDF generates pseudorandom numbers from an F distribution (see Chapter 17, “Probability Distribution Functions and Inverses”, routine FDF).

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, RNFDF is used to generate five pseudorandom deviates from an F distribution with parameters DFN = 2 and DFD = 3.

 

USE UMACH_INT

USE RNFDF_INT

IMPLICIT NONE

INTEGER NR

PARAMETER (NR=5)

INTEGER NOUT

REAL DFD, DFN, R(NR)

 

CALL UMACH(2, NOUT)

CALL RNSET(123457)

 

DFN = 2.0e0

DFD = 3.0e0

CALL RNFDF(DFN, DFD, R)

WRITE (NOUT, 99999) R

99999 FORMAT (' F Random deviates: ', 5F10.4)

END

Output

 

F Random deviates: 0.0814 0.3639 0.1323 1.5415 1.0350