logppf(3f) - [M_datapac:PERCENT_POINT] compute the logistic percent
point function
SUBROUTINE LOGPPF(P,Ppf)
REAL(kind=wp),intent(in) :: P
REAL(kind=wp),intent(out) :: Ppf
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.
P The value at which the percent point function is to be
evaluated.
P should be between 0.0 and 1.0, exclusively.
PPF The percent point function value.
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
The original DATAPAC library was written by James Filliben of the
Statistical Engineering Division, National Institute of Standards
and Technology.
John Urban, 2022.05.31
CC0-1.0
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | P | |||
real(kind=wp), | intent(out) | :: | Ppf |
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