For an empirical distribution function and a specified cumulative distribution function , the one-sample Kolmogorov-Smirnov statistic is their Kolmogorov distance:
The displayed sum uses an indicator function. With this convention, is right-continuous. For distinct observations, its value and its left one-sided limit at the th order statistic are and .
For continuous , both jump sides matter. Define the two directional discrepancies by
Thus uses the empirical distribution function immediately after a jump, and uses its left one-sided limit.[ref] A supremum need not be attained.
For , on , and the stipulated order statistics , the complete calculation is
The last two columns give the signed directional gaps: , , and . In contrast, checking only gives and misses the largest gap approached as . At itself, the gap has already fallen to .
Figure 1.
Both jump sides determine the exact Kolmogorov-Smirnov statistic
. The empirical distribution function for four stipulated rational observations is compared with the uniform distribution on . Open circles show left one-sided limits; filled circles show values at jumps. The green gap is and the magenta gap is the limiting . Details.
The finite formula follows from the behavior between jumps: the empirical distribution function is constant and the cumulative distribution function is monotone, so the largest directional gaps occur at the two interval ends, possibly as one-sided limits. The two tails introduce no larger gap. Checking every jump side therefore gives the exact supremum.
A common normalized Kolmogorov-Smirnov statistic is , which equals in this example. Its large-sample reference law comes from the Kolmogorov-Smirnov theorem. The unscaled remains the largest difference of cumulative probabilities, not a p-value.
There is a useful exact exception to the usual warning about fitting statistical parameters. Suppose independent and identically distributed observations have the uniform distribution on with unknown . Let and let be the label of its almost surely unique maximizing observation. Conditional on and , the surviving labelled observations are independent with the uniform distribution on ; after division by they are independent and identically distributed uniforms on . These are conditional distributions defined by probability density functions, since the event has probability zero.
To check this, the joint probability density function of and is for . Dividing the original joint probability density function by this factor gives the conditional survivor probability density function
This factorization proves the claimed conditional independence; scaling removes . Keep the surviving labels in a fixed order, or apply an independent random permutation. The sorted survivors instead have the joint law of uniform order statistics and exhibit statistical dependence; sorting does not affect their empirical distribution function. Delete the maximum itself, which would otherwise become a forced value , and compute the Kolmogorov-Smirnov statistic using sample size and jump heights . This gives an exact conditional Kolmogorov-Smirnov test under the uniform-endpoint statistical model. It does not justify fitting an arbitrary endpoint or other statistical parameters and using the ordinary -sample calibration.
Nearest neighbour density estimation Created 2026-10-05 Updated 2026-10-07
In one dimension, a nearest neighbour density estimator is . It uses the nearest neighbour distance to select an interval containing a fixed number of observations. The factor corresponds to the exact expected value of the associated uniform order statistic.
Order statistic Created 2026-09-24 Updated 2026-10-14
An order statistic is a value selected by its position in a sorted statistical sample. For real observations , write
The th order statistic is the th smallest value, counting repeated values separately. The parentheses distinguish sorted position from the original observation label: and need not be equal. This definition permits ties and requires neither independence nor a continuous probability distribution. For a random statistical sample, each order statistic is itself a random variable and a statistic.
For example, the five fixed observations
sort to
Their original indices in sorted order are , so . Their ranks of observations, listed in original observation order, are . Here is the minimum, is the sample maximum, and is the sample median. These are deliberately chosen observations, rather than simulated draws.
Figure 1.
Five observations: original indices, sorted positions, and the third order statistic
. Details.
Order statistics put extremes and typical values in one language: the first and last locate the minimum and sample maximum, while intermediate positions give sample quantiles and the sample median. Under the existing generalized-inverse convention, the sample quantile at level is . For the five observations, the sample quantiles at are . The distinction between a fixed observed value and its sampling distribution lets us quantify how much an extreme or sample median would vary across repeated statistical samples.
The useful counting identity is
For independent and identically distributed random variables with a continuous cumulative distribution function , the count on the right has binomial distribution with parameters , giving
This cumulative distribution function is a binomial distribution tail: a question about sorting becomes a question about counting successes in Bernoulli trials. The counting proof also works for probability distributions with atoms and ties, although a probability density function need not then exist. For a uniform order statistic, on , which makes the formula particularly explicit.
First prove the concentration statement with its correct scale. Let , the th uniform order statistic. The number of sample points at most is . Therefore means , and means , up to probability-zero ties. Take and . Applying Chernoff bounds at gives, for an absolute and sufficiently large ,
When the upper endpoint exceeds one its upper-tail event is empty. A union bound makes the total failure probability for all at most . On this event,
where integral comparison gives .
The first vertex block has right endpoint and always contains , so its initial chord contributes vertex degree two. All its other endpoints are those with that fall below . Conditional on the right endpoints, these events are independent with probabilities . Thus
The fewer than early summands contribute at most to this conditional mean. For the rest, the uniform estimate and uniform tightness of give
To control the actual fluctuations without assuming unconditional independence, restrict to the concentration event and . Then . Conditional Chebyshev inequality bounds the probability of a deviation exceeding by . The discarded endpoint event has limiting probability ; let . Therefore
Since has a continuous distribution, the corrected first-vertex degree in the LCD model tail is
This disproves the printed exponent for . The hint's factor is independently contradicted at : its proposed upper bound tends to , whereas
Thus the printed concentration event has probability tending to zero, not one. Replacing its by leads to the proven exponent . The exponent would instead arise for , but then the graph has vertices and the part (b) endpoint limit at becomes . It cannot repair all the printed claims with one convention. The literal part (c) is false for the named model; the full corrected limit and the source of the discrepancy are established above.
A sufficient statistic is a function of the sample whose conditional sample distribution, given that statistic, does not depend on the parameter. The factorization criterion for sufficiency states, for a dominated family, that is sufficient exactly when the joint density has form , where is independent of .
Let and . The joint uniform density is
so is sufficient for by the factorization criterion for sufficiency. The uniform order statistics have expectations
For example, the standardized minimum has survival probability on , whose integral is ; the maximum follows by reflection. Solving these expectation equations gives the unbiased estimator
The assumption makes the denominator positive.
Put for . This is the quantile function, rather than an ordinary inverse requiring strict increase. The limits of the distribution function at infinity make finite, and the fact that is a right-continuous function ensures . Consequently
Increasing shrinks the set in the infimum, so the quantile function is a monotone function. To prove the left continuity of the quantile function, fix and let . If , choose . Then , so some satisfies , a contradiction. Thus as . At a flat stretch of the distribution function, the quantile function may jump immediately to the right, consistent with this left-continuous convention.
For the uniform order statistic, count the observations at most . That count has the binomial distribution with parameters , giving
Differentiating makes adjacent terms telescope: use and . The probability density function is therefore
In particular, has the Beta distribution with parameters .
Write for the specified median. Continuity of the distribution function gives and no mass at , even if the distribution function has a flat stretch there. Thus has the binomial distribution with parameters . Except on a null event, the order-statistic confidence interval for a median covers exactly when . Symmetry of the binomial distribution makes its two failure probabilities equal. Alternatively, the probability integral transform gives
Hence the coverage is exactly , with
The asymmetric open/closed endpoint convention does not change the coverage because the continuous probability distribution assigns no mass to the median.
An exact finite mixture model follows from the binomial theorem:
Define positive mixture weights
Here is the Beta function, so the component probability distributions are . All coefficients are computable from the observed integer counts.
Use inverse transform sampling with the supplied to choose : writing and , take . Then recycle its position inside that interval,
Recycling a uniform random variable after discrete sampling makes uniform independently of , since . It is also independent of all supplied random variables with gamma distributions. Transform these by the probability integral transform:
They are independent random variables with uniform distributions because has a unit-rate exponential distribution.
Conditional on , put and . Form the values and return their th order statistic. This uses at most the supplied random variables with gamma distributions, since . The uniform order statistic formula gives
Averaging these component probability density functions with weights recovers exactly the normalized posterior density. Unused inputs can be discarded. When , , , and the output is , as required. Interval endpoints and ties have probability zero; any consistent convention there is harmless. Exactness here concerns the mathematical algorithm; finite-precision arithmetic can be stabilized with logarithmic mixture weights.
Assume the zero set is measurable, as is ensured by measurability of . This is an implicit necessary hypothesis: for an arbitrary real function the printed integral and event need not be measurable. Put . Conditional on , the uniform order statistics description makes the probability of no jump in equal to . Averaging over the Poisson distribution gives
Consequently
In particular a measure-zero zero set is almost surely missed, despite possibly containing infinitely many points.
For , the nearest neighbour distance is the th order statistic of . Each has continuous distribution function on . The probability integral transform makes independent and identically distributed random variables with the uniform distribution on . Monotonicity of gives , a uniform order statistic. Strict monotonicity is not needed at this stage.
For , counting observations below gives
Differentiating and cancelling consecutive terms gives the Beta distribution:
The Gamma function identity identifies this with the stated normalization. Ratios of Beta function integrals yield the moments
This is the probability content of a nearest neighbour ball identity, specialized to intervals on the real line.
Now write . The Lipschitz bound gives
Thus
Strict positivity of the probability density function makes continuous and strictly increasing from zero to one, so its inverse function is defined for every .
For the requested conditional calculation, suppose . At the preceding bound gives
Therefore , and substituting in the approximation proves the inverse probability content bound for a Lipschitz density:
The same argument works, without , on the meaningful local range with .
Since the nearest neighbour density estimator obeys , its conditional bound follows from the Beta distribution moments:
Hence, under the printed location condition,
The conditional inverse function bound also bounds , so the expected value in this calculation is finite under those formal hypotheses.
There is, however, a genuine flaw in the original PDF: the printed condition has no admissible points when is strictly positive on all of . A probability density function on all of cannot have Lipschitz constant zero, so . Its Lipschitz bound forces
Integrating this triangular lower envelope gives the Lipschitz density height bound
The inequality is strict because the probability density function has positive mass outside the finite interval. Thus everywhere. The last two conditional conclusions above are valid implications but vacuous as printed. Dropping strict positivity gives only , with equality forcing the entire probability density function to be the normalized triangular envelope. The local inverse bound does not justify replacing the printed condition by its reverse in the final expected value bound, since ranges over all of .
For a cumulative distribution function , its quantile function is the generalized inverse
with the infimum allowed to be . For observations , the empirical distribution function is
If are the order statistics, then
The Bennett inequality says that if are independent, , almost surely, and , then
To prove it, convexity of on , followed by the power-series bound for centered , gives
Independence and the Chernoff bound therefore yield
The minimizing value satisfies , namely . Substitution gives the stated exponent.
For independent , the uniform order statistic satisfies
Set . The event means that at least sample points lie in . If this occurs, some -element subset consists entirely of such points. The union bound gives
This is exactly the required inequality for .
Pair linearly ordered endpoints uniformly. Each pair is a chord; its larger endpoint ends a vertex block, with all endpoints after the previous right endpoint merged into that vertex. Orient the chord from its right-endpoint block to its left-endpoint block. Removing the last endpoint and its mate leaves a uniform smaller pairing. Reinserting the mate into one of equally likely gaps chooses an existing block proportionally to its endpoint count, or the final gap creates a self-loop. This proves equivalence with the linearized chord diagram model.
An equivalent continuous representation draws independent pairs of independent uniform points on , orders the pairs by their maxima , and calls their minima . The are uniform order statistics; conditional on all the , the are independent uniform points on .
Uniform order statistic Created 2026-09-28 Updated 2026-10-14
For independent and identically distributed random variables with the continuous uniform distribution on , the th order statistic has Beta distribution
Its probability density function, mean, and variance are
The probability density function is zero outside ; values assigned to its endpoints do not change any probability. Peter Kempthorne's MIT lecture notes derive the uniform order statistic law and these moments. [ref].
For , the minimum, sample median, and sample maximum correspond to . Their probability density functions are , , and , respectively. The sample median therefore has Beta distribution , mean , and variance . Its cumulative distribution function is
For instance, . The mean of the minimum is , and the mean of the sample maximum is . The fixed observed sample median in the order statistic example is one possible outcome; is the average over repeated statistical samples from this uniform distribution.
Figure 1.
Minimum, median, and maximum densities for five independent uniform observations
. Details.
Each curve has area one. The extreme order statistics favor the ends, while the sample median favors the center. The endpoint density height is legitimate: the probability density function gives area per unit length, rather than point probability. In particular, a continuous uniform distribution has zero probability of producing an endpoint.
For a short proof, the binomial distribution counting identity under order statistic gives . Taking its derivative cancels consecutive terms, leaving the displayed probability density function. Recognize its normalizing factorial coefficient as that of the Beta distribution, then substitute , into the Beta distribution mean and variance formulas. Although the original observations are independent, their order statistics generally are dependent; see the positive covariance of two uniform order statistics.