ArticleslgStudy

mathematics

Empirical distribution function

Empirical distribution function is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Empirical distribution function rather than just read about it. In short: In statistics, an empirical distribution function (a.k.a. an empirical cumulative distribution function, eCDF) is the distribution function associated with the empirical measure of a sample. This cumulative distribution function is a step function that jumps up by 1/n at each of the n data points.

Empirical distribution function — main illustration
Empirical distribution function — illustration

Key takeaways

  • Empirical distribution function belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Empirical distribution function to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Empirical distribution function from memory before moving on to harder problems.

Reference excerpt

In statistics, an empirical distribution function (a.k.a. an empirical cumulative distribution function, eCDF) is the distribution function associated with the empirical measure of a sample. This cumulative distribution function is a step function that jumps up by 1/n at each of the n data points. Its value at any specified value of the measured variable is the fraction of observations of the measured variable that are less than or equal to the specified value. The empirical distribution function is an estimate of the cumulative distribution function that generated the points in the sample. It converges with probability 1 to that underlying distribution, according to the Glivenko–Cantelli theorem. A number of results exist to quantify the rate of convergence of the empirical distribution function to the underlying cumulative distribution function. A simple empirical estimate is the frequency distribution.

Definition Let (X1, …, Xn) be independent, identically distributed real random variables with the common cumulative distribution function F(t). Then the empirical distribution function is defined as F^n(t)=number of elements in the sample≤tn=1n∑i=1n𝟏Xi≤t, where 𝟏A is the indicator of event A. For a fixed t, the indicator 𝟏Xi≤t is a Bernoulli random variable with parameter p = F(t); hence nF^n(t) is a binomial random variable with mean nF(t) and variance nF(t)(1 − F(t)). This implies that F^n(t) is an unbiased estimator for F(t). In some textbooks, the empirical distribution function is defined as F^n(t)=1n+1∑i=1n𝟏Xi≤t However, since the ratio (n + 1)/n approaches 1 as n goes to infinity, the asymptotic properties of the two definitions are the same.

Asymptotic properties By the strong law of large numbers, the estimator F^n(t) converges to F(t) as n → ∞ almost surely, for every value of t: F^n(t) →a.s. F(t); thus the estimator F^n(t) is consistent. This expression asserts the pointwise convergence of the empirical distribution function to the true cumulative distribution function. There is a stronger result, called the Glivenko–Cantelli theorem, which states that the convergence in fact happens uniformly over t: ‖F^n−F‖∞≡supt∈ℝ|F^n(t)−F(t)|→ 0. The sup-norm in this expression is called the Kolmogorov–Smirnov statistic for testing the goodness-of-fit between the empirical distribution F^n(t) and the assumed true cumulative distribution function F. Other norm functions may be reasonably used here instead of the sup-norm. For example, the L2-norm gives rise to the Cramér–von Mises statistic. The asymptotic distribution can be further characterized in several different ways. First, the central limit theorem states that pointwise, F^n(t) has asymptotically normal distribution with the standard n rate of convergence: n(F^n(t)−F(t)) →d 𝒩(0,F(t)(1−F(t))).

This result is extended by the Donsker’s theorem, which asserts that the empirical process n(F^n−F), viewed as a function indexed by t∈ℝ, converges in distribution in the Skorokhod space D[−∞,+∞] to the mean-zero Gaussian process GF=B∘F, where B is the standard Brownian bridge. The covariance structure of this Gaussian process is E⁡[GF(t1)GF(t2)]=F(t1∧t2)−F(t1)F(t2). The uniform rate of convergence in Donsker’s theorem can be quantified by the result known as the Hungarian embedding: lim supn→∞nln2n‖n(F^n−F)−GF,n‖∞<∞,a.s. Alternatively, the rate of convergence of n(F^n−F) can also be quantified in terms of the asymptotic behavior of the sup-norm of this expression. Number of results exist in this venue, for example the Dvoretzky–Kiefer–Wolfowitz inequality provides bound on the tail probabilities of n‖F^n−F‖∞: Pr⁡(n‖F^n−F‖∞>z)≤2e−2z2. In fact, Kolmogorov has shown that if the cumulative distribution function F is continuous, then the expression n‖F^n−F‖∞ converges in distribution to ‖B‖∞, which has the Kolmogorov distribution that does not depend on the form of F. Another result, which follows from the law of the iterated logarithm, is that lim supn→∞n2ln⁡ln⁡n‖F^n−F‖∞≤12,a.s. and lim infn→∞2nln⁡ln⁡n‖F^n−F‖∞=π2,a.s.

Confidence intervals

As per Dvoretzky–Kiefer–Wolfowitz inequality the interval that contains the true CDF, F(x), with probability 1−α is specified as Fn(x)−ε≤F(x)≤Fn(x)+ε where ε=ln⁡2α2n. As per the above bounds, we can plot the Empirical CDF, CDF and confidence intervals for different distributions by using any one of the statistical implementations.

Statistical implementation A non-exhaustive list of software implementations of Empirical Distribution function includes:

In R software, we compute an empirical cumulative distribution function, with several methods for plotting, printing and computing with such an “ecdf” object. In GNU Octave or MATLAB we can use Empirical cumulative distribution function (cdf) plot jmp from SAS, the CDF plot creates a plot of the empirical cumulative distribution function. Minitab, create an Empirical CDF Mathwave, we can fit probability distribution to our data Dataplot, we can plot Empirical CDF plot Scipy, we can use scipy.stats.ecdf Statsmodels, we can use statsmodels.distributions.empirical_distribution.ECDF Matplotlib, using the matplotlib.pyplot.ecdf function (new in version 3.8.0) Seaborn, using the seaborn.ecdfplot function Plotly, using the plotly.express.ecdf function Excel, we can plot Empirical CDF plot ArviZ, using the az.plot_dist function

See also Càdlàg functions Count data Cumulative frequency analysis Distribution fitting Dvoretzky–Kiefer–Wolfowitz inequality Empirical probability Empirical process Estimating quantiles from a sample Frequency (statistics) Empirical likelihood Kaplan–Meier estimator for censored processes Survival function Q–Q plot

References

Further reading Shorack, G.R.; Wellner, J.A. (1986). Empirical Processes with Applications to Statistics. New York: Wiley. ISBN 0-471-86725-X.

External links Media related to Empirical distribution functions at Wikimedia Commons

Illustrations

Empirical distribution function illustration
Empirical distribution function: Empirical CDF, CDF and confidence interval plots for various sample sizes of normal distribution
Empirical CDF, CDF and confidence interval plots for various sample sizes of normal distribution
Empirical distribution function: Empirical CDF, CDF and confidence interval plots for various sample sizes of Cauchy distribution
Empirical CDF, CDF and confidence interval plots for various sample sizes of Cauchy distribution
Empirical distribution function: Empirical CDF, CDF and confidence interval plots for various sample sizes of triangle distribution
Empirical CDF, CDF and confidence interval plots for various sample sizes of triangle distribution

Worked examples

Example 1 — a first encounter with Empirical distribution function

Start with the simplest possible case. Write down what Empirical distribution function claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Empirical distribution function before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Empirical distribution function ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Empirical distribution function

In research
Empirical distribution function appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Empirical distribution function in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Empirical distribution function is common in secondary-school and first-year university syllabi. It links to neighbouring topics Empirical process, Nonparametric statistics, so understanding it makes those chapters shorter.
In everyday life
Look for Empirical distribution function outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Empirical distribution function” →

How to study Empirical distribution function in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Empirical distribution function means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Empirical distribution function out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Empirical distribution function in simple terms?

In statistics, an empirical distribution function (a.k.a. an empirical cumulative distribution function, eCDF) is the distribution function associated with the empirical measure of a sample. This cumulative distribution function is a step function that jumps up by 1/n at each of the n data points.

Why does Empirical distribution function matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Empirical distribution function?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Empirical distribution function.

Tags

  • Empirical process
  • Nonparametric statistics

Keep exploring