Interactive demo · Probability and Statistical Inference · Chapter 2

The distribution of a sum: convolution

If X and Y are independent, Z = X + Y has density fZ(z) = ∫ fX(t) fY(z − t) dt: flip the density of Y, slide it to z, multiply by the density of X and take the area (top left). Equivalently, P(Z ≤ z) is the probability of the half-plane below the line x + y = z (top right; this is Figure 2.6 for any law). Repeating the step gives the law of Sn = X1 + … + Xn (bottom).

Law of each term X

Parameter

Number of terms n

Point z

Try these

Continuous laws are put on a fine grid first: each term is replaced by its probabilities on cells of width h (0.01 for the uniform, 0.05β for the exponential, 0.05 for the Normal, 0.25 for the Cauchy), and the cell probabilities are convolved exactly; integer-valued laws need no grid. Mass far out in the tails is dropped and reported. The histogram shows 5000 simulated sums from a seeded generator.

In the lecture notes