Empirical distribution function explained

See also: Frequency distribution.

In statistics, an empirical distribution function (commonly also called an empirical cumulative distribution function, eCDF) is the distribution function associated with the empirical measure of a sample.[1] This cumulative distribution function is a step function that jumps up by at each of the 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.

Definition

Let be independent, identically distributed real random variables with the common cumulative distribution function . Then the empirical distribution function is defined as[2]

\widehatFn(t)=

numberofelementsinthesample\leqt
n

=

1
n
n
\sum
i=1
1
Xi\let

,

where \mathbf_ is the indicator of event . For a fixed, the indicator \mathbf_ is a Bernoulli random variable with parameter ; hence n \widehat F_n(t) is a binomial random variable with mean and variance . This implies that \widehat F_n(t) is an unbiased estimator for .

However, in some textbooks, the definition is given as

\widehatFn(t)=

1
n+1
n
\sum
i=1
1
Xi\let
[3] [4]

Asymptotic properties

Since the ratio approaches 1 as goes to infinity, the asymptotic properties of the two definitions that are given above are the same.

By the strong law of large numbers, the estimator \scriptstyle\widehat_n(t) converges to as almost surely, for every value of :

\widehatFn(t)\xrightarrow{a.s.

}\ F(t); thus the estimator \scriptstyle\widehat_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 :[5]

\|\widehatFn-F\|infty\equiv \supt\inR|\widehatFn(t)-F(t)|\xrightarrow{} 0.

The sup-norm in this expression is called the Kolmogorov–Smirnov statistic for testing the goodness-of-fit between the empirical distribution \scriptstyle\widehat_n(t) and the assumed true cumulative distribution function . 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, \scriptstyle\widehat_n(t) has asymptotically normal distribution with the standard \sqrt rate of convergence:[2]

\sqrt{n}(\widehatFn(t)-F(t))  \xrightarrow{d}  l{N}(0,F(t)(1-F(t))).

This result is extended by the Donsker’s theorem, which asserts that the empirical process \scriptstyle\sqrt(\widehat_n - F), viewed as a function indexed by \scriptstyle t\in\mathbb, converges in distribution in the Skorokhod space \scriptstyle D[-\infty, +\infty] to the mean-zero Gaussian process \scriptstyle G_F = B \circ F, where is the standard Brownian bridge.[5] The covariance structure of this Gaussian process is

\operatorname{E}[GF(t1)GF(t2)]=F(t1\wedget2)-F(t1)F(t2).

The uniform rate of convergence in Donsker’s theorem can be quantified by the result known as the Hungarian embedding:[6]

\limsupn\toinfty

\sqrt{n
} \big\| \sqrt(\widehat F_n-F) - G_\big\|_\infty < \infty, \quad \text

Alternatively, the rate of convergence of \scriptstyle\sqrt(\widehat_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 \scriptstyle\sqrt\|\widehat_n-F\|_\infty:[6]

\Pr(\sqrt{n}\|\widehat{F}n-F\|infty>z)\leq

-2z2
2e

.

In fact, Kolmogorov has shown that if the cumulative distribution function is continuous, then the expression \scriptstyle\sqrt\|\widehat_n-F\|_\infty converges in distribution to \scriptstyle\|B\|_\infty, which has the Kolmogorov distribution that does not depend on the form of .

Another result, which follows from the law of the iterated logarithm, is that [6]

\limsupn\toinfty

\sqrt{n
\|\widehat{F}

n-F\|infty}{\sqrt{2lnlnn}}\leq

12,

a.s.

and

\liminfn\toinfty\sqrt{2nlnlnn}\|\widehat{F}n-F\|infty=

\pi
2

,a.s.

Confidence intervals

As per Dvoretzky–Kiefer–Wolfowitz inequality the interval that contains the true CDF,

F(x)

, with probability

1-\alpha

is specified as

Fn(x)-\varepsilon\leF(x)\leFn(x)+\varepsilonwhere\varepsilon=\sqrt{

ln{2
\alpha
}}.

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:

See also

Further reading

Notes and References

  1. Book: A modern introduction to probability and statistics: Understanding why and how. 2005. Springer. Michel Dekking. 978-1-85233-896-1. London. 219. 262680588.
  2. Book: van der Vaart, A.W. . Asymptotic statistics . limited . 1998 . Cambridge University Press . 0-521-78450-6 . 265 .
  3. Coles, S. (2001) An Introduction to Statistical Modeling of Extreme Values. Springer, p. 36, Definition 2.4. .
  4. Madsen, H.O., Krenk, S., Lind, S.C. (2006) Methods of Structural Safety. Dover Publications. p. 148-149.
  5. Book: van der Vaart, A.W. . Asymptotic statistics . limited . 1998 . Cambridge University Press . 0-521-78450-6 . 266 .
  6. Book: van der Vaart, A.W. . Asymptotic statistics . limited . 1998 . Cambridge University Press . 0-521-78450-6 . 268 .
  7. Web site: What's new in Matplotlib 3.8.0 (Sept 13, 2023) — Matplotlib 3.8.3 documentation .