Continuous distribution
Erlang distribution
The time until the -th event when events arrive independently at a constant rate : the time for customers to arrive, for calls to reach a switchboard, for a part with spares to run out. It is the sum of independent Exponential() waiting times, and a gamma distribution whose shape is a whole number. A. K. Erlang introduced it to size telephone exchanges.
Erlang probability calculator
P(X ≤ 1.8) = 0.506376
At the parameters set by the sliders. The shaded region on the plot is the probability; the dots on the CDF mark F at its ends.
CDF
mean 2 · variance 1.333 · sd 1.155 · mode 1.333 · entropy 1.442 nats
Formulas
| Parameters |
|
|---|---|
| Support | |
| CDF | |
| Mean | |
| Variance | |
| Mode | |
| MGF | |
| Entropy |
The CDF says that the -th event has happened by time exactly when a Poisson() count of events by then is at least . SciPy's erlang takes the shape a and the scale .
Worked example
Calls reach a help desk as a Poisson process at 2 per minute. What is the probability that the third call arrives within the first minute?
The time to the third call is Erlang(), so Equivalently, at least 3 calls arrive in the minute. answer checked by code
How it relates to others
- Special case← Gamma: A Gamma() with a whole-number shape is Erlang(). checked by code
- Sum← Exponential: The sum of independent Exponential() waiting times is Erlang(): the time to the -th event of a Poisson process. checked by code
- Special case→ Exponential: Erlang() is Exponential(). checked by code
All the relationships, as a diagram →
In Python
from scipy import stats
import numpy as np
X = stats.erlang(a=3, scale=1/1.5)
X.pdf(2) # f(2) = 0.3361
X.cdf(2) # P(X ≤ 2) = 0.5768
X.mean(), X.var() # 2, 1.333
X.ppf(0.95) # 95th percentile
X.rvs(size=10, random_state=0)
rng = np.random.default_rng(0)
rng.gamma(shape=3, scale=1/1.5, size=10)SciPy and NumPy take the scale 1/λ, not the rate.
Choosing between this and its neighbours? Which distribution for waiting times and lifetimes?