1.4 Distribution of the range of a random sample

Let \(X_1, X_2, \dots , X_n\) be a random sample from a continuous distribution with pdf \(f(\cdot )\) and cdf \(F(\cdot )\). Let \(X_{(j)}\) be the \(j\)th order statistic, \(j = 1, 2, \dots , n\), so that \(X_{(1)}\) is the smallest and \(X_{(n)}\) the largest observation. We want the distribution of the range \(R = X_{(n)} - X_{(1)}\).

For \(i < j\) and \(x < y\), the joint density of \(X_{(i)}\) and \(X_{(j)}\) counts the ways of placing \(i - 1\) observations below \(x\), one at \(x\), \(j - i - 1\) between \(x\) and \(y\), one at \(y\), and \(n - j\) above \(y\):

xy11ijn− −− 1ij− 1

\begin {align*} f_{X_{(i)},X_{(j)}}(x, y) &= \frac {n!}{(i - 1)!\,(j - i - 1)!\,(n - j)!}\,f(x)f(y) \\ &\qquad \times \bigl (F(x)\bigr )^{i-1}\bigl (F(y) - F(x)\bigr )^{j-i-1}\bigl (1 - F(y)\bigr )^{n-j} . \end {align*}

With \(i = 1\) and \(j = n\) this becomes \[ f_{X_{(1)},X_{(n)}}(x, y) = \frac {n!}{(n - 2)!}\,f(x)f(y)\bigl (F(y) - F(x)\bigr )^{n-2} , \qquad x < y . \] Now transform \((X_{(1)}, X_{(n)}) \to (U, R)\) with \[ U = X_{(1)} , \qquad R = X_{(n)} - X_{(1)} , \] so that \(X_{(1)} = U\) and \(X_{(n)} = R + U\). The Jacobian is \[ J = \begin {vmatrix} \dfrac {\partial X_{(1)}}{\partial R} & \dfrac {\partial X_{(1)}}{\partial U} \\[2ex] \dfrac {\partial X_{(n)}}{\partial R} & \dfrac {\partial X_{(n)}}{\partial U} \end {vmatrix} = \begin {vmatrix} 0 & 1 \\ 1 & 1 \end {vmatrix} = -1 , \] so \(|J| = 1\) and \[ f_{U,R}(u, r) = n(n - 1)f(u)f(r + u)\bigl (F(r + u) - F(u)\bigr )^{n-2} , \qquad r > 0 . \] Integrating out \(u\), \[ f_R(r) = \int n(n - 1)f(u)f(r + u)\bigl (F(r + u) - F(u)\bigr )^{n-2}\,du . \]

Example 1.4.1. Let \(X_1, X_2, \dots , X_n\) be a random sample from the exponential distribution with mean \(1/\lambda \). Find the pdf of \(R = X_{(n)} - X_{(1)}\).

Solution. Here \(f(x) = \lambda e^{-\lambda x}\) and \(F(x) = 1 - e^{-\lambda x}\) for \(x > 0\), so \(F(r + u) - F(u) = e^{-\lambda u} - e^{-\lambda (u+r)} = e^{-\lambda u}(1 - e^{-\lambda r})\). Then \begin {align*} f_R(r) &= \int _0^\infty n(n - 1)\lambda e^{-\lambda u}\,\lambda e^{-\lambda (u+r)}\bigl (e^{-\lambda u}(1 - e^{-\lambda r})\bigr )^{n-2}\,du \\ &= n(n - 1)\lambda ^2e^{-\lambda r}\bigl (1 - e^{-\lambda r}\bigr )^{n-2}\int _0^\infty e^{-\lambda nu}\,du \\ &= n(n - 1)\lambda ^2e^{-\lambda r}\bigl (1 - e^{-\lambda r}\bigr )^{n-2}\cdot \frac {1}{\lambda n} \\ &= (n - 1)\lambda e^{-\lambda r}\bigl (1 - e^{-\lambda r}\bigr )^{n-2} , \qquad r > 0 . \end {align*}

Note. Sums of gamma variables behave like sums of Poisson variables. If \(X_1 \sim \text {Gamma}(\alpha _1, \lambda )\) and \(X_2 \sim \text {Gamma}(\alpha _2, \lambda )\) are independent, then \(X_1 + X_2 \sim \text {Gamma}(\alpha _1 + \alpha _2, \lambda )\). More generally, if \(X_j \sim \text {Gamma}(\alpha _j, \lambda )\), \(j = 1, \dots , k\), are independent, then \[ \sum _{j=1}^kX_j \sim \text {Gamma}\Bigl (\sum _{j=1}^k\alpha _j, \lambda \Bigr ) . \] The next subsection proves the special case of a sum of exponential variables.

Questions on this section

Stuck on something here? Ask below and it stays attached to this topic.