HOME

TheInfoList



OR:

In
statistics Statistics (from German: '' Statistik'', "description of a state, a country") is the discipline that concerns the collection, organization, analysis, interpretation, and presentation of data. In applying statistics to a scientific, indust ...
, 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 Sample or samples may refer to: Base meaning * Sample (statistics), a subset of a population – complete data set * Sample (signal), a digital discrete sample of a continuous analog signal * Sample (material), a specimen or small quantity of ...
. This
cumulative distribution function In probability theory and statistics, the cumulative distribution function (CDF) of a real-valued random variable X, or just distribution function of X, evaluated at x, is the probability that X will take a value less than or equal to x. Eve ...
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 In the theory of probability, the Glivenko–Cantelli theorem (sometimes referred to as the Fundamental Theorem of Statistics), named after Valery Ivanovich Glivenko and Francesco Paolo Cantelli, determines the asymptotic behaviour of the empir ...
. 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 In probability theory and statistics, a collection of random variables is independent and identically distributed if each random variable has the same probability distribution as the others and all are mutually independent. This property is usual ...
real random variables with the common
cumulative distribution function In probability theory and statistics, the cumulative distribution function (CDF) of a real-valued random variable X, or just distribution function of X, evaluated at x, is the probability that X will take a value less than or equal to x. Eve ...
. Then the empirical distribution function is defined as :\widehat F_n(t) = \frac = \frac \sum_^n \mathbf_, where \mathbf_ is the
indicator Indicator may refer to: Biology * Environmental indicator of environmental health (pressures, conditions and responses) * Ecological indicator of ecosystem health (ecological processes) * Health indicator, which is used to describe the health o ...
of
event Event may refer to: Gatherings of people * Ceremony, an event of ritual significance, performed on a special occasion * Convention (meeting), a gathering of individuals engaged in some common interest * Event management, the organization of ev ...
. 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 There are several kinds of mean in mathematics, especially in statistics. Each mean serves to summarize a given group of data, often to better understand the overall value ( magnitude and sign) of a given data set. For a data set, the '' ar ...
and
variance In probability theory and statistics, variance is the expectation of the squared deviation of a random variable from its population mean or sample mean. Variance is a measure of dispersion, meaning it is a measure of how far a set of numbe ...
. This implies that \widehat F_n(t) is an unbiased estimator for . However, in some textbooks, the definition is given as \widehat F_n(t) = \frac \sum_^n \mathbf_Madsen, H.O., Krenk, S., Lind, S.C. (2006) ''Methods of Structural Safety''. Dover Publications. p. 148-149.


Mean

The
mean There are several kinds of mean in mathematics, especially in statistics. Each mean serves to summarize a given group of data, often to better understand the overall value ( magnitude and sign) of a given data set. For a data set, the '' ar ...
of the empirical distribution is an unbiased estimator of the mean of the population distribution. E_n(X) = \frac\left (\sum_^n\right ) which is more commonly denoted \bar


Variance

The
variance In probability theory and statistics, variance is the expectation of the squared deviation of a random variable from its population mean or sample mean. Variance is a measure of dispersion, meaning it is a measure of how far a set of numbe ...
of the empirical distribution times \tfrac is an unbiased estimator of the variance of the population distribution, for any distribution of X that has a finite variance. \begin \operatorname(X) &= \operatorname\left X_-_\operatorname[X^2\right.html"_;"title=".html"_;"title="X_-_\operatorname[X">X_-_\operatorname[X^2\right">.html"_;"title="X_-_\operatorname[X">X_-_\operatorname[X^2\right\\[4pt.html" ;"title="">X_-_\operatorname[X^2\right.html" ;"title=".html" ;"title="X - \operatorname[X">X - \operatorname[X^2\right">.html" ;"title="X - \operatorname[X">X - \operatorname[X^2\right\\[4pt">">X_-_\operatorname[X^2\right.html" ;"title=".html" ;"title="X - \operatorname[X">X - \operatorname[X^2\right">.html" ;"title="X - \operatorname[X">X - \operatorname[X^2\right\\[4pt&= \operatorname\left[(X - \bar)^2\right] \\ pt&= \frac\left (\sum_^n\right ) \end


Mean squared error

The mean squared error for the empirical distribution is as follows. \begin \operatorname&=\frac\sum_^n(Y_i-\hat)^2\\ pt&=\operatorname_(\hat)+ \operatorname(\hat,\theta)^2 \end Where \hat is an estimator and \theta an unknown parameter


Quantiles

For any real number a the notation \lceil\rceil (read “ceiling of a”) denotes the least integer greater than or equal to a. For any real number a, the notation \lfloor\rfloor (read “floor of a”) denotes the greatest integer less than or equal to a. If nq is not an integer, then the q-th quantile is unique and is equal to x_ If nq is an integer, then the q-th quantile is not unique and is any real number x such that x_


Empirical median

If n is odd, then the empirical median is the number \tilde = x_ If n is even, then the empirical median is the number \tilde =\frac


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 In probability theory, an event is said to happen almost surely (sometimes abbreviated as a.s.) if it happens with probability 1 (or Lebesgue measure 1). In other words, the set of possible exceptions may be non-empty, but it has probability 0. ...
, for every value of : : \widehat F_n(t)\ \xrightarrow\ 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 In the theory of probability, the Glivenko–Cantelli theorem (sometimes referred to as the Fundamental Theorem of Statistics), named after Valery Ivanovich Glivenko and Francesco Paolo Cantelli, determines the asymptotic behaviour of the empir ...
, which states that the convergence in fact happens uniformly over : : \, \widehat F_n-F\, _\infty \equiv \sup_ \big, \widehat F_n(t)-F(t)\big, \ \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: : \sqrt\big(\widehat F_n(t) - F(t)\big)\ \ \xrightarrow\ \ \mathcal\Big( 0, F(t)\big(1-F(t)\big) \Big). 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 Anatoliy Volodymyrovych Skorokhod ( uk, Анато́лій Володи́мирович Скорохо́д; September 10, 1930January 3, 2011) was a Soviet and Ukrainian mathematician. Skorokhod is well-known for a comprehensive treatise on the ...
\scriptstyle D \infty, +\infty/math> to the mean-zero
Gaussian process In probability theory and statistics, a Gaussian process is a stochastic process (a collection of random variables indexed by time or space), such that every finite collection of those random variables has a multivariate normal distribution, i.e. ...
\scriptstyle G_F = B \circ F, where is the standard
Brownian bridge A Brownian bridge is a continuous-time stochastic process ''B''(''t'') whose probability distribution is the conditional probability distribution of a standard Wiener process ''W''(''t'') (a mathematical model of Brownian motion) subject to the co ...
. The covariance structure of this Gaussian process is : \operatorname ,G_F(t_1)G_F(t_2)\,= F(t_1\wedge t_2) - F(t_1)F(t_2). The uniform rate of convergence in Donsker’s theorem can be quantified by the result known as the Hungarian embedding: : \limsup_ \frac \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: : \Pr\!\Big( \sqrt\, \widehat_n-F\, _\infty > z \Big) \leq 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 Andrey Nikolaevich Kolmogorov ( rus, Андре́й Никола́евич Колмого́ров, p=ɐnˈdrʲej nʲɪkɐˈlajɪvʲɪtɕ kəlmɐˈɡorəf, a=Ru-Andrey Nikolaevich Kolmogorov.ogg, 25 April 1903 – 20 October 1987) was a Sovi ...
that does not depend on the form of . Another result, which follows from the
law of the iterated logarithm In probability theory, the law of the iterated logarithm describes the magnitude of the fluctuations of a random walk. The original statement of the law of the iterated logarithm is due to A. Ya. Khinchin (1924). Another statement was given by ...
, is that : \limsup_ \frac \leq \frac12, \quad \text and : \liminf_ \sqrt \, \widehat_n-F\, _\infty = \frac, \quad \text


Confidence intervals

As per Dvoretzky–Kiefer–Wolfowitz inequality the interval that contains the true CDF, F(x), with probability 1-\alpha is specified as : F_n(x) - \varepsilon \le F(x) \le F_n(x) + \varepsilon \; \text \varepsilon = \sqrt. 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. Following is the syntax fro
Statsmodel
for plotting empirical distribution.


Statistical implementation

A non-exhaustive list of software implementations of Empirical Distribution function includes: * I
R software
we compute an empirical cumulative distribution function, with several methods for plotting, printing and computing with such an “ecdf” object. * I

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

we can fit probability distribution to our data

we can plot Empirical CDF plot

using scipy.stats we can plot the distribution

we can use statsmodels.distributions.empirical_distribution.ECDF

we can use histograms to plot a cumulative distribution

using the seaborn.ecdfplot function
Plotly
using the plotly.express.ecdf function
Excel
we can plot Empirical CDF plot


See also

* Càdlàg functions * Count data *
Distribution fitting Probability distribution fitting or simply distribution fitting is the fitting of a probability distribution to a series of data concerning the repeated measurement of a variable phenomenon. The aim of distribution fitting is to predict the probab ...
* Dvoretzky–Kiefer–Wolfowitz inequality *
Empirical probability The empirical probability, relative frequency, or experimental probability of an event is the ratio of the number of outcomes in which a specified event occurs to the total number of trials, not in a theoretical sample space but in an actual experi ...
* Empirical process * Estimating quantiles from a sample *
Frequency (statistics) In statistics, the frequency (or absolute frequency) of an Event (probability theory), event i is the number n_i of times the observation has occurred/recorded in an experiment or study. These frequencies are often depicted graphically or in tabu ...
*
Kaplan–Meier estimator The Kaplan–Meier estimator, also known as the product limit estimator, is a non-parametric statistic used to estimate the survival function from lifetime data. In medical research, it is often used to measure the fraction of patients living ...
for censored processes * Survival function * Q–Q plot


References


Further reading

*


External links

* {{DEFAULTSORT:Empirical Distribution Function Nonparametric statistics Empirical process