Interactive demo · Probability and Statistical Inference · Chapter 2

Transformations of a random variable: the cdf method

To find the law of Y = r(X): for each level y find the set Ay = {x : r(x) ≤ y} (top left), add up the probability of X on it to get FY(y) (top right), and differentiate. When y moves a little, Ay grows at each end point x with r(x) = y, by about dy/|r′(x)|; so the density is a sum over these preimages, one coloured band per branch at the bottom. Move y and watch the set, the area and the bands change together.

Law of X

Map y = r(x)

Level y

Simulated values n

Try these

Laws: Uniform(−1, 3) (Example 2.47), N(0, 1), Exp(1) (Example 2.46), and the density of Exercise 2.4 (1/4 on (0, 1), 3/8 on (3, 5)). log x is offered only when X > 0. "FX(x)" is the probability integral transform Y = FX(X). The histogram uses a seeded generator, so a preset always shows the same values.

In the lecture notes