Tutorials › Statistical Theory I - Probability and Distribution Theory › General Sample Spacings and Their Joint Density

Order Statistics and Sample Extremes · Tutorial 461 of 994

General Sample Spacings and Their Joint Density

Learn how ordered observations become gap coordinates, how to transform their joint density, and why all spacings must satisfy a fixed-sum constraint.

Intermediate 9 min read

What You'll Learn

  • Define the endpoint and interior spacings of a sample with finite support endpoints
  • Derive the joint order-statistic density for iid observations with a density
  • Transform that density into spacing coordinates and calculate the Jacobian
  • Describe the spacing support as a constrained simplex
  • Work with uniform and nonuniform examples, including a spacing probability
  • Distinguish a density in independent spacing coordinates from a density on a hyperplane

Why Work With Spacings?

Ordered observations describe locations: the smallest value, the next smallest, and so on. Spacings describe the gaps between those locations. This change of viewpoint is useful when the question concerns clustering, empty intervals, or how a sample is distributed across its range.

The gaps cannot vary freely. Once the sample interval endpoints are fixed, the endpoint gaps and the gaps between observations must add to the interval length. The joint density therefore lives on a constrained region, and getting that region right is part of the calculation.

Definition and Support

Let \(X_1,\ldots,X_n\) be iid random variables with a continuous density \(f\) supported on a finite interval \((a,b)\), where \(a<b\). Write their ordered values as \(X_{(1)}<\cdots<X_{(n)}\), which are distinct with probability one. The endpoint spacings measure the distance from the interval boundaries to the sample, and the interior spacings measure successive gaps.

Definition: The sample spacings are $$ D_1=X_{(1)}-a,\qquad D_i=X_{(i)}-X_{(i-1)}\quad (2\le i\le n),\qquad D_{n+1}=b-X_{(n)}. $$ The first and last are the endpoint spacings; \(D_2,\ldots,D_n\) are the interior spacings. They satisfy \(D_i>0\) for every \(i\) and \(\sum_{i=1}^{n+1}D_i=b-a\) with probability one.

The fixed-sum identity follows by telescoping: adding the first gap, all successive differences, and the final gap leaves exactly \(b-a\). Consequently, the \(n+1\) spacings have only \(n\) free coordinates. We will use \(D_1,\ldots,D_n\) as those coordinates and recover \(D_{n+1}\) from their sum.

From Ordered Values to Spacing Coordinates

For iid observations with density \(f\), the joint density of the ordered sample is \(n!\prod_{i=1}^n f(x_i)\) on \(a<x_1<\cdots<x_n<b\), and zero elsewhere. To see the factor \(n!\), consider a strictly ordered vector \(x_1<\cdots<x_n\). There are \(n!\) permutations of its coordinates in the unordered sample space. Each has the same product density because the observations are iid, and ties have probability zero. Summing the densities of these disjoint permutations gives the stated order-statistic density.

Now express the ordered observations using the first \(n\) spacings: \(x_i=a+\sum_{j=1}^i d_j\). The transformation is triangular: each \(x_i\) depends only on \(d_1,\ldots,d_i\), and the coefficient of \(d_i\) in \(x_i\) is 1. Its Jacobian determinant is therefore 1. The order constraints become positivity of each \(d_i\) and the requirement that their sum be less than the interval length.

Theorem: With respect to \(n\)-dimensional Lebesgue measure in the coordinates \(d_1,\ldots,d_n\), the joint density of the first \(n\) spacings is $$ g(d_1,\ldots,d_n) = n!\prod_{i=1}^n f\!\left(a+\sum_{j=1}^i d_j\right) $$ when \(d_i>0\) for every \(i\) and \(\sum_{i=1}^n d_i<b-a\), and is zero otherwise. The final spacing is \(D_{n+1}=b-a-\sum_{i=1}^nD_i\).

For completeness, the transformed density follows directly from the change-of-variables formula. At \(x_i=a+\sum_{j=1}^i d_j\), the ordered-sample density is \(n!\prod_i f(x_i)\). Multiplication by the absolute Jacobian determinant, which is 1, gives the displayed formula. The correspondence between the ordered region and the spacing region is one-to-one: positive \(d_1,\ldots,d_n\) with sum below \(b-a\) reconstruct a strictly ordered sample inside \((a,b)\), and every such sample gives exactly those spacings. This proves both the density formula and its stated support. \(\square\)

The support is an open \(n\)-dimensional simplex. The final spacing is positive precisely when \(\sum_{i=1}^n d_i<b-a\). In particular, the full vector \((D_1,\ldots,D_{n+1})\) is constrained to a hyperplane with fixed sum. It does not have an ordinary \((n+1)\)-dimensional density; the formula above is a density for \(n\) free coordinates.

Worked Examples

Worked Example: Two Uniform Observations

Let \(X_1,X_2\) be iid uniform on \((0,1)\). Here \(a=0\), \(b=1\), and \(f(x)=1\) on the interval. There are three spacings: \(D_1=X_{(1)}\), \(D_2=X_{(2)}-X_{(1)}\), and \(D_3=1-X_{(2)}\).

Use \(d_1,d_2\) as the free coordinates. The support is \(d_1>0\), \(d_2>0\), and \(d_1+d_2<1\), with \(d_3=1-d_1-d_2\). The joint density is $$ g(d_1,d_2)=2!\,f(d_1)f(d_1+d_2)=2 $$ throughout this region. Its integral is \(2\) times the triangular region's area, namely \(2(1/2)=1\), so it is normalized. The last spacing is not an extra free coordinate: choosing \(d_1,d_2\) determines it.

Worked Example: A Nonuniform Density Changes the Spacing Density

Let \(X_1,X_2\) be iid on \((0,1)\) with density \(f(x)=2x\). This is a valid density because \(\int_0^1 2x\,dx=1\). The same spacing coordinates have support \(d_1>0\), \(d_2>0\), \(d_1+d_2<1\), but the joint density is now $$ g(d_1,d_2)=2(2d_1)\bigl(2(d_1+d_2)\bigr)=8d_1(d_1+d_2). $$

Check its normalization by integrating over the support: $$ \int_0^1\int_0^{1-d_1}8d_1(d_1+d_2)\,dd_2\,dd_1 = 8\int_0^1\left(d_1^2(1-d_1)+\frac{d_1(1-d_1)^2}{2}\right)dd_1. $$ The expression in parentheses simplifies to \(\tfrac12d_1-\tfrac12d_1^3\). Thus the integral is $$ 8\left(\frac14-\frac18\right)=1. $$ The support is the same simplex as in the uniform example, but the density is not constant: larger values of the ordered observations are favored by \(f(x)=2x\).

Worked Example: A Probability From Three Uniform Spacings

Let \(X_1,X_2,X_3\) be iid uniform on \((0,1)\), and consider the probability that the first endpoint spacing exceeds one half: \(P(D_1>1/2)\). The joint density of \(D_1,D_2,D_3\) in the first three coordinates is \(3!=6\) on \(d_1,d_2,d_3>0\), \(d_1+d_2+d_3<1\); the fourth spacing is the remaining amount.

Set \(u=d_1-\tfrac12\). On the event of interest, the support becomes \(u,d_2,d_3>0\) and \(u+d_2+d_3<\tfrac12\). Its volume is $$ \int_0^{1/2}\int_0^{1/2-u}\int_0^{1/2-u-d_2} dd_3\,dd_2\,du = \int_0^{1/2}\frac{(1/2-u)^2}{2}\,du = \frac{(1/2)^3}{6} = \frac{1}{48}. $$ Multiplying by the constant density gives \(P(D_1>1/2)=6(1/48)=1/8\). The calculation uses the region's volume in three free spacing coordinates, not four.

What the Joint Density Tells Us

The spacing support is determined by geometry, while the density within that support depends on the sampling density \(f\). For a general nonuniform sample, each factor in the joint density is evaluated at a cumulative sum of gaps. This dependence on cumulative sums is why a simple gap-by-gap description does not, in general, make the spacings independent.

Finite interval endpoints matter for the two endpoint spacings in this definition. If the sampling interval is unbounded, an endpoint distance to infinity is not a finite spacing of this form. Interior differences \(X_{(i)}-X_{(i-1)}\) remain well-defined, but the finite-endpoint simplex formula must not be used without an appropriate change of setup.

Common Mistake

A tempting but incorrect argument is to treat all \(n+1\) spacings as freely chosen positive numbers and assign them a joint density with respect to ordinary \((n+1)\)-dimensional volume. This ignores their exact sum constraint. The correction is to use only \(n\) coordinates, state the condition \(\sum_{i=1}^n d_i<b-a\), and set the remaining spacing equal to \(b-a-\sum_{i=1}^n d_i\). The distinction is not cosmetic: the full spacing vector lies on a lower-dimensional hyperplane and has zero \((n+1)\)-dimensional volume.

Key takeaway: For iid observations with a density on a finite interval, spacings are positive gaps whose sum is fixed. In the first \(n\) gap coordinates, their support is a simplex, and their density is obtained by evaluating the ordered-sample density at cumulative gap sums; the Jacobian is 1.

Check Your Understanding

Answer each question by identifying both the coordinates and their support.

  1. For a sample of size \(n\) on \((a,b)\), write the expression for the final spacing in terms of \(D_1,\ldots,D_n\).
  2. Why does the joint density of the ordered sample contain the factor \(n!\) when the observations are iid and continuous?
  3. For \(n=2\), describe the support of the first two spacings and explain why \(d_1+d_2= b-a\) is not allowed.
  4. If the sample density is \(f(x)\), at what ordered-sample values is \(f\) evaluated in the spacing density?
  5. Why is it inaccurate to describe the full vector of \(n+1\) spacings as having an ordinary \((n+1)\)-dimensional density?