Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | ndf | |||
logical, | intent(in) | :: | first |
FUNCTION random_chisq(ndf, first) RESULT(fn_val)
! Generates a random variate from the chi-squared distribution with
! ndf degrees of freedom
INTEGER, INTENT(IN) :: ndf
LOGICAL, INTENT(IN) :: first
REAL :: fn_val
fn_val = two * random_gamma(half*ndf, first)
RETURN
END FUNCTION random_chisq