EXPCDF Subroutine

public subroutine EXPCDF(X, Cdf)

NAME

expcdf(3f) - [M_datapac:CUMULATIVE_DISTRIBUTION] compute the exponential cumulative
distribution function

SYNOPSIS

   SUBROUTINE EXPCDF(X,Cdf)

    REAL(kind=wp),intent(in) :: X
    REAL(kind=wp),intent(out) :: Cdf

DESCRIPTION

EXPCDF(3f) computes the cumulative distribution function value for
the exponential distribution with mean = 1 and standard deviation = 1.

This distribution is defined for all non-negative X, and has the
probability density function

   f(x) = exp(-x)

INPUT ARGUMENTS

X      The value at which the cumulative distribution function is
       to be evaluated. X should be non-negative.

OUTPUT ARGUMENTS

CDF    The cumulative distribution function value.

EXAMPLES

Sample program:

program demo_expcdf
use M_datapac, only : expcdf
implicit none
! call expcdf(x,y)
end program demo_expcdf

Results:

AUTHOR

The original DATAPAC library was written by James Filliben of the
Statistical Engineering Division, National Institute of Standards
and Technology.

MAINTAINER

John Urban, 2022.05.31

LICENSE

CC0-1.0

REFERENCES

  • Johnson and Kotz, Continuous Univariate Distributions–1, 1970, pages 207-232.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: X
real(kind=wp), intent(out) :: Cdf

Source Code

SUBROUTINE EXPCDF(X,Cdf)
REAL(kind=wp),intent(in) :: X
REAL(kind=wp),intent(out) :: Cdf
!
!     CHECK THE INPUT ARGUMENTS FOR ERRORS
!
      IF ( X<0.0_wp ) THEN
         WRITE (G_IO,99001)
         99001 FORMAT (' ***** NON-FATAL DIAGNOSTIC--THE FIRST  INPUT ARGUMENT TO EXPCDF(3f) IS NEGATIVE *****')
         WRITE (G_IO,99002) X
         99002 FORMAT (' ','***** THE VALUE OF THE ARGUMENT IS ',E15.8,' *****')
         Cdf = 0.0_wp
         RETURN
      ELSE
         Cdf = 1.0_wp - EXP(-X)
      ENDIF
!
END SUBROUTINE EXPCDF