random_chisq Function

public function random_chisq(ndf, first) result(fn_val)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: ndf
logical, intent(in) :: first

Return Value real


Contents

Source Code


Source Code

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