Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Anderson–Darling test

From Wikipedia, the free encyclopedia
Statistical test

TheAnderson–Darling test is astatistical test of whether a given sample of data is drawn from a givenprobability distribution. In its basic form, the test assumes that there are no parameters to be estimated in the distribution being tested, in which case the test and its set ofcritical values is distribution-free. However, the test is most often used in contexts wherein a family of distributions is being tested, in which case the parameters of that family need to be estimated and account must be taken of this in adjusting either the test-statistic or its critical values. When applied to testing whether anormal distribution adequately describes a set of data, it is one of the most powerful statistical tools for detecting most departures fromnormality.[1][2]K-sample Anderson–Darling tests are available for testing whether several collections of observations can be modelled as coming from a single population, where thedistribution function does not have to be specified.

In addition to its use as a test of fit for distributions, it can be used in parameter estimation as the basis for a form ofminimum distance estimation procedure.

The test is named afterTheodore Wilbur Anderson (1918–2016) andDonald A. Darling (1915–2014), who invented it in 1952.[3]

The single-sample test

[edit]

The Anderson–Darling andCramér–von Mises statistics belong to the class ofquadraticEDF statistics (tests based on theempirical distribution function).[2] If the hypothesized distribution isF{\displaystyle F}, and empirical (sample) cumulative distribution function isFn{\displaystyle F_{n}}, then the quadratic EDF statistics measure the distance betweenF{\displaystyle F} andFn{\displaystyle F_{n}} byn(Fn(x)F(x))2w(x)dF(x),{\displaystyle n\int _{-\infty }^{\infty }{\left(F_{n}(x)-F(x)\right)}^{2}\,w(x)\,dF(x),}wheren{\displaystyle n} is the number of elements in the sample, andw(x){\displaystyle w(x)} is a weighting function. When the weighting function isw(x)=1{\displaystyle w(x)=1}, the statisticis theCramér–von Mises statistic. The Anderson–Darling (1954) test[4] is based on the distanceA2=n(Fn(x)F(x))2F(x)(1F(x))dF(x),{\displaystyle A^{2}=n\int _{-\infty }^{\infty }{\frac {{\left(F_{n}(x)-F(x)\right)}^{2}}{F(x)\left(1-F(x)\right)}}\,dF(x),}which is obtained when theweight function isw(x)=[F(x)(1F(x))]1{\displaystyle w(x)={\left[F(x)\left(1-F(x)\right)\right]}^{-1}}. Thus, compared with theCramér–von Mises distance, the Anderson–Darling distance places more weight on observations in the tails of the distribution.

Basic test statistic

[edit]

The Anderson–Darling test assesses whether asample comes from a specified distribution. It makes use of the fact that, when given a hypothesized underlying distribution and assuming the data does arise from this distribution, thecumulative distribution function (CDF) of the data can be transformed to what should follow auniform distribution. The data can be then tested for uniformity with a distance test (Shapiro, 1980). The formula for thetest statisticA{\displaystyle A} to assess if data{Y1<<Yn}{\displaystyle \{Y_{1}<\cdots <Y_{n}\}} (note that the data must be put in order) comes from a CDFF{\displaystyle F} is

A2=nS,{\displaystyle A^{2}=-n-S\,,}

where

S=i=1n2i1n[ln(F(Yi))+ln(1F(Yn+1i))].{\displaystyle S=\sum _{i=1}^{n}{\frac {2i-1}{n}}\left[\ln(F(Y_{i}))+\ln \left(1-F(Y_{n+1-i})\right)\right].}

The test statistic can then be compared against the critical values of the theoretical distribution. In this case, no parameters are estimated in relation to the cumulative distribution functionF{\displaystyle F}.

Tests for families of distributions

[edit]

Essentially the same test statistic can be used in the test of fit of a family of distributions, but then it must be compared against the critical values appropriate to that family of theoretical distributions and dependent also on the method used for parameter estimation.

Test for normality

[edit]

Empirical testing has found[5] that the Anderson–Darling test is not quite as good as theShapiro–Wilk test, but is better than other tests. Stephens[1] foundA2{\displaystyle A^{2}} to be one of the bestempirical distribution function statistics for detecting most departures from normality.

The computation differs based on what is known about the distribution:[6]

Then observations,Xi{\displaystyle X_{i}}, fori=1,n{\displaystyle i=1,\ldots n}, of the variableX{\displaystyle X} must be sorted such thatX1X2Xn{\displaystyle X_{1}\leq X_{2}\leq \dots \leq X_{n}} and the notation in the following assumes thatXi represent the ordered observations. Letμ^={μ,if the mean is known.X¯=1ni=1nXi,otherwise.{\displaystyle {\hat {\mu }}={\begin{cases}\mu ,&{\text{if the mean is known.}}\\{\bar {X}}={\frac {1}{n}}\sum _{i=1}^{n}X_{i},&{\text{otherwise.}}\end{cases}}}

σ^2={σ2,if the variance is known.1ni=1n(Xiμ)2,if the variance is not known, but the mean is.1n1i=1n(XiX¯)2,otherwise.{\displaystyle {\hat {\sigma }}^{2}={\begin{cases}\sigma ^{2},&{\text{if the variance is known.}}\\{\frac {1}{n}}\sum _{i=1}^{n}(X_{i}-\mu )^{2},&{\text{if the variance is not known, but the mean is.}}\\{\frac {1}{n-1}}\sum _{i=1}^{n}(X_{i}-{\bar {X}})^{2},&{\text{otherwise.}}\end{cases}}}The valuesXi{\displaystyle X_{i}} are standardized to create new valuesYi{\displaystyle Y_{i}}, given byYi=Xiμ^σ^.{\displaystyle Y_{i}={\frac {X_{i}-{\hat {\mu }}}{\hat {\sigma }}}.}With the standard normal CDFΦ{\displaystyle \Phi },A2{\displaystyle A^{2}} is calculated usingA2=n1ni=1n(2i1)[lnΦ(Yi)+ln(1Φ(Yn+1i))].{\displaystyle A^{2}=-n-{\frac {1}{n}}\sum _{i=1}^{n}\left(2i-1\right)\left[\ln \Phi (Y_{i})+\ln(1-\Phi (Y_{n+1-i}))\right].}An alternative expression in which only a single observation is dealt with at each step of the summation is:A2=n1ni=1n[(2i1)lnΦ(Yi)+(2(ni)+1)ln(1Φ(Yi))].{\displaystyle A^{2}=-n-{\frac {1}{n}}\sum _{i=1}^{n}\left[(2i-1)\ln \Phi (Y_{i})+(2(n-i)+1)\ln(1-\Phi (Y_{i}))\right].}A modified statistic can be calculated usingA2={A2(1+0.75n+2.25n2),if the variance and the mean are both unknown.A2,otherwise.{\displaystyle A^{*2}={\begin{cases}A^{2}\left(1+{\frac {0.75}{n}}+{\frac {2.25}{n^{2}}}\right),&{\text{if the variance and the mean are both unknown.}}\\A^{2},&{\text{otherwise.}}\end{cases}}}

[2]. IfA2{\displaystyle A^{2}} orA2{\displaystyle A^{*2}} exceeds a given critical value, then the hypothesis of normality is rejected withsome significance level. The critical values are given in the table below for values ofA2{\displaystyle A^{*2}}.[1][2][7]

Casen15%10%5%2.5%1%
0≥ 51.6211.9332.4923.0703.857
1≥ 200.7820.8941.0871.2851.551
2≥ 201.4301.7432.3082.8983.702
30.5610.6310.7520.8731.035

Note 1: Ifσ^{\displaystyle {\hat {\sigma }}} = 0 or anyΦ(Yi)={\displaystyle \Phi (Y_{i})=}(0 or 1) thenA2{\displaystyle A^{2}} cannot be calculated and is undefined.

Note 2: The above formula for the modified statisticA2{\displaystyle A^{*2}} is taken from D'Agostino (1986, p. 123). Care is required in comparisons across different sources as often the specific adjustment formula is not stated.

Note 3: Stephens[1] notes that the test becomes better when the parameters are computed from the data, even if they are known.

Note 4: Marsaglia & Marsaglia[7] provide a more accurate result for Case 0 at 85% and 99%.

Tests for other distributions

[edit]

Above, it was assumed that the variableXi{\displaystyle X_{i}} was being tested for normal distribution. Any other family of distributions can be tested, but the test for each family is implemented by using a different modification of the basic test statistic, with reference to critical values specific to that family of distributions. The modifications of the statistic and tables of critical values are given by Stephens (1986)[2] for the exponential, extreme-value, Weibull, gamma, logistic, Cauchy, and von Mises distributions. Tests for the (two-parameter)log-normal distribution can be implemented by transforming the data using alogarithm and using the above test for normality. Details for the required modifications to the test statistic and for the critical values for thenormal distribution and theexponential distribution have been published by Pearson & Hartley (1972, Table 54). Details for these distributions, with the addition of theGumbel distribution, are also given by Shorack & Wellner (1986, p239). Details for thelogistic distribution are given by Stephens (1979). A test for the (two parameter)Weibull distribution can be obtained by making use of the fact that the logarithm of a Weibull variate has aGumbel distribution.

Non-parametrick-sample tests

[edit]

Fritz Scholz and Michael A. Stephens (1987) discuss a test, based on the Anderson–Darling measure of agreement between distributions, for whether a number of random samples with possibly different sample sizes may have arisen from the same distribution, where this distribution is unspecified.[8] TheR package kSamples and thePython packageScipy implements thisrank test for comparing k samples among several other such rank tests.[9][10]

Fork{\displaystyle k} samples the statistic can be computed as follows under the assumption that the distribution functionFi{\displaystyle F_{i}} ofi{\displaystyle i}-th sample is continuous

AkN2=1Ni=1k1nij=1N1(NMijjni)2j(Nj){\displaystyle A_{kN}^{2}={\frac {1}{N}}\sum _{i=1}^{k}{\frac {1}{n_{i}}}\sum _{j=1}^{N-1}{\frac {(NM_{ij}-jn_{i})^{2}}{j(N-j)}}}

where

See also

[edit]

References

[edit]
  1. ^abcdStephens, M. A. (1974). "EDF Statistics for Goodness of Fit and Some Comparisons".Journal of the American Statistical Association.69 (347):730–737.doi:10.2307/2286009.JSTOR 2286009.
  2. ^abcdeM. A. Stephens (1986). "Tests Based on EDF Statistics". In D'Agostino, R. B.; Stephens, M. A. (eds.).Goodness-of-Fit Techniques. New York: Marcel Dekker.ISBN 0-8247-7487-6.
  3. ^Anderson, T. W.;Darling, D. A. (1952)."Asymptotic theory of certain "goodness-of-fit" criteria based on stochastic processes".Annals of Mathematical Statistics.23 (2):193–212.doi:10.1214/aoms/1177729437.
  4. ^Anderson, T.W.; Darling, D.A. (1954). "A Test of Goodness-of-Fit".Journal of the American Statistical Association.49 (268):765–769.doi:10.2307/2281537.JSTOR 2281537.
  5. ^Razali, Nornadiah; Wah, Yap Bee (2011). "Power comparisons of Shapiro–Wilk, Kolmogorov–Smirnov, Lilliefors and Anderson–Darling tests".Journal of Statistical Modeling and Analytics.2 (1):21–33.
  6. ^Ralph B. D'Agostino (1986). "Tests for the Normal Distribution". In D'Agostino, R.B.; Stephens, M.A. (eds.).Goodness-of-Fit Techniques. New York: Marcel Dekker.ISBN 0-8247-7487-6.
  7. ^abMarsaglia, G. (2004)."Evaluating the Anderson-Darling Distribution".Journal of Statistical Software.9 (2):730–737.CiteSeerX 10.1.1.686.1363.doi:10.18637/jss.v009.i02.
  8. ^abScholz, F. W.; Stephens, M. A. (1987). "K-sample Anderson–Darling Tests".Journal of the American Statistical Association.82 (399):918–924.doi:10.1080/01621459.1987.10478517.
  9. ^"kSamples: K-Sample Rank Tests and their Combinations".R Project. 7 October 2023.
  10. ^"The Anderson-Darling test for k-samples. Scipy package".

Further reading

[edit]
  • Corder, G.W., Foreman, D.I. (2009).Nonparametric Statistics for Non-Statisticians: A Step-by-Step Approach Wiley,ISBN 978-0-470-45461-9
  • Mehta, S. (2014)Statistics TopicsISBN 978-1499273533
  • Pearson E.S., Hartley, H.O. (Editors) (1972)Biometrika Tables for Statisticians, Volume II. CUP.ISBN 0-521-06937-8.
  • Shapiro, S.S. (1980) How to test normality and other distributional assumptions. In: The ASQC basic references in quality control: statistical techniques 3, pp. 1–78.
  • Shorack, G.R.,Wellner, J.A. (1986)Empirical Processes with Applications to Statistics, Wiley.ISBN 0-471-86725-X.
  • Stephens, M.A. (1979)Test of fit for the logistic distribution based on the empirical distribution function, Biometrika, 66(3), 591–5.

External links

[edit]
Retrieved from "https://en.wikipedia.org/w/index.php?title=Anderson–Darling_test&oldid=1324085490"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp