Tutorials › Statistical Theory I - Probability and Distribution Theory › Spacings from General Continuous Samples

Ranks, Spacings, and Empirical Laws · Tutorial 482 of 994

Spacings from General Continuous Samples

Use the probability integral transform to find the distribution of ordered observations on the probability scale and calculate their gaps.

Advanced 10 min read

What You'll Learn

  • Apply the probability integral transform to a continuous CDF, including when it is not strictly increasing.
  • Relate transformed sample order statistics to uniform order statistics.
  • Define boundary and interior gaps on the probability scale.
  • Derive the joint Dirichlet distribution of the gaps.
  • Calculate probability-scale gaps for exponential, quadratic-CDF, and normal examples.
  • Distinguish CDF increments from differences between observed values.

From Observations to Probability-Scale Spacings

The numerical distance between two observations does not by itself tell us how much probability lies between them. For a distribution with a rapidly changing density in one region and a slowly changing density in another, equal-length intervals can contain very different probabilities. The cumulative distribution function provides a common scale: the difference \(F(b)-F(a)\) is the probability assigned to \((a,b]\).

For an independent sample from a continuous distribution, applying its CDF to each observation gives a uniform sample. Ordering those transformed values therefore gives uniform order statistics, and the gaps between them have a distribution that does not depend on the original continuous distribution. These are probability-scale spacings; they are generally not the same as the gaps between the original observations.

Definition: Let \(X_1,\ldots,X_n\) be independent and identically distributed with continuous CDF \(F\), and write \(X_{(1)}\le\cdots\le X_{(n)}\) for their order statistics. The probability-scale order statistics are \(F(X_{(1)}),\ldots,F(X_{(n)})\). Define their \(n+1\) spacings by $$ D_1=F(X_{(1)}),\qquad D_i=F(X_{(i)})-F(X_{(i-1)})\ \ (2\le i\le n),\qquad D_{n+1}=1-F(X_{(n)}). $$ They are nonnegative and sum to one.

The first and last spacings measure probability before the sample minimum and after the sample maximum. Each interior spacing measures the probability between two adjacent order statistics. In particular, \(D_i\) is a CDF increment, not the raw difference \(X_{(i)}-X_{(i-1)}\).

Why the Probability Integral Transform Works

The probability integral transform states that \(F(X)\) is uniform on \((0,1)\) when \(X\) has a continuous CDF \(F\). Strict increase of \(F\) is not required. A continuous CDF can be constant over intervals, but these intervals have probability zero under the distribution, so they do not disrupt the transform.

Theorem: If \(X\) has continuous CDF \(F\), then \(U=F(X)\) has the uniform distribution on \((0,1)\).

Proof. Fix \(u\) with \(0<u<1\), and set \(b=\sup\{x:F(x)\le u\}\). Because \(F(x)\) tends to 0 as \(x\) tends to \(-\infty\) and to 1 as \(x\) tends to \(+\infty\), this supremum is finite, and the set is nonempty. Monotonicity and continuity imply that \(\{x:F(x)\le u\}=(-\infty,b]\) and \(F(b)=u\). Indeed, if \(F(b)<u\), continuity would make \(F(x)\le u\) for some \(x>b\), contradicting the definition of \(b\). Therefore

$$ P(F(X)\le u)=P(X\le b)=F(b)=u. $$

This is the uniform CDF for \(0<u<1\). At \(u=0\) the probability is 0, as follows by taking \(u\) down to 0; at \(u=1\) it is 1. Thus \(F(X)\sim\operatorname{Uniform}(0,1)\). \(\square\)

Now apply this result separately to each observation: \(F(X_1),\ldots,F(X_n)\) are independent uniform random variables, because the \(X_j\) are independent and each transform is a function of its own observation. Since \(F\) is nondecreasing, sorting the observations also sorts their transformed values. Consequently, \(F(X_{(i)})\) is the \(i\)th order statistic in an independent uniform sample.

Worked Example: Exponential Observations and Their Probability Gaps

Suppose \(X_1,\ldots,X_3\) are sampled from an exponential distribution with rate 1, whose CDF is \(F(x)=1-e^{-x}\) for \(x\ge0\). For a realized ordered sample \(X_{(1)}=0.2\), \(X_{(2)}=0.7\), \(X_{(3)}=1.6\), calculate all four probability-scale spacings.

The CDF values are \(F(0.2)=1-e^{-0.2}\), \(F(0.7)=1-e^{-0.7}\), and \(F(1.6)=1-e^{-1.6}\). Thus the spacings, calculated from the unrounded expressions, are

$$ \begin{aligned} D_1&=1-e^{-0.2}=0.181269247\ldots,\\ D_2&=(1-e^{-0.7})-(1-e^{-0.2}) =e^{-0.2}-e^{-0.7}=0.322145449\ldots,\\ D_3&=(1-e^{-1.6})-(1-e^{-0.7}) =e^{-0.7}-e^{-1.6}=0.294688786\ldots,\\ D_4&=1-(1-e^{-1.6})=e^{-1.6}=0.201896518\ldots. \end{aligned} $$

To six decimal places these are \(0.181269,\ 0.322145,\ 0.294689,\ 0.201897\). Their rounded values sum to \(1.000000\). The raw gaps are \(0.2,\ 0.5,\ 0.9\) between successive boundaries in the observed scale, but those are not the probability-scale spacings.

The Joint Law of the Spacings

Because the transformed observations are independent uniform random variables, their order statistics have joint density \(n!\) on the region \(0<u_1<\cdots<u_n<1\). To see the factor \(n!\), away from ties any ordered vector can arise from exactly \(n!\) permutations of the original uniform observations, each with joint density 1. The ties have probability zero.

Theorem: Under the conditions above, the spacing vector \((D_1,\ldots,D_{n+1})\) has a Dirichlet distribution with all parameters equal to 1: $$ (D_1,\ldots,D_{n+1})\sim\operatorname{Dirichlet}(1,\ldots,1). $$ Equivalently, its density with respect to \(d_1,\ldots,d_n\) is \(n!\) on \(d_j>0\) with \(\sum_{j=1}^n d_j<1\), where \(d_{n+1}=1-\sum_{j=1}^n d_j\), and is zero elsewhere.

Proof. Write \(u_i=F(X_{(i)})\). In terms of the spacings,

$$ u_1=d_1,\quad u_2=d_1+d_2,\quad\ldots,\quad u_n=d_1+\cdots+d_n. $$

The transformation from \((d_1,\ldots,d_n)\) to \((u_1,\ldots,u_n)\) is triangular with diagonal entries 1, so its Jacobian determinant is 1. The ordered uniform vector has density \(n!\) on \(0<u_1<\cdots<u_n<1\). Under this transformation that region becomes \(d_j>0\) and \(\sum_{j=1}^n d_j<1\); the remaining spacing is \(d_{n+1}=1-\sum_{j=1}^n d_j>0\). The change-of-variables formula therefore gives density \(n!\) on the stated simplex. This is precisely the Dirichlet density with parameters all equal to 1. \(\square\)

The law is distribution-free: it is the same for every continuous \(F\). For example, all \(n+1\) spacings have the same mean. Their joint law is unchanged by permuting their coordinates, and because they sum to one, the common expectation must be \(1/(n+1)\). This statement concerns probability-scale gaps; it does not say that the raw gaps in the original units have equal means or identical distributions.

Worked Example: A Quadratic CDF and a Spacing Probability

Let \(X_1,X_2,X_3\) have CDF \(F(x)=x^2\) for \(0\le x\le1\), with \(F(x)=0\) below 0 and \(F(x)=1\) above 1. For a realized ordered sample \(0.2,0.5,0.9\), find the probability-scale spacings. Then calculate the probability that the second spacing endpoint satisfies \(F(X_{(2)})\le0.5\).

The CDF values are \(0.2^2=0.04\), \(0.5^2=0.25\), and \(0.9^2=0.81\). Including the boundary values 0 and 1 gives

$$ (D_1,D_2,D_3,D_4) =(0.04,\ 0.25-0.04,\ 0.81-0.25,\ 1-0.81) =(0.04,\ 0.21,\ 0.56,\ 0.19). $$

The spacings sum to \(0.04+0.21+0.56+0.19=1\). For the probability question, \(F(X_{(2)})\) is the second order statistic of three independent uniforms. The event that this value is at most \(0.5\) occurs exactly when at least two of the three uniforms are at most \(0.5\). Independence gives

$$ P(F(X_{(2)})\le0.5) ={3\choose2}(0.5)^2(0.5)+(0.5)^3 =\frac{3}{8}+\frac{1}{8} =\frac{1}{2}. $$

This probability is the same for any continuous sampling distribution; the quadratic CDF affects the conversion back to the original measurement scale, not the uniform probability-scale law.

Worked Example: Normal Data and the Difference Between Scales

Suppose two ordered observations from \(N(0,1)\) are \(-1\) and \(1\). Using the standard normal CDF values \(\Phi(-1)=0.158655254\) and \(\Phi(1)=0.841344746\), calculate the three probability-scale spacings.

The lower boundary spacing is \(\Phi(-1)=0.158655254\). The interior spacing is

$$ \Phi(1)-\Phi(-1) =0.841344746-0.158655254 =0.682689492. $$

The upper boundary spacing is \(1-\Phi(1)=0.158655254\). Hence the spacing vector is approximately \((0.158655,\ 0.682689,\ 0.158655)\), which sums to 1 before rounding. The observed interior gap is \(1-(-1)=2\), whereas its probability-scale gap is about \(0.683\). The latter is the probability of falling between the two observations for a new draw from the same normal distribution.

Interpreting and Using Probability-Scale Gaps

For adjacent sample order statistics \(X_{(i-1)}\) and \(X_{(i)}\), the interior spacing is

$$ D_i=F(X_{(i)})-F(X_{(i-1)}) =P\bigl(X_{(i-1)}<X\le X_{(i)}\mid X_{(i-1)},X_{(i)}\bigr), $$

where the probability on the right is for a new draw \(X\) from the same distribution, treating the observed endpoints as fixed. Continuity makes the choice of including or excluding an endpoint immaterial to this probability. The spacing is therefore an interval probability, not a length in the units of \(X\).

If \(F\) has a density \(f\), then for finite adjacent endpoints \(a<b\), the corresponding increment can also be written \(\int_a^b f(x)\,dx\). When a density is larger between the endpoints, a given raw interval length can account for a larger probability gap. For a strictly increasing CDF with inverse \(F^{-1}\), raw order-statistic gaps can be recovered from the uniform order statistics as differences such as \(F^{-1}(U_{(i)})-F^{-1}(U_{(i-1)})\); their distribution consequently depends on \(F^{-1}\), even though the uniform spacings do not depend on \(F\).

Key takeaway: For an independent sample from any continuous CDF, transforming the order statistics by \(F\) produces uniform order statistics. Their boundary and interior CDF increments sum to one and have the \(\operatorname{Dirichlet}(1,\ldots,1)\) law. Raw gaps and probability-scale gaps answer different questions.

Common Mistake

A frequent error is to calculate a probability-scale gap as \(F(X_{(i)}-X_{(i-1)})\). This applies the CDF to the length of the interval rather than subtracting the CDF values at its endpoints. The correct calculation is \(F(X_{(i)})-F(X_{(i-1)})\). For the exponential example, the interior gap between \(0.2\) and \(0.7\) is \(e^{-0.2}-e^{-0.7}\), not \(F(0.5)\). Also, when computing decimal values, subtract the unrounded CDF expressions first and round only the final gap; subtracting already rounded CDF values can change the last reported digit.

Check Your Understanding

Answer each question using the distinction between the observation scale and the probability scale.

  1. State the probability integral transform for a continuous CDF, and explain why strict increase of the CDF is not needed.
  2. For \(n\) observations, how many probability-scale spacings are there, and what is their sum?
  3. If two adjacent ordered observations are \(a\) and \(b\), write their probability-scale gap and explain its interpretation.
  4. What is the joint distribution of all \(n+1\) probability-scale spacings from a continuous sample?
  5. Why does a distribution-free law for probability-scale gaps not imply that raw gaps have the same law for every continuous distribution?