Poisson probability of n arrivals in a window

Gives the probability that exactly n arrivals occur in a window of length t when arrivals follow a homogeneous Poisson process with rate lambda. The expected number of arrivals is lambda times t. The function exp is the exponential function and factorial(n) is n!, the product of the whole numbers from 1 to n, with factorial(0) equal to 1.

Signature

P_n = (lambda * t)^n * exp(-lambda * t) / factorial(n)
Inputs
InputsDefinitionUnit
lambdaExpected number of arrivals per unit of time, constant over the windowarrivals per unit of time, for example patients per hour
tLength of the window over which arrivals are counted, in the same time unit as lambdatime, for example hours
nNumber of arrivals whose probability is requiredcount, a whole number of zero or more
Output
P_nProbability that exactly n arrivals occur in the windowprobability

Function

Arrival process count, gap and arrival-time function

Maps an arrival rate, constant or varying with time, to the number of patients or other entities that arrive in a window, the gaps between successive arrivals and the clock time of each arrival. The three descriptions carry the same information: S_n is the time of the nth arrival, X_i the gap before arrival i and N(t) the number of arrivals up to time t, in the notation of the Arrival Process article. The records cover Poisson counts, time-varying rates, sampling of gaps and arrival times in a discrete event simulation, and the single-server queueing result that links the arrival rate to waiting.

Computational function

  • Computational function: hourly arrival overflow probability and expected cover cost

    Takes the inputs of a capacity check, an hourly arrival rate, the number of arrivals the service can absorb in an hour, the number of hours at that rate and the cost of each overflow hour, and returns the probability that an hour overflows, the expected overflow hours and their expected cost. It sums the Poisson probabilities of HE-FM-ARRP-001 from 0 up to the capacity, takes the complement and scales it by hours and cost, so its inputs differ from the formula's variables. Running it once per rate period and adding the results gives the cost for a day with a peak, as in the article's assessment unit example.

    Inputs and outputs: lambda_h: Arrival rate per hour within the period; required, above zero. Unit: arrivals per hour.; c: Largest number of arrivals the service can absorb in one hour; required, a whole number of zero or more. Unit: count.; H: Number of hours in the day at rate lambda_h; required, above zero. Unit: hours.; k: Cost of calling in cover for one overflow hour; required, zero or more. Unit: currency per hour, for example £.; P_over: Probability that more than c patients arrive in one hour. Unit: probability.; E_over: Expected number of overflow hours in the period. Unit: hours.; C_over: Expected cost of overflow cover in the period. Unit: currency.

    Assumption: Arrivals within each period follow a Poisson process with a constant hourly rate, each hour is treated separately and backlog carried from one hour to the next is ignored, which a full simulation would capture. Adding backlog would be expected to widen the gap between steady and peaked demand, because queues build up during the peak.

    Worked example (Model A, constant rate of 2 per hour over 24 hours): The article's unit expects 48 patients a day and absorbs up to 4 an hour, with cover at £150 per overflow hour. Spread evenly, an hour overflows with probability about 0.0527, giving about 1.26 overflow hours and £189.55 a day. lambda_h = 2; c = 4; H = 24; k = 150; P_over = 0.052653; E_over = 1.263672; C_over = 189.55

    Worked example (Model B, daytime peak of 3 per hour over 12 hours): With 3 patients an hour from 08:00 to 20:00, a daytime hour overflows with probability about 0.185, giving about 2.22 overflow hours and £332.53. lambda_h = 3; c = 4; H = 12; k = 150; P_over = 0.184737; E_over = 2.216841; C_over = 332.53

    Worked example (Model B, night-time rate of 1 per hour over 12 hours): Overnight, at 1 patient an hour, the overflow probability is about 0.0037 and the expected cost £6.59. Added to the daytime period, Model B costs about £339.11 a day against £189.55 for Model A, about 80% more for the same 48 patients. lambda_h = 1; c = 4; H = 12; k = 150; P_over = 0.003660; E_over = 0.043918; C_over = 6.59

    Excel: =CostPerHour*HoursAtRate*(1-POISSON.DIST(Capacity,HourlyRate,TRUE)) With named cells HourlyRate, Capacity, HoursAtRate and CostPerHour, the formula returns the expected overflow cost for one rate period; one row per period and a SUM give the daily total.

    R: overflow_cost <- function(rate, cap, hours, cost) cost * hours * ppois(cap, rate, lower.tail = FALSE) Vectorised over rate and hours, so sum(overflow_cost(c(3, 1), 4, c(12, 12), 150)) returns the Model B daily cost of about 339.11.

    Python: def overflow_cost(rate, cap, hours, cost): return cost * hours * (1-sum(rate**n * math.exp(-rate) / math.factorial(n) for n in range(cap + 1))) Uses the math module; scipy.stats.poisson.sf(cap, rate) gives the same overflow probability.

    Test (Peaked demand costs more than a constant rate with the same daily mean): At a capacity of 4 and £150 an hour, 12 hours at 3 plus 12 hours at 1 give a higher expected cost than 24 hours at 2. Expected result: TRUE. Excel check: =150*(12*(1-POISSON.DIST(4,3,TRUE))+12*(1-POISSON.DIST(4,1,TRUE)))>150*24*(1-POISSON.DIST(4,2,TRUE))

    Test (Zero capacity reduces to the chance of any arrival): With a capacity of 0, an hour overflows whenever anyone arrives, so the overflow probability equals 1 minus exp(-lambda_h). Expected result: TRUE. Excel check: =ABS((1-POISSON.DIST(0,HourlyRate,TRUE))-(1-EXP(-HourlyRate)))<1E-12

    Common error (Running the check at the daily average rate for a peaked service): Using 2 patients an hour throughout gives £189.55 a day, while the same 48 patients arriving at 3 an hour by day and 1 at night give about £339.11. A model built on the daily average understates the cost of the current service and can misjudge an intervention that mainly removes daytime arrivals.

    Source: Gallager RG. Discrete Stochastic Processes, course text for MIT 6.262, chapter 2 (Poisson processes). MIT OpenCourseWare; 2011. Equation 2.16, the Poisson PMF for the number of arrivals in an interval, which the function sums up to the capacity.

    P_over = 1 - sum_(n=0)^c [lambda_h^n * exp(-lambda_h) / factorial(n)]; E_over = H * P_over; C_over = k * E_over

Implementations

  • Excel

    Poisson arrival probability in one cell

    Excel POISSON.DIST takes the count, the expected number of arrivals and FALSE for the probability of exactly that count. Rate, Window and Count are named cells; TRUE in place of FALSE returns the probability of that count or fewer.

    =POISSON.DIST(Count,Rate*Window,FALSE)

Assumptions

  • Constant arrival rate across the counting window

    The rate lambda does not change within the window. When demand peaks during the day, the window is split into periods with their own rates, and the count over a longer window is Poisson with the mean from the time-varying formula on this page.

  • Independent arrivals unaffected by the queue

    One arrival does not trigger another and arrivals do not respond to the state of the service. The assumption fails when one incident brings several casualties or when patients leave long queues, and counts that vary more than the Poisson model allows are a sign that it has broken down.

Worked examples

  • Four arrivals in one hour at 2 patients per hour

    At the article's constant rate of 2 patients per hour, the probability of exactly 4 arrivals in one hour is about 0.0902, the term 0.667 in the article's Model A sum multiplied by e to the power minus 2.

    lambda = 2; t = 1; n = 4; P_n = 0.0902
  • Four arrivals in one daytime hour at 3 patients per hour

    In the article's daytime peak of 3 patients per hour, the probability of exactly 4 arrivals in an hour rises to about 0.1680, the term 3.375 in the Model B daytime sum multiplied by e to the power minus 3.

    lambda = 3; t = 1; n = 4; P_n = 0.1680
  • No arrivals in one hour at 2 patients per hour

    With n equal to zero the formula reduces to e to the power minus lambda times t, the chance that the gap to the first arrival is longer than the window. At 2 patients per hour this is about 0.1353, the factor outside the brackets in the article's Model A sum.

    lambda = 2; t = 1; n = 0; P_n = 0.1353

Common errors

  • Arrival rate and window in different time units

    Entering the unit's demand of 48 patients a day as lambda with a window of 1 hour gives an expected 48 arrivals in the hour instead of 2. The probability of 4 or fewer arrivals then falls from about 0.947 to almost zero, and every hour appears to overflow.

  • Poisson counts for linked or booked arrivals

    The Poisson model fits unscheduled, independent arrivals. Several casualties from one incident arrive together, and booked outpatient or elective arrivals cluster close to the booked times, so a Poisson count misstates the bunching in both cases. Booked arrivals are better generated from the booking pattern, with non-attenders removed.

Sources

  • Poisson distribution of the number of arrivals

    Gallager RG. Discrete Stochastic Processes, course text for MIT 6.262, chapter 2 (Poisson processes). MIT OpenCourseWare; 2011. Definition 2.2.2 (Poisson process with exponential interarrival intervals, rate lambda and expected count lambda t) and equation 2.16 (Poisson PMF for N(t)).

    View source →

  • Patient arrivals as entities entering a discrete event simulation

    Karnon J, Stahl J, Brennan A, Caro JJ, Mar J, Möller J. Modeling using discrete event simulation: a report of the ISPOR-SMDM Modeling Good Research Practices Task Force-4. Value in Health. 2012;15(6):821-827. Section on model structure: entities can be created when a new patient arrives at a clinic, and can enter and leave between the start and end of the model.

    View source →

Canonical Identity

Stable URI · Machine-readable · Resolvable · CC BY 4.0