Statistics & Probability / Empirical CDF & DKW Bound
FREE TO EXPLORE
LABORATORY 03 · STATISTICS & PROBABILITY

Empirical Cumulative Distribution Function and Dvoretzky–Kiefer–Wolfowitz Inequality

Construct the empirical cumulative distribution function (ECDF), verify the Glivenko-Cantelli theorem, and establish non-parametric confidence bands using the Dvoretzky–Kiefer–Wolfowitz (DKW) inequality. Explore interactive statistical sampling, probability models, and empirical regression.

SAMPLE · INFER · CONVERGE

Your virtual statistics laboratory.

DKW BAND HALF-WIDTH Ε_N—
SAMPLING TELEMETRY

Ready to sample with Sample Size N = 25.0.

25.0 samples
Confidence level 1 - α = 0.95 (Massart tight constant C = 2)

Adjust Sample Size N, then execute statistical trial.

Probabilistic samples are evaluated rigorously using 64-bit IEEE 754 precision. Residuals reflect ordinary least-squares regression across successive observations. Continuous data structures support high-fidelity empirical probability functions.

Statistical assumptions and distribution limits

DKW confidence bands are conservative in the distribution tails where F(x)(1 - F(x)) approaches zero, where local variance is much smaller than 1/4. The empirical regression of ln(ε_N) versus ln(N) yields a gradient of m = -0.5000, confirming the theoretical N^(-1/2) square-root rate with R² = 1.000000.

Statistical tools & sampling modules.

Empirical Step Function Generator

Sorts sample points X_{(1)} ≤ ... ≤ X_{(N)} and constructs right-continuous step function F_N(x) = (1/N) ∑ 1_{X_i ≤ x}.

Glivenko-Cantelli Supremum Meter

Evaluates the uniform Kolmogorov distance D_N = sup_x |F_N(x) - F(x)| between sample ECDF and true CDF.

DKW Confidence Band Calculator

Applies the Massart-tightened Dvoretzky-Kiefer-Wolfowitz bound to construct simultaneous confidence bands F_N(x) ± ε_N.

Kolmogorov-Smirnov Statistic Engine

Computes exact one-sample and two-sample KS test statistics and corresponding p-values under the Brownian bridge limit.

Quantile Inversion Resolver

Inverts the empirical distribution function to estimate sample quantiles Q(p) = inf{x: F_N(x) ≥ p}.

Power-Law Regression Compiler

Performs linear regression on ln(ε_N) versus ln(N) to verify theoretical N^(-1/2) scaling.

FOLLOW THE METHOD

A reason behind every step.

Construct the empirical cumulative distribution function (ECDF), verify the Glivenko-Cantelli theorem, and establish non-parametric confidence bands using the Dvoretzky–Kiefer–Wolfowitz (DKW) inequality. Standardized parameter settings: 25.0, 50.0, 100.0, 200.0, 400.0, 800.0 samples.

01

Generate Random Sample Array

Draw an initial sample of size N = 25 from a standard normal distribution N(0, 1) and sort the sample array in ascending order to establish order statistics.

02

Construct the Empirical Cumulative Distribution Function

Evaluate the empirical step function F_N(x) across a fine grid of 1,000 points spanning x ∈ [-3.5, +3.5], noting steps of magnitude 1/N at each data point.

03

Compute the DKW Confidence Band Half-Width

Set confidence level 1 - α = 0.95 and calculate the DKW critical half-width ε_N = √[ln(2/α) / (2N)] = √[ln(40) / (2 · 25)] = 0.2716.

04

Construct Simultaneous Non-Parametric Envelope

Overlay upper bound U(x) = min(1, F_N(x) + ε_N) and lower bound L(x) = max(0, F_N(x) - ε_N), verifying that the true distribution function F(x) lies entirely within the envelope.

05

Step Through Geometric Sample Sizes N = 25 to 800

Iterate sample sizes across N ∈ {25, 50, 100, 200, 400, 800}, measuring the uniform constriction of the confidence band envelope.

06

Perform Log-Log Regression on Band Half-Width

Fit a linear regression model to the coordinates (x = ln(N), y = ln(ε_N)). Confirm that the empirical gradient m = -0.5000 validates the N^(-1/2) square-root rate.

YOUR NOTEBOOK · 0 OBSERVATIONS

Turn measurements into empirical insight.

See a complete example report ↗

Points are your recorded observations. The solid regression line validates Empirical CDF & DKW Bound mathematical scaling.

LINEAR REGRESSION FIT · y = mx + b
ln(ε_N) = -0.5000 · ln(N) + 1.2000
#Sample Size N (samples)DKW Band Half-Width ε_N (margin)Natural Log of Sample Size ln(N)Natural Log of Band Half-Width ln(ε_N)Remove

No readings yet. Execute a statistical trial and record it.

Calculate it yourself.

CHECK YOUR UNDERSTANDING

Explain what the statistical metrics mean.

Which theorem establishes that the ECDF converges uniformly almost surely to the true CDF?

In the DKW inequality with Massart's tight constant, what is the value of C in P(D_N > ε) ≤ C exp(-2Nε^2)?

How does the half-width ε_N of the DKW confidence band scale with sample size N?

Why is the Kolmogorov-Smirnov test distribution-free for continuous null distributions?