Library / Probability distributions / PRD-20
Probability distributions
Gamma waiting time: probability density
Probability density of a gamma-distributed waiting time with shape k and scale s.
- Ref
- PRD-20
- Rev
- v1
- Field
- Probability distributions
- Result
- f [1/h]
The gamma density gives the chance per hour that the waiting time ends at x. For a whole number k it is the time to the kth event of a steady random process (the Erlang case). At x = 0 the density is infinite for k < 1, 1/s for k = 1 and zero for k > 1. Use x > 0.
Probability density of a gamma-distributed waiting time with shape k and scale s. For a whole number k it is the time until the kth event in a steady random process.
Calculator
- Mean waiting time, ks6 h
- Most likely waiting time, (k − 1)s (k ≥ 1)4 h
- Event rate, 1/s0.5 1/h
What drives the result
Each variable is moved across its typical range while the others stay at the values above. The longest bar is the key driver.
- At 4 h the density is 0.1353 per hour, against an average wait of 6 h.
- With k = 3 the density peaks at (k − 1)s = 4 h, before the mean.
Chart data as tables
Ranked variables
| Variable | Typical range | Lowest result | Highest result | Swing (1/h) | Local step | Change in result |
|---|---|---|---|---|---|---|
| s Scale s | 0.5 to 10 h | 0.005363 | 0.1663 | 0.161 | +10% | −9.89 % |
| k Shape k | 0.5 to 10 | 9.547e-5 | 0.1438 | 0.1437 | +10% | −8.24 % |
| x Elapsed time x | 0.1 to 30 h | 1.721e-5 | 0.1353 | 0.1353 | +10% | −0.934 % |
Sweep of Elapsed time x
| Elapsed time x (h) | Probability density (1/h) |
|---|---|
| 0.1 | 5.945e-4 |
| 3.837 | 0.1351 |
| 7.575 | 0.08124 |
| 11.31 | 0.02796 |
| 15.05 | 0.007636 |
| 18.79 | 0.001836 |
| 22.52 | 4.074e-4 |
| 26.26 | 8.545e-5 |
| 30 | 1.721e-5 |
Sweep one variable
Variables and how each one contributes
Probability density
What the equation gives you. Everything else feeds it.
Shape k
The shape parameter (a plain number). For a whole number k it counts the events being waited for; below 1 the density is infinite at zero. Raises the mean and variance in proportion and makes the shape more symmetric. Raising it by 10 % (to 3.3) moves the result by −8.24 %, from 0.1353 to 0.1242 1/h.
Scale s
The scale, in hours: the mean waiting time per event. It is the reciprocal of the event rate. Stretches every time in the model in proportion. Raising it by 10 % (to 2.2) moves the result by −9.89 %, from 0.1353 to 0.122 1/h.
Elapsed time x
The elapsed time, in hours, at which the result is read. Moves the time at which the density or probability is read. Raising it by 10 % (to 4.4) moves the result by −0.934 %, from 0.1353 to 0.1341 1/h.
Worked example with the values above
- Scaled time: x/s = 4 / 2 = 2.
- Numerator: (x/s)^(k−1) e^(−x/s) = 4 × 0.13534.
- Divide by s Γ(k) = 4: f = 0.13534 per hour.
Assumptions and limits
- Waiting times follow a gamma distribution; for whole-number k this is the time to the kth event of a steady, memoryless (Poisson) process.
- The shape and scale are known and use the same time unit as x.
Common mistakes
- Confusing the scale s with the rate λ = 1/s: using a rate where a scale is expected inverts the mean.
- Using the gamma form with non-constant event rates, where the Poisson-process link no longer holds.
- Reading the density as a probability.
Statistics and uncertainty
The inputs are parameters, usually fitted to data, and their estimation error carries into the result. The probability or density is a smooth function of the parameters, so the sweep chart shows how sensitive it is: where the curve is steep, a small error in a parameter makes a large difference. The formula treats the parameters as exact, so it gives no confidence interval on its own.
Where it is used
- Time until the kth failure, arrival or repair in a steady random process.
- Rainfall totals, queue service times and other positive, right-skewed quantities.
Maths you need
- Gamma function: the generalised factorial
- Poisson process: events at a constant average rate