Probability

Inverse Transform Sampling

Students trace from a marked probability to its corresponding value on a curve.

Inverse Transform Sampling definition

Inverse transform sampling generates a draw from a distribution by applying its quantile function to a uniform random number.

In Spanish
muestreo por transformación inversa
Topic
Probability simulation and sampling

Inverse Transform Sampling in a picture

Inverse Transform Sampling diagramIn a two-outcome model with probabilities 0.3 and 0.7, the first outcome occupies the first 0.3 of the uniform scale.Draw U uniformly on (0, 1)Suppose U = 0.27Compare cumulative thresholdsThe first threshold is 0.30Choose the first outcomeIt is the first threshold at or above U
In a two-outcome model with probabilities 0.3 and 0.7, the first outcome occupies the first 0.3 of the uniform scale.

How it works

Draw U uniformly between 0 and 1, then return the smallest x whose cumulative probability F(x) is at least U, using the generalized inverse if needed. For a continuous strictly increasing CDF on its support, use the ordinary inverse F⁻¹(U). For discrete outcomes, find the first cumulative threshold at or above U.

Worked examples

Sample from a uniform distribution on [2, 6].

Set X = 2 + 4U.

For F(x) = x² on [0, 1], what should the sampler return?

Return √U, since that solves x² = U.

Outcome A has probability 0.2, B has 0.5, and C has 0.3. What does U = 0.55 produce?

B, since the cumulative thresholds are 0.2, 0.7, and 1.

Common mistake

Use the cumulative distribution function rather than the density. The cumulative thresholds account for all earlier outcomes.

Quick check

For F(x) = x³ on [0, 1], what transform samples the distribution?

What distribution supplies U?

Show answer

Uniform on (0, 1).

Can the method handle discrete distributions?

Show answer

Yes, by using cumulative probability thresholds.

Sources

Flashcard

Inverse Transform Sampling

Reveal the definition

Inverse transform sampling generates a draw from a distribution by applying its quantile function to a uniform random number.

Effortless Math. “Inverse Transform Sampling.” Math Dictionary.