Chapter 17: Probability Distribution Functions and Inverses

UNDPR

This function evaluates the discrete uniform probability density function.

Function Return Value

UNDPR — Function value, the probability that a random variable from a uniform distribution having scale parameter N will be equal to IX.   (Output)

Required Arguments

IX — Argument for which the discrete uniform probability density function is to be evaluated.   (Input)

N — Scale parameter.   N must be greater than 0.  (Input)

FORTRAN 90 Interface

Generic:                              UNDPR (IX, N)

Specific:                             The specific interface names are S_UNDPR and D_UNDPR.

FORTRAN 77 Interface

Single:                                UNDPR (IX, N)

Double:                              The double precision name is DUNDPR.

Description

The discrete uniform PDF is defined for positive integersin the range.  It has the value, and.  Allowing the function to accept values of resulting in is provided as a convenience to the user.  Values of are errors.

Example

In this example, we evaluate the discrete uniform probability density function at IX = 3, N = 5.

 

      USE UMACH_INT
      USE UNDPR_INT
      IMPLICIT NONE

      INTEGER NOUT, IX, N

      REAL PR

      CALL UMACH(2, NOUT)

      IX = 3

      N = 5

      PR = UNDPR(IX, N)

      WRITE (NOUT, 99999) IX, N, PR

99999 FORMAT (' UNDPR(', I2, ', ', I2, ') = ', F6.4)

      END

Output

 

UNDPR( 3,  5) = 0.2000  



http://www.vni.com/
PHONE: 713.784.3131
FAX:713.781.9260