LOGPPF Subroutine

public subroutine LOGPPF(P, Ppf)

NAME

logppf(3f) - [M_datapac:PERCENT_POINT] compute the logistic percent
point function

SYNOPSIS

   SUBROUTINE LOGPPF(P,Ppf)

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

DESCRIPTION

LOGPPF(3f) computes the percent point function value for the logistic
distribution with mean = 0 and standard deviation = pi/sqrt(3).

This distribution is defined for all X and has the probability
density function

    f(X) = exp(X)/(1+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 and 1.0, exclusively.

OUTPUT ARGUMENTS

PPF    The percent point function value.

EXAMPLES

Sample program:

program demo_logppf
use M_datapac, only : logppf, plott, label
implicit none
integer,parameter :: n=40
real              :: x(n), y(n)
integer           :: i
   call label('logppf')
   x=[(real(i)/real(n+1),i=1,n)]
   do i=1,n
      call logppf(x(i),y(i))
   enddo
   call plott(x,y,n)
end program demo_logppf

Results:

 The following is a plot of Y(I) (vertically) versus X(I) (horizontally)
                   I-----------I-----------I-----------I-----------I
  0.9756098E+00 -                                                  X
  0.9359756E+00 I                                           X X
  0.8963415E+00 I                                       XX
  0.8567073E+00 I                                     X
  0.8170732E+00 I                                   XX
  0.7774390E+00 I                                  X
  0.7378049E+00 -                                 X
  0.6981707E+00 I                               XX
  0.6585366E+00 I                              X
  0.6189024E+00 I                             XX
  0.5792683E+00 I                            X
  0.5396341E+00 I                           X
  0.5000000E+00 -                          X
  0.4603658E+00 I                         X
  0.4207317E+00 I                        X
  0.3810976E+00 I                      XX
  0.3414634E+00 I                      X
  0.3018292E+00 I                    XX
  0.2621951E+00 -                   X
  0.2225609E+00 I                  X
  0.1829268E+00 I                XX
  0.1432927E+00 I               X
  0.1036585E+00 I            XX
  0.6402433E-01 I       X X
  0.2439024E-01 -  X
                   I-----------I-----------I-----------I-----------I
           -0.3689E+01 -0.1844E+01  0.4768E-06  0.1844E+01  0.3689E+01

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–2, 1970, pages 1-21.

Arguments

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

Source Code

SUBROUTINE LOGPPF(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)
         WRITE (G_IO,99002) P
      ELSE
         Ppf = LOG(P/(1.0_wp-P))
      ENDIF
!
99001 FORMAT(' ***** FATAL ERROR--The first input argument to LOGPPF(3f) is outside the allowable (0,1) interval *****')
99002 FORMAT (' ','***** The value of the argument is ',g0, ' *****')
END SUBROUTINE LOGPPF