Quant Memo
Core

The Probability Integral Transform

Why plugging any random variable into its own CDF always produces a plain uniform(0,1) variable — the fact that lets you simulate any distribution from a random number generator and lets you test whether a model's predictions are calibrated.

Prerequisites: Transformations of Random Variables

Suppose you need to simulate ten thousand draws from a complicated, non-standard distribution — realistic return shocks, say — but your computer's random number generator only produces uniform numbers between 0 and 1. There is a strikingly clean fact that solves this: run any random variable through its own cumulative distribution function, and no matter what the original distribution looked like — skewed, fat-tailed, bimodal — the output is always a plain uniform(0,1) variable. That fact, and its reverse, is the probability integral transform.

The analogy: a distribution's CDF as a percentile machine

The cumulative distribution function F(x)=P(Xx)F(x) = P(X \leq x) answers "what fraction of outcomes fall at or below xx?" — in other words, F(x)F(x) is the percentile that xx sits at. If you take a random draw XX and ask "what percentile did it land at," the answer, F(X)F(X), is itself random — but here's the trick: since XX was drawn from the true distribution, its percentile is exactly as likely to land at the 10th percentile as the 90th as the 50th, by construction. A random draw's own percentile rank is uniformly distributed on (0,1), for any underlying distribution. That's the whole idea; the rest is notation.

Writing it down

Let XX be a continuous random variable with CDF FF. The probability integral transform states

U=F(X)UUniform(0,1).U = F(X) \quad \Longrightarrow \quad U \sim \text{Uniform}(0,1) .

In words: feeding a random variable into its own CDF always yields a uniform(0,1) result, regardless of what FF looks like. Proof sketch, in plain terms: for any u(0,1)u \in (0,1), P(Uu)=P(F(X)u)=P(XF1(u))=F(F1(u))=uP(U \leq u) = P(F(X) \leq u) = P(X \leq F^{-1}(u)) = F(F^{-1}(u)) = u — the CDF of UU is literally uu itself, which is precisely the definition of uniform(0,1).

The reverse direction is what makes simulation possible:

X=F1(U)for UUniform(0,1).X = F^{-1}(U) \quad \text{for } U \sim \text{Uniform}(0,1) .

In words: draw an ordinary uniform random number UU, then look up which xx-value has that percentile under your target distribution — F1(U)F^{-1}(U), the inverse CDF, also called the quantile function — and that xx has exactly the target distribution. This is the standard "inverse transform sampling" method every random-number library uses under the hood.

U ~ Unif(0,1) X = F⁻¹(U) F(x), the CDF
Pick a uniform height U on the vertical axis, read across to the CDF curve, then drop down to the corresponding x-value — that x has exactly the target distribution.

Worked example 1: simulating an exponential distribution by hand

The exponential distribution with rate λ=2\lambda=2 has CDF F(x)=1e2xF(x) = 1 - e^{-2x}. Invert it: set u=1e2xu = 1-e^{-2x}, solve for xx: e2x=1ue^{-2x} = 1-u, so 2x=ln(1u)-2x = \ln(1-u), giving F1(u)=12ln(1u)F^{-1}(u) = -\tfrac{1}{2}\ln(1-u). Draw a uniform number, say u=0.7u=0.7 (from a random number generator). Plug in: x=12ln(10.7)=12ln(0.3)=12×(1.204)=0.602x = -\tfrac12 \ln(1-0.7) = -\tfrac12\ln(0.3) = -\tfrac12 \times (-1.204) = 0.602. That single number, 0.602, is a valid draw from the exponential(2) distribution — check it: F(0.602)=1e2(0.602)=1e1.204=10.300=0.700F(0.602) = 1-e^{-2(0.602)} = 1-e^{-1.204} = 1-0.300 = 0.700, matching the uu you started with, exactly as the transform guarantees.

Worked example 2: testing whether a forecast model is calibrated

A volatility model outputs a predicted CDF F^t\hat F_t for tomorrow's return every day. If the model is correctly calibrated, then each day's realised outcome, run through that day's predicted CDF, ut=F^t(xt)u_t = \hat F_t(x_t), should look like an ordinary uniform(0,1) sample across many days — that's exactly the probability integral transform applied to a good model. Suppose across 100 days the realised values utu_t cluster: 40 of them fall between 0.45 and 0.55, far more than the 10 you'd expect from a uniform distribution. That clustering is direct evidence the model's forecasts are systematically too wide (outcomes keep landing near the predicted median more often than the model's own spread implies) — a diagnostic called a "PIT histogram," used constantly to grade probabilistic forecasts.

What this means in practice

Every Monte Carlo simulation that needs draws from a non-uniform distribution — normal, exponential, a fitted empirical distribution — relies on inverse transform sampling, the reverse direction of this theorem. In the forward direction, it is the standard tool for checking whether a risk model's predicted distributions are calibrated against realised outcomes, exactly as in worked example 2.

Running any random variable through its own CDF always produces a uniform(0,1) variable: F(X)Uniform(0,1)F(X) \sim \text{Uniform}(0,1). Running the reverse — plugging a uniform draw into the inverse CDF, F1(U)F^{-1}(U) — produces a draw from the target distribution. One fact, used in both directions: simulation forward, calibration testing backward.

The theorem requires FF to be a genuine, strictly increasing continuous CDF. For discrete distributions (a Poisson count, a credit rating), F(X)F(X) is not exactly uniform — it clumps at the jump points of FF, because many different outcomes can map to the same CDF value's "landing zone." Applying inverse transform sampling to a discrete distribution still works for simulation (with a small modification), but naively expecting F(X)F(X) itself to look uniform for calibration-checking a discrete or count-based model will produce a misleading, lumpy histogram even when the model is correct.

Related concepts

Practice in interviews

Further reading

  • Casella & Berger, Statistical Inference (ch. 2.1)
  • Rosenblatt, Remarks on a Multivariate Transformation (1952)
ShareTwitterLinkedIn