Discrete uniform distribution: 1) Generation DO k=0, SIZE(PARAM3) PARAM3(k) = G05DYF(PARAM1, PARAM2) END DO 2) Frequency IF (PARAM3 < PARAM1 .OR. PARAM3 > PARAM2) THEN PARAM4 = 0 ELSE PARAM4 = 1 / (PARAM2 - PARAM1 + 1) END IF Binomial distribution 1) Generation ifail = 0 CALL G05EDF(PARAM1, PARAM2, binomial_reference, SIZE(binomial_reference), ifail) IF (ifail /= 0) THEN WRITE (*, *) 'Error when trying to generate random numbers from binomial distribution, parameters: n = ', PARAM1, ' p = ', PARAM2 STOP END IF DO k=0, SIZE(PARAM3) PARAM3(k)=G05EYF(binomial_reference, SIZE(binomial_reference)) END DO 2) Frequency ifail=0 CALL G01BJF(PARAM1, PARAM2, PARAM3, temp_real, temp_real, PARAM4, ifail) IF (ifail /= 0) THEN WRITE (*, *) 'Error when trying to calculate frequency of the binomial distribution, parameters: n = ',PARAM1, 'p = ',PARAM2 STOP END IF Poisson distribution 1) Generation ifail = 0 CALL G05ECF(PARAM1, poisson_reference, SIZE(poisson_reference), ifail) IF (ifail /= 0) THEN WRITE (*, *) 'Error when trying to generate random numbers from poisson distribution, parameters: mu = ', PARAM1 STOP END IF DO k=0, SIZE(PARAM2) PARAM2(k)=G05EYF(poisson_reference, SIZE(poisson_reference)) END DO 2) Frequency ifail=0 CALL G01BJF(PARAM1, PARAM2, , temp_real, temp_real, PARAM3, ifail) IF (ifail /= 0) THEN WRITE (*, *) 'Error when trying to calculate frequency of the poisson distribution, parameters: mu = ', PARAM1 STOP END IF Continuous uniform distribution: 1) Generation CALL G05FAF(PARAM1, PARAM2, SIZE(PARAM3), PARAM3) 2) Frequency IF (PARAM3 < PARAM1 .OR. PARAM3 > PARAM2) THEN PARAM4 = 0 ELSE PARAM4 = 1 / (PARAM2 - PARAM1) END IF Beta distribution 1) Generation ifail = 0 CALL G05FEF(PARAM1, PARAM2, SIZE(PARAM3), PARAM3, ifail) IF (ifail /= 0) THEN WRITE (*, *) 'Error when trying to generate random numbers from beta distribution, parameters: a = ', PARAM1, 'b = ', PARAM2 STOP END IF 2) Frequency ifail = -1 CALL G01EEF(PARAM3, PARAM1, PARAM2, 1.0_dp, temp_real, temp_real, PARAM4, ifail) IF (ifail /= 0) THEN WRITE (*, *) 'Error when trying to calculate frequency of the beta distribution, parameters: a = ', PARAM1, 'b = ', PARAM2 STOP END IF