Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Empirical distribution function

From Wikipedia, the free encyclopedia
Distribution function associated with the empirical measure of a sample
See also:Frequency distribution
The green curve, which asymptotically approaches heights of 0 and 1 without reaching them, is the true cumulative distribution function of the standard normal distribution. The grey hash marks represent the observations in a particular sample drawn from that distribution, and the horizontal steps of the blue step function (including the leftmost point in each step but not including the rightmost point) form the empirical distribution function of that sample. (Click here to load a new graph.)
The green curve, which asymptotically approaches heights of 0 and 1 without reaching them, is the truecumulative distribution function of thestandard normal distribution. The grey hash marks represent the observations in a particularsample drawn from that distribution, and the horizontal steps of the blue step function (including the leftmost point in each step but not including the rightmost point) form the empirical distribution function of that sample. (Click here to load a new graph.)

Instatistics, anempirical distribution function (a.k.a. anempirical cumulative distribution function,eCDF) is thedistribution function associated with theempirical measure of asample.[1] Thiscumulative distribution function is astep function that jumps up by1/n at each of then 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 anestimate of the cumulative distribution function that generated the points in the sample. It converges with probability 1 to that underlying distribution, according to theGlivenko–Cantelli theorem. A number of results exist to quantify the rate ofconvergence of the empirical distribution function to the underlying cumulative distribution function.

Definition

[edit]

Let(X1, …,Xn) beindependent, identically distributed real random variables with the commoncumulative distribution functionF(t). Then theempirical distribution function is defined as[2]

F^n(t)=number of elements in the sampletn=1ni=1n1Xit,{\displaystyle {\widehat {F}}_{n}(t)={\frac {{\mbox{number of elements in the sample}}\leq t}{n}}={\frac {1}{n}}\sum _{i=1}^{n}\mathbf {1} _{X_{i}\leq t},}

where1A{\displaystyle \mathbf {1} _{A}} is theindicator ofeventA. For a fixedt, the indicator1Xit{\displaystyle \mathbf {1} _{X_{i}\leq t}} is aBernoulli random variable with parameterp =F(t); hencenF^n(t){\displaystyle n{\widehat {F}}_{n}(t)} is abinomial random variable withmeannF(t) andvariancenF(t)(1 −F(t)). This implies thatF^n(t){\displaystyle {\widehat {F}}_{n}(t)} is anunbiased estimator forF(t).

However, in some textbooks, the definition is given as

F^n(t)=1n+1i=1n1Xit{\displaystyle {\widehat {F}}_{n}(t)={\frac {1}{n+1}}\sum _{i=1}^{n}\mathbf {1} _{X_{i}\leq t}}[3][4]

Asymptotic properties

[edit]

Since the ratio(n + 1)/n approaches 1 asn goes to infinity, the asymptotic properties of the two definitions that are given above are the same.

By thestrong law of large numbers, the estimatorF^n(t){\displaystyle \scriptstyle {\widehat {F}}_{n}(t)} converges toF(t) asn → ∞almost surely, for every value oft:[2]

F^n(t) a.s. F(t);{\displaystyle {\widehat {F}}_{n}(t)\ {\xrightarrow {\text{a.s.}}}\ F(t);}

thus the estimatorF^n(t){\displaystyle \scriptstyle {\widehat {F}}_{n}(t)} isconsistent. This expression asserts the pointwise convergence of the empirical distribution function to the true cumulative distribution function. There is a stronger result, called theGlivenko–Cantelli theorem, which states that the convergence in fact happens uniformly overt:[5]

F^nFsuptR|F^n(t)F(t)|  0.{\displaystyle \|{\widehat {F}}_{n}-F\|_{\infty }\equiv \sup _{t\in \mathbb {R} }{\big |}{\widehat {F}}_{n}(t)-F(t){\big |}\ \xrightarrow {} \ 0.}

The sup-norm in this expression is called theKolmogorov–Smirnov statistic for testing the goodness-of-fit between the empirical distributionF^n(t){\displaystyle \scriptstyle {\widehat {F}}_{n}(t)} and the assumed true cumulative distribution functionF. Othernorm functions may be reasonably used here instead of the sup-norm. For example, theL2-norm gives rise to theCramér–von Mises statistic.

The asymptotic distribution can be further characterized in several different ways. First, thecentral limit theorem states thatpointwise,F^n(t){\displaystyle \scriptstyle {\widehat {F}}_{n}(t)} has asymptotically normal distribution with the standardn{\displaystyle {\sqrt {n}}} rate of convergence:[2]

n(F^n(t)F(t))  d  N(0,F(t)(1F(t))).{\displaystyle {\sqrt {n}}{\big (}{\widehat {F}}_{n}(t)-F(t){\big )}\ \ {\xrightarrow {d}}\ \ {\mathcal {N}}{\Big (}0,F(t){\big (}1-F(t){\big )}{\Big )}.}

This result is extended by theDonsker’s theorem, which asserts that theempirical processn(F^nF){\displaystyle \scriptstyle {\sqrt {n}}({\widehat {F}}_{n}-F)}, viewed as a function indexed bytR{\displaystyle \scriptstyle t\in \mathbb {R} },converges in distribution in theSkorokhod spaceD[,+]{\displaystyle \scriptstyle D[-\infty ,+\infty ]} to the mean-zeroGaussian processGF=BF{\displaystyle \scriptstyle G_{F}=B\circ F}, whereB is the standardBrownian bridge.[5] The covariance structure of this Gaussian process is

E[GF(t1)GF(t2)]=F(t1t2)F(t1)F(t2).{\displaystyle \operatorname {E} [\,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 theHungarian embedding:[6]

lim supnnln2nn(F^nF)GF,n<,a.s.{\displaystyle \limsup _{n\to \infty }{\frac {\sqrt {n}}{\ln ^{2}n}}{\big \|}{\sqrt {n}}({\widehat {F}}_{n}-F)-G_{F,n}{\big \|}_{\infty }<\infty ,\quad {\text{a.s.}}}

Alternatively, the rate of convergence ofn(F^nF){\displaystyle \scriptstyle {\sqrt {n}}({\widehat {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 theDvoretzky–Kiefer–Wolfowitz inequality provides bound on the tail probabilities ofnF^nF{\displaystyle \scriptstyle {\sqrt {n}}\|{\widehat {F}}_{n}-F\|_{\infty }}:[6]

Pr(nF^nF>z)2e2z2.{\displaystyle \Pr \!{\Big (}{\sqrt {n}}\|{\widehat {F}}_{n}-F\|_{\infty }>z{\Big )}\leq 2e^{-2z^{2}}.}

In fact, Kolmogorov has shown that if the cumulative distribution functionF is continuous, then the expressionnF^nF{\displaystyle \scriptstyle {\sqrt {n}}\|{\widehat {F}}_{n}-F\|_{\infty }} converges in distribution toB{\displaystyle \scriptstyle \|B\|_{\infty }}, which has theKolmogorov distribution that does not depend on the form ofF.

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

lim supnnF^nF2lnlnn12,a.s.{\displaystyle \limsup _{n\to \infty }{\frac {{\sqrt {n}}\|{\widehat {F}}_{n}-F\|_{\infty }}{\sqrt {2\ln \ln n}}}\leq {\frac {1}{2}},\quad {\text{a.s.}}}

and

lim infn2nlnlnnF^nF=π2,a.s.{\displaystyle \liminf _{n\to \infty }{\sqrt {2n\ln \ln n}}\|{\widehat {F}}_{n}-F\|_{\infty }={\frac {\pi }{2}},\quad {\text{a.s.}}}

Confidence intervals

[edit]
Empirical CDF, CDF and confidence interval plots for various sample sizes ofnormal distribution
Empirical CDF, CDF and confidence interval plots for various sample sizes ofCauchy distribution
Empirical CDF, CDF and confidence interval plots for various sample sizes oftriangle distribution

As perDvoretzky–Kiefer–Wolfowitz inequality the interval that contains the true CDF,F(x){\displaystyle F(x)}, with probability1α{\displaystyle 1-\alpha } is specified as

Fn(x)εF(x)Fn(x)+ε where ε=ln2α2n.{\displaystyle F_{n}(x)-\varepsilon \leq F(x)\leq F_{n}(x)+\varepsilon \;{\text{ where }}\varepsilon ={\sqrt {\frac {\ln {\frac {2}{\alpha }}}{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

[edit]

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

  • InR software, we compute an empirical cumulative distribution function, with several methods for plotting, printing and computing with such an “ecdf” object.
  • InMATLAB 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)[7]
  • Seaborn, using the seaborn.ecdfplot function
  • Plotly, using the plotly.express.ecdf function
  • Excel, we can plot Empirical CDF plot
  • ArviZ, using theaz.plot_ecdf function

See also

[edit]

References

[edit]
  1. ^A modern introduction to probability and statistics: Understanding why and how. Michel Dekking. London: Springer. 2005. p. 219.ISBN 978-1-85233-896-1.OCLC 262680588.{{cite book}}: CS1 maint: others (link)
  2. ^abcvan der Vaart, A.W. (1998).Asymptotic statistics. Cambridge University Press. p. 265.ISBN 0-521-78450-6.
  3. ^Coles, S. (2001)An Introduction to Statistical Modeling of Extreme Values. Springer, p. 36, Definition 2.4.ISBN 978-1-4471-3675-0.
  4. ^Madsen, H.O., Krenk, S., Lind, S.C. (2006)Methods of Structural Safety. Dover Publications. p. 148-149.ISBN 0486445976
  5. ^abvan der Vaart, A.W. (1998).Asymptotic statistics. Cambridge University Press. p. 266.ISBN 0-521-78450-6.
  6. ^abcvan der Vaart, A.W. (1998).Asymptotic statistics. Cambridge University Press. p. 268.ISBN 0-521-78450-6.
  7. ^"What's new in Matplotlib 3.8.0 (Sept 13, 2023) — Matplotlib 3.8.3 documentation".

Further reading

[edit]

External links

[edit]
Continuous data
Center
Dispersion
Shape
Count data
Summary tables
Dependence
Graphics
Study design
Survey methodology
Controlled experiments
Adaptive designs
Observational studies
Statistical theory
Frequentist inference
Point estimation
Interval estimation
Testing hypotheses
Parametric tests
Specific tests
Goodness of fit
Rank statistics
Bayesian inference
Correlation
Regression analysis
Linear regression
Non-standard predictors
Generalized linear model
Partition of variance
Categorical
Multivariate
Time-series
General
Specific tests
Time domain
Frequency domain
Survival
Survival function
Hazard function
Test
Biostatistics
Engineering statistics
Social statistics
Spatial statistics
Retrieved from "https://en.wikipedia.org/w/index.php?title=Empirical_distribution_function&oldid=1277923994"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp