next up previous index
Next: V137 Binomial Random Up: CERNLIB Previous: V135 Gamma or

V136 Poisson Random Numbers

Routine ID: V136
Author(s): D. Drijard, K.S. KölbigLibrary: MATHLIB
Submitter: Submitted: 15.10.1994
Language: FortranRevised:

Subroutine subprogram POISSN generates a random integer N>0 according to the Poisson distribution

Prob(N) = {1N!} eμN,

where μ> 0 (the mean) is a constant specified by the user.

Structure:

SUBROUTINE subprogram
User Entry Names: RNPSSN, RNPSET
External References: RANLUX (V115), RNORMX (V120)

Usage:

    CALL RNPSSN(AMU,N,IERR)
AMU
( REAL) Mean μ .
N
( INTEGER) The generated random number N, Poisson-distributed, with mean AMU.
IERR
( INTEGER) Error flag.
= 0: Normal case.
= 1: AMU ≤0 .
For AMU > AMAX , a (faster) normal approximation is made. The default value for AMAX is AMAX=170.0 . It can be reset by
    CALL RNPSET(AMAX)

Timing:

Time increases with μ roughly as μ0.7 .

V137


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995