org.das2.math.PoissonDistribution

Class for generating numbers from a Poisson distribution.

PoissonDistribution( )


poisson

poisson( double L, java.util.Random random ) → int

This function generates a random variate with the poisson distribution. Uses inversion by chop-down method for L < 17, and ratio-of-uniforms method for L ≥ 17. For L < 1.E-6 numerical inaccuracy is avoided by direct calculation. For L > 2E9 too big--throws IllegalArgumentException

Parameters

L - a double
random - a Random

Returns:

an int

[search for examples] [view on GitHub] [view on old javadoc] [view source]