Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in) | :: | a |
FUNCTION random_Weibull(a) RESULT(fn_val)
! Generates a random variate from the Weibull distribution with
! probability density:
! a
! a-1 -x
! f(x) = a.x e
REAL, INTENT(IN) :: a
REAL :: fn_val
! For speed, there is no checking that a is not zero or very small.
fn_val = random_exponential() ** (one/a)
RETURN
END FUNCTION random_Weibull