ev2cdf(3f) - [M_datapac:CUMULATIVE_DISTRIBUTION] compute the extreme value type 2
(Frechet) cumulative distribution function
SUBROUTINE EV2CDF(X,Gamma,Cdf)
REAL(kind=wp),intent(in) :: X
REAL(kind=wp),intent(in) :: Gamma
REAL(kind=wp),intent(out) :: Cdf
EV2CDF(3f) computes the cumulative distribution function value for
the extreme value type 2 distribution with REAL tail
length parameter = GAMMA.
The extreme value type 2 distribution used herein is defined for all
non-negative X, and has the probability density function
f(X) = GAMMA * (X**(-GAMMA-1)) * exp(-(X**(-GAMMA)))
X The value at which the cumulative distribution function is
to be evaluated. X should be non-negative.
GAMMA The value of the tail length parameter. GAMMA should be
positive.
CDF The cumulative distribution function value for the extreme
value type 2 distribution with tail length parameter value = GAMMA.
Sample program:
program demo_ev2cdf
use M_datapac, only : ev2cdf
implicit none
! call ev2cdf(x,y)
end program demo_ev2cdf
Results:
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) | :: | X | |||
real(kind=wp), | intent(in) | :: | Gamma | |||
real(kind=wp), | intent(out) | :: | Cdf |
SUBROUTINE EV2CDF(X,Gamma,Cdf) REAL(kind=wp),intent(in) :: X REAL(kind=wp),intent(in) :: Gamma 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 EV2CDF(3f) is negative *****') WRITE (G_IO,99003) X Cdf = 0.0_wp RETURN ELSEIF ( Gamma<=0.0_wp ) THEN WRITE (G_IO,99002) 99002 FORMAT (' ***** FATAL ERROR--The second input argument to EV2CDF(3f) is non-positive *****') WRITE (G_IO,99003) Gamma Cdf = 0.0_wp RETURN ELSE Cdf = 0.0_wp IF ( X==0.0_wp ) RETURN Cdf = EXP(-(X**(-Gamma))) ENDIF 99003 FORMAT (' ','***** The value of the argument is ',E15.8,' *****') END SUBROUTINE EV2CDF