DistPoisson

class pydsol.core.distributions.DistPoisson(stream: StreamInterface, rate: float)[source]

Bases: DistDiscrete

The Poisson distribution models the number of occurrences per time unit of an event when the events take place randomly. It is for instance used to model the number of arrivals per time unit when the interarrival times are Exponentially distributed (leading to random arrivals over time). For more information on this distribution see https://mathworld.wolfram.com/PoissonDistribution.html.

__init__(stream: StreamInterface, rate: float)[source]

Constructs a Poisson distribution. The Poisson distribution models the number of occurrences per time unit of an event when the events take place randomly. It is for instance used to model the number of arrivals per time unit when the interarrival times are Exponentially distributed (leasing to random arrivals over time). The parameter lambda is the average number of arrivals per time unit (and in case of a generation process 1 / mean-interarrival-time.

Parameters:
  • stream (StreamInterface) – the random stream to use for this distribution

  • rate (int) – the average number of events per time unit, equal to (1 / inter-arrival time) of the events. Usually indicated with the Greek letter lambda, but that is a reserved word in Python.

Raises:
  • TypeError – when stream is not implementing StreamInterface:

  • TypeError – when rate is not a float:

  • ValueError – when rate <= 0:

draw() int[source]

Draw a value from the Poisson distribution, where the return value is the number of events per time unit where events occur randomly with the given rate. Adapted from Fortran program in Shannon, Systems Simulation, 1975, p. 359.

probability(observation: int) float[source]

Returns the probability of the observation for the distribution.

property rate: float

Return the rate parameter value, the average number of events per time unit that is modeled by the Poisson distribution

property stream: StreamInterface

Return the current random stream for this distribution.