Cumulative distribution function for log-logistic distribution.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | x |
sample position |
||
| real(kind=wp), | intent(in) | :: | alpha |
distribution log-scale |
||
| real(kind=wp), | intent(in) | :: | beta |
distribution shape |
||
| real(kind=wp), | intent(in) | :: | loc |
distribution log-location |
||
| character(len=*), | intent(in) | :: | tail |
tail options |
elemental function f_dst_llogistic_cdf_core(x, alpha, beta, loc, tail) result(p) ! ==== Description !! Cumulative distribution function for log-logistic distribution. ! ==== Declarations real(wp) , intent(in) :: x !! sample position real(wp) , intent(in) :: alpha !! distribution log-scale real(wp) , intent(in) :: beta !! distribution shape real(wp) , intent(in) :: loc !! distribution log-location character(len=*), intent(in) :: tail !! tail options real(wp) :: z !! log-scaled variable real(wp) :: t !! transformed variable real(wp) :: p ! ==== Instructions ! compute transformed variable z = (log(x) - loc) / alpha t = exp(beta * z) ! compute integral (left tailed) p = t / (1.0_wp + t) ! tail options select case(tail) case("left") p = p case("right") p = 1.0_wp - p case("two") if (z .gt. 0.0_wp) then p = 2.0_wp * (1.0_wp - p) else p = 2.0_wp * p endif case("confidence") if (z .gt. 0.0_wp) then p = 1.0_wp - 2.0_wp * (1.0_wp - p) else p = 1.0_wp - 2.0_wp * p endif end select end function f_dst_llogistic_cdf_core