EXPPPF Subroutine

public subroutine EXPPPF(P, Ppf)

NAME

expppf(3f) - [M_datapac:PERCENT_POINT] compute the exponential percent
point function

SYNOPSIS

   SUBROUTINE EXPPPF(P,Ppf)

    REAL(kind=wp),intent(in) :: P
    REAL(kind=wp),intent(out) :: Ppf

DESCRIPTION

EXPPPF(3f) computes the percent point 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)

Note that the percent point function of a distribution is identically
the same as the inverse cumulative distribution function of the
distribution.

INPUT ARGUMENTS

P     The value at which the percent point function is to be
      evaluated. P Should be between 0.0 (inclusively) and 1.0
      (exclusively).

OUTPUT ARGUMENTS

PPF  The percent point function value.

EXAMPLES

Sample program:

program demo_expppf
use M_datapac, only : expppf
implicit none
! call expppf(x,y)
end program demo_expppf

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

  • Filliben, Simple and Robust Linear Estimation of the Location parameter of a Symmetric Distribution (Unpublished PH.D. Dissertation, Princeton University), 1969, pages 21-44, 229-231.
  • filliben, ‘The Percent Point Function’, (Unpublished Manuscript), 1970, pages 28-31.
  • Johnson and Kotz, Continuous Univariate Distributions–1, 1970, pages 207-232.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: P
real(kind=wp), intent(out) :: Ppf

Source Code

SUBROUTINE EXPPPF(P,Ppf)
REAL(kind=wp),intent(in) :: P
REAL(kind=wp),intent(out) :: Ppf
!
!---------------------------------------------------------------------
!
!     CHECK THE INPUT ARGUMENTS FOR ERRORS
!
      IF ( P<0.0_wp .OR. P>=1.0_wp ) THEN
         WRITE (G_IO,99001)
         99001    FORMAT (&
         &' ***** FATAL ERROR--THE FIRST  INPUT ARGUMENT TO THE EXPPPF SUBROUTINE IS OUTSIDE THE ALLOWABLE (0,1) INTERVAL *****')
         WRITE (G_IO,99002) P
         99002    FORMAT (' ','***** THE VALUE OF THE ARGUMENT IS ',E15.8, ' *****')
      ELSE
         Ppf = -LOG(1.0_wp-P)
      ENDIF

END SUBROUTINE EXPPPF