Probability Integral Transform and Inverse Transform Sampling
Proposition 2.4 connects a continuous cdf with the standard uniform distribution in both directions. This demo uses the standard Cauchy distribution because its pdf, cdf, and quantile function all have closed forms. Its heavy tails also make the changes in local slope especially visible.
The standard Cauchy distribution will be introduced in a later teaching topic. For now, only the following three functions are needed. Its cdf is continuous and strictly increasing, so its quantile function agrees with the ordinary inverse of the cdf. Write $Q=F^{-1}$. Then
\(\begin{aligned} f(x) &= \frac{1}{\pi(1+x^2)} \\[0.35em] F(x) &= \frac{1}{2} + \frac{1}{\pi}\arctan(x) \\[0.35em] Q(u) &= \tan\left(\pi\left(u-\frac{1}{2}\right)\right) \end{aligned}\)
Follow one value through all three functions
Start with $u$ on the standard uniform scale and set $x=Q(u)$. The same $x$ is marked on the pdf and cdf, while the same $u$ is marked on the quantile function. Move the slider or play the values from left to right.
The displayed interval 0.05 ≤ u ≤ 0.95 keeps the Cauchy tails legible. It does not truncate the distribution.
PDF: density height
The height $f(x)$ is the local slope of the cdf at the same $x$.
CDF: accumulated probability
The point $(x,u)$ satisfies $u=F(x)$, and the tangent has slope $f(x)$.
Quantile function: ordinary inverse
The point $(u,x)$ satisfies $x=Q(u)$, and its slope is $Q^{\prime}(u)$.
u = 0.500 → Q(u) = 0.000 → F(Q(u)) = 0.500
f(Q(u))Q′(u) = 1.0000
Why the two slopes cancel
The pdf gives the local slope of the cdf, so $F^{\prime}(x)=f(x)$. At the corresponding point $x=Q(u)$, the inverse-function rule gives
\[Q^{\prime}(u) = \frac{1}{f(Q(u))}\]Therefore, the chain rule gives
\[\frac{d}{du}F(Q(u)) = f(Q(u))Q^{\prime}(u) = 1\]The quantile function is not linear. Near $u=0.5$, it changes relatively slowly; near $0$ or $1$, it moves rapidly into the Cauchy tails. The linear growth appears only after $Q$ and $F$ are composed:
\[F(Q(u))=u\]For $0<u<1$, this agrees with the linear part of the standard uniform cdf, and the identity extends continuously to the two endpoints. Because the three charts use different axis scales, the apparent angles of the two tangents should not be compared directly. The displayed derivative values and their product give the relevant comparison.
Generate a Cauchy sample
The same relationship can be used as an algorithm. Generate independent standard-uniform values $U_1,\ldots,U_n$, and then, for $i=1,\ldots,n$, set
\[X_i = Q(U_i) = \tan\left(\pi\left(U_i-\frac{1}{2}\right)\right)\]The first histogram should be approximately flat. The second should follow the standard Cauchy density. Uniform values close to $0$ or $1$ are sent far into the Cauchy tails.
Before: uniform inputs
Histogram of $U_1,\ldots,U_n$ with the density $f_U(u)=1$.
After: Cauchy values
Histogram of $X_i=Q(U_i)$ with the standard Cauchy pdf.
What to notice
One control links both directions. Reading from $x$ to $u=F(x)$ is the forward probability integral transform. Reading from $u$ to $x=Q(u)$ is inverse transform sampling.
The cdf records where probability accumulates. A large pdf height makes the cdf rise quickly. The quantile function compensates by moving through the corresponding $x$ values more slowly. In the tails, the pdf is small, so the quantile function must move much farther for the same change in $u$.
The composition follows the uniform cdf, not the quantile curve. The cancellation is expressed by $f(Q(u))Q^{\prime}(u)=1$. Consequently, $F(Q(u))=u$ grows linearly even though neither the Cauchy cdf nor its quantile function is linear.
The plotted Cauchy range is incomplete. The simulation chart displays only the central interval from $Q(0.05)$ to $Q(0.95)$. Tail observations are counted below the chart, and every histogram density is divided by the full sample size rather than only by the number of visible observations.
The proof, the quantile-function formula used by the transform, and the endpoint convention are in Proposition 2.4. To review how a density builds a cdf before applying the transformation, see From pdf to cdf.
