advanced34 min studyLesson 711 in Mathematics

Empirical distributions and uniform bands

Estimate a complete cumulative distribution and distinguish a simultaneous finite-sample guarantee from a pointwise interval.

On this page

What you’ll understand

  • Construct an empirical cumulative distribution including ties.
  • Invert the one-sample DKWM inequality into a simultaneous band.
  • Interpret distribution-free coverage without imposing a density.

Estimating a distribution means answering many probability questions with the same sample. The empirical cumulative distribution records the fraction of observations below each threshold, producing a complete random function rather than one fitted parameter. Its uncertainty can be controlled uniformly over all thresholds without specifying a Gaussian family or even requiring a density. That strong conclusion still has assumptions: the observations must be independent with a common distribution, and the guarantee concerns cumulative probabilities rather than the derivative of the fitted curve.

One indicator average for every threshold

Let X1,…,XnX_1,\ldots,X_n be independent identically distributed real variables with cumulative distribution F. The empirical distribution Fn(x)F_n(x) averages the indicators of observations at or below x. It is nondecreasing and right continuous, with limits zero and one at the two infinities. Repeated observations create larger jumps; they do not invalidate the definition. At a fixed nonrandom x, the count is binomial with success probability F(x), so the estimate is unbiased and has variance F(x)(1−F(x))/n.

A pointwise law of large numbers treats one threshold at a time. It does not by itself allow an arbitrary threshold selected after inspecting the entire curve. Uniform convergence instead controls the largest discrepancy anywhere on the real line. The Glivenko–Cantelli theorem gives almost-sure uniform convergence for this empirical distribution. Its applicability to arbitrary real distributions is a feature of the ordered threshold class; it is not a statement that every unrestricted family of measurable sets has a uniform law.

Fn(x)=1n∑i=1n1{Xi≤x},Var⁡(Fn(x))=F(x)(1−F(x))nF_n(x)=\frac1n\sum_{i=1}^n\mathbf1\{X_i\le x\},\qquad \operatorname{Var}(F_n(x))=\frac{F(x)(1-F(x))}{n}
The variance identity is pointwise at a fixed threshold; the same observations generate the whole empirical curve.↔ Scroll wide equations horizontally.

A tail inequality controls the whole curve

The one-sample Dvoretzky–Kiefer–Wolfowitz inequality with Massart's constant bounds the probability that sup⁡x∣Fn(x)−F(x)∣\sup_x|F_n(x)-F(x)| exceeds ε by 2e−2nε22e^{-2n\varepsilon^2}. This finite-sample inequality holds for every real distribution F, including distributions with atoms. Continuity is needed for some exact Kolmogorov-statistic null distributions, but not for this upper bound. The result is stronger than applying one binomial interval and repeating its confidence label at every threshold.

Choose a failure probability alpha strictly between zero and one, solve the exponential bound for epsilon, and clip the resulting lower and upper curves to the probability range. With probability at least one minus alpha, every true cumulative probability is inside its interval simultaneously. The coverage probability is over repeated samples; once data are observed, it is not a posterior probability assigned to the fixed unknown distribution. The inequality can be conservative, especially at small sample sizes, and a radius exceeding one yields little information.

Pr⁡F ⁣(sup⁡x∣Fn(x)−F(x)∣>ε)≤2e−2nε2,εn,α=log⁡(2/α)2n\Pr_F\!\left(\sup_x|F_n(x)-F(x)|>\varepsilon\right)\le2e^{-2n\varepsilon^2},\qquad \varepsilon_{n,\alpha}=\sqrt{\frac{\log(2/\alpha)}{2n}}
Clipping F_n minus/plus this radius to [0,1] gives a band with simultaneous coverage at least 1−alpha, uniformly over F.↔ Scroll wide equations horizontally.

What the band permits and what it does not

A simultaneous band remains valid at thresholds chosen from the data because its coverage event already includes all thresholds. It can also be inverted into conservative quantile statements using generalized inverses, with care at jumps and probability endpoints. For an interval probability, subtracting two cumulative bounds gives a valid bound after accounting for the correct endpoint convention. These transformations use monotonicity and the common uniform event, rather than assuming separate threshold errors are independent.

Neither the empirical curve nor its uniform band supplies a density band by differentiation. The empirical distribution is a step function, and differentiation is unstable in the uniform norm without additional regularity. Dependence, changing sampling distributions, selection bias, and censoring also require different arguments. A histogram of a correlated time series does not inherit this iid guarantee merely because its bins resemble an empirical distribution. Before calculating a confidence label, identify the sampling unit and the probability function being estimated.

A threshold selected after plotting

An iid sample has n=200 observations and 124 lie at or below a displayed threshold. Construct the 95% DKWM band at this threshold and explain why selecting that threshold after plotting does not break the simultaneous guarantee.

  1. The empirical cumulative probability is 124/200=0.62. Use alpha=0.05, so the uniform radius is sqrt(log(40)/400), approximately 0.0960323.

  2. Subtracting and adding the radius gives approximately [0.523968,0.716032]. No clipping is needed at this threshold. The same radius applies along the entire empirical curve, although clipping may matter elsewhere.

  3. The event controlling the supremum implies coverage at every threshold at once, including a threshold chosen from this plot. This does not justify choosing a different sampling plan after seeing the result or replacing the cumulative target by a density.

The result

The displayed interval is one cross-section of a 95% simultaneous band, not a collection of independently calibrated 95% intervals.

Explore the model

Interactive lab

Interactive lab · sampling

Pointwise indicator variability

Pause and Reset, then set both controls to p=0.5 and n=25; predict mean 0.5 and variance 0.01 for the indicator average. Reset and set p=0.5 and n=100; predict variance 0.0025. The exact binomial bars describe one fixed threshold. Playback highlights possible outcomes without drawing random samples, and the instrument does not calculate a supremum or a DKWM band.

Pointwise indicator variabilityExact binomial masses for the mean of n independent Bernoulli trials, compared with normal mass between adjacent half-count boundaries; normal tails outside the finite support remain outside the bars. Playback highlights outcomes, not random samples. The Berry–Esseen bound applies to standardized CDFs, not individual bars or continuity-corrected errors. At p = 0 or 1, normal comparison and that bound are disabled. Normal-CDF evaluation uses a numerical approximation with absolute error below 7.5×10⁻⁸ (at most 1.5×10⁻⁷ per interval, before rounding). Current readings: Mean sample proportion: 0.5; Sample-mean variance: 0.0125; Uniform CDF error bound: ≤ 0.1062. All parameters are adjustable with the labeled controls below.Exact distribution of the mean of 20 independent Bernoulli variables with success probability 0.5; playback highlights outcome 0.00.250.50.75100.0580.1150.1730.23Sample mean · k / nProbability massNormal bin masses are an approximationk = 0 · exact probability = 9.54e-7
Exact binomial massNormal interval massHighlighted outcome / mean
Mean sample proportion
0.5
Sample-mean variance
0.0125
Uniform CDF error bound
≤ 0.1062
t = 0 s

Exact binomial masses for the mean of n independent Bernoulli trials, compared with normal mass between adjacent half-count boundaries; normal tails outside the finite support remain outside the bars. Playback highlights outcomes, not random samples. The Berry–Esseen bound applies to standardized CDFs, not individual bars or continuity-corrected errors. At p = 0 or 1, normal comparison and that bound are disabled. Normal-CDF evaluation uses a numerical approximation with absolute error below 7.5×10⁻⁸ (at most 1.5×10⁻⁷ per interval, before rounding). Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forA fixed-threshold binomial model explains local variability; simultaneous control needs an additional uniform theorem.

Check your understanding

Which assumption is unnecessary for the one-sample DKWM upper bound used here?

Try it yourself

Choose the smallest integer sample size guaranteeing a DKWM radius at most 0.05 at confidence 95%, without using a density assumption.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Square the radius inequality and isolate n before rounding. A guarantee requires rounding upward.

Compare with the solution

The condition is n≥log(40)/(2×0.05²)=737.77589..., so n=738 suffices and 737 does not meet this bound. This is a sufficient sample size from the exponential inequality, not a claim that every smaller sample necessarily has inadequate actual coverage. The calculation applies uniformly over real cumulative distributions under iid sampling.

Take it with you

  • An empirical distribution is a random cumulative function, including when observations tie.
  • DKWM gives simultaneous finite-sample coverage over every threshold.
  • Uniform cumulative control does not automatically control a density or repair non-iid sampling.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.