Function poisson

  • poisson(state: RngState, lambda: number): number
  • Generate Poisson distributed random number. This implementation switches between two algorithms (Knuth's and Hormann's) as lambda gets large (10).

    See Knuth 1994 (or on wikipedia) and Hormann and Derflinger 1994 for details.

    Parameters

    • state: RngState

      Random number state

    • lambda: number

      The mean (and variance!) of the distribution

    Returns number

Generated using TypeDoc