Tutorials › Statistical Theory I - Probability and Distribution Theory › The Density of the Kth Order Statistic

Order Statistics and Sample Extremes · Tutorial 447 of 994

The Density of the Kth Order Statistic

Learn how to differentiate the CDF of an order statistic into a density and apply the result to several continuous parent distributions.

Intermediate 10 min read

What You'll Learn

  • State the conditions under which the kth order statistic has a density.
  • Derive the density formula from the binomial-count expression for its CDF.
  • Identify the rank-dependent coefficient and powers of the parent CDF and survival function.
  • Calculate selected order-statistic densities for uniform, exponential, and beta samples.
  • Check a derived density by verifying its support and total integral.

From a Rank CDF to a Density

An order statistic describes a particular rank in a sample after the observations are sorted. Its CDF answers how likely that rank is to fall below a threshold. When the parent distribution has a density, differentiating that CDF gives a compact formula for the density of the rank. The formula combines three ingredients: the parent density at the threshold, the probability of observations below it, and the probability of observations above it.

Let \(X_1,\ldots,X_n\) be independent and identically distributed (iid) random variables with common CDF \(F\). Write their values in ascending order as \(X_{(1)}\leq\cdots\leq X_{(n)}\), so \(X_{(k)}\) is the observation in rank \(k\). The CDF expression for this rank follows by counting how many sample observations are at most \(x\). We use that expression here to obtain the density.

Definition: The kth order statistic \(X_{(k)}\), for \(1\leq k\leq n\), is the \(k\)th smallest value among \(X_1,\ldots,X_n\), with ranks counted from the bottom. When the parent distribution is continuous, ties occur with probability zero, so the ranks are unambiguous with probability one.

For any fixed \(x\), the number of observations at most \(x\) has a binomial distribution with parameters \(n\) and \(F(x)\). The event \(X_{(k)}\leq x\) occurs precisely when at least \(k\) observations are at most \(x\). Therefore,

$$ F_{X_{(k)}}(x) =P(X_{(k)}\leq x) =\sum_{j=k}^{n}\binom{n}{j}F(x)^j\{1-F(x)\}^{n-j}. $$

The index \(j\) counts observations at most \(x\). To find the density, we differentiate this finite sum. The resulting terms cancel in a telescoping pattern, leaving just one term involving the chance of exactly \(k-1\) observations below \(x\).

The Density Formula

Theorem: Suppose \(X_1,\ldots,X_n\) are iid with an absolutely continuous distribution having CDF \(F\) and density \(f\). For \(1\leq k\leq n\), the CDF of \(X_{(k)}\) is absolutely continuous, and its density is, for almost every \(x\),
$$ f_{X_{(k)}}(x) =\frac{n!}{(k-1)!(n-k)!} F(x)^{k-1}\{1-F(x)\}^{n-k}f(x). $$

The factorial coefficient can also be written \(n\binom{n-1}{k-1}\). It accounts for the number of ways to place the \(k-1\) observations below the rank, the observation at the rank, and the remaining \(n-k\) observations above it. The powers of \(F(x)\) and \(1-F(x)\) encode those lower and upper observations, while \(f(x)\) describes the observation at \(x\).

1
Express the rank event as a count.
At least \(k\) observations must be at most \(x\), giving the binomial sum for the CDF.
2
Differentiate with respect to \(u=F(x)\).
The derivative of the binomial tail telescopes to \(n\binom{n-1}{k-1}u^{k-1}(1-u)^{n-k}\).
3
Apply the chain rule.
Since \(u=F(x)\), its derivative is \(f(x)\) almost everywhere; multiplying by it gives the order-statistic density.

Proof by Differentiating the Binomial Tail

Define the polynomial \(G(u)=\sum_{j=k}^{n}\binom{n}{j}u^j(1-u)^{n-j}\) for \(0\leq u\leq1\). For each term, differentiation and the identities \(j\binom{n}{j}=n\binom{n-1}{j-1}\) and \((n-j)\binom{n}{j}=n\binom{n-1}{j}\) give

$$ \frac{d}{du}\left[\binom{n}{j}u^j(1-u)^{n-j}\right] =n\binom{n-1}{j-1}u^{j-1}(1-u)^{n-j} -n\binom{n-1}{j}u^j(1-u)^{n-j-1}. $$

When these derivatives are summed over \(j=k,\ldots,n\), the positive term indexed by \(j\) cancels the negative term indexed by \(j-1\), wherever both occur. The positive term at \(j=k\) remains; the negative term at \(j=n\) is zero. Thus

$$ G'(u)=n\binom{n-1}{k-1}u^{k-1}(1-u)^{n-k} =\frac{n!}{(k-1)!(n-k)!}u^{k-1}(1-u)^{n-k}. $$

The CDF of \(X_{(k)}\) is \(G(F(x))\). Because \(F\) is absolutely continuous and \(G\) is a polynomial, \(G\circ F\) is absolutely continuous on every bounded interval. The chain rule for absolutely continuous functions gives \(\frac{d}{dx}G(F(x))=G'(F(x))f(x)\) almost everywhere. Substituting the expression for \(G'\) proves the density formula. Also, \(G(0)=0\) and \(G(1)=1\), so the CDF has the correct limits at the two tails; its nonnegative derivative integrates to one. \(\square\)

Worked Densities

Worked Example: The Second Rank in a Uniform Sample

Let \(X_1,\ldots,X_4\) be iid Uniform\((0,1)\), and find the density of \(X_{(2)}\). On \(0<x<1\), the parent CDF and density are \(F(x)=x\) and \(f(x)=1\). Here \(n=4\), \(k=2\), and the coefficient is

$$ \frac{4!}{(2-1)!(4-2)!}=\frac{24}{1!\,2!}=12. $$

Substitution in the theorem gives

$$ f_{X_{(2)}}(x)=12x(1-x)^2,\qquad 0<x<1. $$

The density is zero outside \((0,1)\). As a check, its integral over the support is

$$ \int_0^1 12x(1-x)^2\,dx =12\left(\frac12-\frac23+\frac14\right) =12\left(\frac{1}{12}\right)=1. $$

Worked Example: The Second Rank in an Exponential Sample

Suppose \(X_1,X_2,X_3\) are iid exponential random variables with rate \(2\), so \(F(x)=1-e^{-2x}\) and \(f(x)=2e^{-2x}\) for \(x>0\). For \(X_{(2)}\), \(n=3\), \(k=2\), and the coefficient is \(3!/(1!1!)=6\). Therefore,

$$ \begin{aligned} f_{X_{(2)}}(x) &=6F(x)\{1-F(x)\}f(x)\\ &=6(1-e^{-2x})e^{-2x}(2e^{-2x})\\ &=12e^{-4x}(1-e^{-2x}),\qquad x>0. \end{aligned} $$

The density is zero for \(x\leq0\). Its total integral confirms the coefficient and powers:

$$ \int_0^\infty 12(e^{-4x}-e^{-6x})\,dx =12\left(\frac14-\frac16\right) =1. $$

Worked Example: The Second Rank from a Beta Parent

Let \(X_1,X_2,X_3\) be iid with density \(f(x)=2x\) for \(0<x<1\), and zero elsewhere. Integrating this density gives \(F(x)=x^2\) on that interval. Find the density of \(X_{(2)}\). The coefficient for \(n=3,k=2\) is \(6\), so

$$ \begin{aligned} f_{X_{(2)}}(x) &=6F(x)\{1-F(x)\}f(x)\\ &=6x^2(1-x^2)(2x)\\ &=12x^3(1-x^2),\qquad 0<x<1. \end{aligned} $$

It is zero outside \((0,1)\). Direct integration provides a check:

$$ \int_0^1 12x^3(1-x^2)\,dx =12\left(\frac14-\frac16\right)=1. $$

The parent density is not uniform, so the result differs from the uniform-sample formula even though the sample size and rank are the same. The parent CDF and density both affect the order-statistic density.

Interpreting and Checking the Result

For an observation near \(x\) to occupy rank \(k\), exactly \(k-1\) of the other observations must lie below it, and \(n-k\) must lie above it. The density formula makes this structure visible: \(F(x)^{k-1}\) and \(\{1-F(x)\}^{n-k}\) represent those lower and upper positions, while \(f(x)\) supplies local density at the ranked observation. This is why the density is not generally just a multiple of the parent density.

For an absolutely continuous parent distribution, the probability of any pair of sample observations being equal is zero. Indeed, two independent variables with densities have probability zero of landing on the same point; a finite union over all pairs still has probability zero. Thus the rank interpretation has no tie ambiguity with positive probability. The density formula itself remains an almost-everywhere statement, which is the appropriate level of precision when a density or derivative is defined only almost everywhere.

A useful validation is to check the support and integral. The order statistic cannot fall outside the parent distribution's support, and the formula must integrate to one. The theorem's CDF proof ensures normalization generally; direct integration, as in the examples, can catch an omitted factor or an incorrect exponent in a particular calculation.

Common Mistake

Common pitfall: Differentiating only \(F(x)\) and concluding that the order-statistic density is \(f(x)\). The parent density describes one observation, not its rank. The correction is to differentiate the full CDF of the rank: this contributes the rank coefficient and the powers of \(F(x)\) and \(1-F(x)\), as well as the factor \(f(x)\).

Another frequent error is reversing the exponents. For the ascending rank \(k\), there are \(k-1\) observations below the ranked value and \(n-k\) above it. Therefore the powers are \(F(x)^{k-1}\) and \(\{1-F(x)\}^{n-k}\), respectively. A quick check at the rank endpoints is helpful: for \(k=1\), the exponent of \(F\) is zero; for \(k=n\), the exponent of \(1-F\) is zero.

Check Your Understanding

Use the density formula and show enough work to make each calculation checkable.

  1. For an iid Uniform\((0,1)\) sample of size \(5\), derive the density of \(X_{(3)}\), including its support.
  2. For iid observations with CDF \(F\) and density \(f\), explain why the exponent on \(F(x)\) in the density of \(X_{(k)}\) is \(k-1\), not \(k\).
  3. For a sample of size \(2\) from an exponential distribution with rate \(1\), derive the density of \(X_{(2)}\) and verify its integral.
  4. State the regularity condition on the parent distribution used in the density theorem, and explain why the formula is asserted almost everywhere.
  5. A proposed density for a rank has support outside the support of the parent distribution. What does this tell you about the calculation?