Your Equation

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

Solve for
1/h
0.510
h
0.510
h
0.130
  • 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.

Probability density (1/h) current value 0.1353 1/h
sScale sKey driver
0.005360.166
kShape k
9.55e-50.144
xElapsed time x
1.72e-5
  • 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

VariableTypical rangeLowest resultHighest resultSwing (1/h)Local stepChange in result
s Scale s0.5 to 10 h0.0053630.16630.161+10%−9.89 %
k Shape k0.5 to 10 9.547e-50.14380.1437+10%−8.24 %
x Elapsed time x0.1 to 30 h1.721e-50.13530.1353+10%−0.934 %

Sweep of Elapsed time x

Elapsed time x (h)Probability density (1/h)
0.15.945e-4
3.8370.1351
7.5750.08124
11.310.02796
15.050.007636
18.790.001836
22.524.074e-4
26.268.545e-5
301.721e-5

Sweep one variable

Probability density (1/h)Hover, touch, or use the arrow keys on the chart
00.050.1 51015202530 Elapsed time x (h) now 0.1353

Variables and how each one contributes

f

Probability density

Result · 1/h

What the equation gives you. Everything else feeds it.

k

Shape k

· typical 0.5 to 10

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.

s

Scale s

h · typical 0.5 to 10

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.

x

Elapsed time x

h · typical 0.1 to 30

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

  1. Scaled time: x/s = 4 / 2 = 2.
  2. Numerator: (x/s)^(k−1) e^(−x/s) = 4 × 0.13534.
  3. 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

Related formulas

Practise this formula