Cumulative distribution function and quantiles

The cumulative distribution function of a continuous random variable \(X\) has been defined as

\[ F(x) \;\;=\;\; P(X \le x) \]

and is a monotonic increasing function rising from 0 to 1. Its inverse is

\[ F^{-1}(y) \;\;=\;\; q_y \qquad \text{where }P(X \le q_y) = y \]

Therefore \(F^{-1}(y)\) returns the \(y\)'th quantile of the distribution. Note also that

\[ F\left(F^{-1}(y)\right) \;\;=\;\; y \]

Applying the CDF as a transformation

We now show what happens when a variable's cumulative distribution function is used to transform it.

Transforming a variable into a rectangular distribution

If a continuous random variable \(X\) has cumulative distribution functions \(F(x)\), then the random variable \(Y = F(X)\) has a \(\RectDistn(0, 1)\) distribution.

For values \(y\) between 0 and 1, the cumulative distribution function of Y is

\[ \begin{align} F_Y(y) \;\;=\;\; P(Y \le y) \;\;&=\;\; P(F(X) \le y) \\ &=\;\; P(X \le F^{-1}(y)) \\ &=\;\; F\left(F^{-1}(y)\right) \\ &=\;\; y \end{align} \]

More completely,

\[ F_Y(y) \;\;=\;\; \begin{cases} 0 & y \lt 0 \\[0.3em] y & 0 \le y \le 1 \\[0.3em] 1 & y \gt 1 \end{cases} \]

The probability density function of \(Y\) is therefore

\[ f_Y(y) \;\;=\;\; F_Y'(y) = 1 \]

between 0 and 1 and zero elsewhere — a \(\RectDistn(0, 1)\) distribution.

The converse of this theorem is also useful.

Transforming a rectangular variable into an arbitrary distribution

If \(F(x)\) is a monotonic continuous function of \(x\) rising from 0 to 1, with inverse function \(F^{-1}(\cdot)\), and \(Y \sim \RectDistn(0, 1)\), then the random variable \(X = F^{-1}(Y)\) has a distribution with cumulative distribution function \(F(x)\).

The cumulative distribution function of \(X\) is

\[ F_X(x) \;\;=\;\; P(X \le x) \;\;=\;\; P(F^{-1}(Y) \le x) \;\;=\;\; P(Y \le F(x)) \;\;=\;\; F(x)\]

We now illustrate these results with an example.

Example: Exponential distribution

If \(X \sim \ExponDistn(\lambda)\), then it has cumulative distribution function

\[ F(x) \;\;=\;\; 1 - e^{\large -\lambda x}\]

The first result above means that

\[ Y \;\;=\;\; 1 - e^{\large -\lambda X} \;\;\sim\;\; \RectDistn(0,\;1) \]

The inverse function to \(F(x)\) is

\[ F^{-1}(y) \;\;=\;\; -\frac {\log(1 - y)}{\lambda}\]

Therefore if \(Y \sim \RectDistn(0,\; 1)\), then \(X = -\dfrac {\log(1 - Y)}{\lambda}\) has a distribution with cumulative distribution function \(F(x)\) that is therefore an \(\ExponDistn(\lambda)\) distribution.


The following diagram illustrates this relationship for \(X \sim \ExponDistn(\lambda=0.2)\). The cumulative distribution function for this distribution, \(F(x)\), is shown in the main part of the diagram, with the pdfs of \(X\) and \(Y = F(X)\) on the bottom and left margins of the diagram.

Click anywhere on the cumulative distribution function to see how values of \(X\) are related to those of \(Y\). Observe that: