Transformations of Random Variables
Why squaring, exponentiating, or otherwise reshaping a random variable does not just reshape its density the same way — the stretching correction, the Jacobian, that makes probability mass balance out.
Prerequisites: Kolmogorov's Axioms of Probability
If stock prices are lognormal, that means is normal — but the density of the price is not just the normal density with swapped for . Applying a function to a random variable warps its distribution in a way that isn't a simple substitution; regions get stretched or compressed, and the probability density has to compensate. Getting this compensation right is what "transformation of random variables" means, and skipping it is a very common source of wrong answers.
The analogy: stretching a rubber sheet with paint on it
Imagine a rubber sheet marked with a fixed amount of paint per unit area — that's a probability density. Now stretch part of the sheet: pull one region out to twice its original width. The total paint on that region hasn't changed, but it is now spread over twice the area, so the paint's density (amount per unit area) there has halved. A transformation of a random variable does exactly this to probability: it relocates outcomes, and wherever the transformation stretches the number line, the density there must shrink to conserve total probability, and wherever it compresses the line, the density must grow.
Writing it down
Let have density and let for a monotonic, differentiable function (strictly increasing or strictly decreasing, so it has a well-defined inverse ). The density of is
In words: find which -value maps to your target (that's ), look up the original density there, then multiply by the stretching factor — how much a small interval near corresponds to in the original -space. That stretching factor is exactly the rubber-sheet correction: it is large where the transformation compresses -space into -space (density piles up) and small where it stretches -space out (density thins).
Worked example 1: squaring a uniform variable
Let be uniform on , so for . Let . First find the inverse: if then . The stretching factor: . Plug into the formula: for . Sanity check by direct computation: since is uniform. Integrate the derived density to confirm: . Matches. Notice as — squaring compresses values near zero enormously (both and , though here only, map close to ), so density piles up there, exactly the rubber-sheet effect.
Worked example 2: log-return to price, the lognormal case
Let be standard normal (mean 0, variance 1) representing a log-return, and let be next period's price starting from $100. Find the density of . Invert: , so . Stretching factor: . So , where is the standard normal density — this is exactly the lognormal density formula. Concretely at : , , stretching factor , so . At : , , stretching factor , giving — visibly lower, even though $200 is only "one log-unit" away, because the stretching factor shrinks as prices rise.
What this means in practice
Every time a quant moves between log-returns and prices, between volatility and variance, or between a raw signal and a ranked percentile, they are applying a transformation and must include the stretching factor or the resulting density is simply wrong — not approximately wrong, wrong by a factor that depends on where you are on the curve. The lognormal model for prices, the chi-squared distribution of squared normal variables, and delta-method standard errors for nonlinear estimators all come directly from this formula.
Applying a function to a random variable does not just relabel the density's axis — it reshapes it. The new density equals the old density (looked up at the corresponding ) times a stretching factor, , that corrects for how much compresses or expands the number line at each point.
The classic error is assuming with no stretching factor at all — as if transforming a variable were just a relabeling. It is not: worked example 1 shows a perfectly flat density in becomes an unbounded spike near zero in purely from the stretching factor, with nothing about the "shape" of changing. Skipping the derivative term is the single most common mistake in change-of-variables problems, and it produces a function that doesn't even integrate to 1.
Related concepts
Practice in interviews
Further reading
- Casella & Berger, Statistical Inference (ch. 2)
- Ross, A First Course in Probability (ch. 5-6)