The Anderson–Darling test is a statistical test of whether a given sample of data is drawn from a given probability 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 of critical values is distribution-free. However, the test is most often used in contexts where 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 a normal distribution adequately describes a set of data, it is one of the most powerful statistical tools for detecting most departures from normality. K-sample Anderson–Darling tests are available for testing whether several collections of observations can be modelled as coming from a single population, where the distribution function does not have to be specified.
Contents
- The single sample test
- Basic test statistic
- Tests for families of distributions
- Test for normality
- Tests for other distributions
- Non parametric k sample tests
- References
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 of minimum distance estimation procedure.
The test is named after Theodore Wilbur Anderson (born 1918) and Donald A. Darling, who invented it in 1952.
The single-sample test
The Anderson–Darling and Cramér–von Mises statistics belong to the class of quadratic EDF statistics (tests based on the empirical distribution function). If the hypothesized distribution is
where
which is obtained when the weight function is
Basic test statistic
The Anderson–Darling test assesses whether a sample 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, the frequency of the data can be assumed to follow a Uniform distribution. The data can be then tested for uniformity with a distance test (Shapiro 1980). The formula for the test statistic
where
The test statistic can then be compared against the critical values of the theoretical distribution. Note that in this case no parameters are estimated in relation to the distribution function
Tests for families of distributions
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
Empirical testing has found that the Anderson–Darling test is not quite as good as Shapiro-Wilk, but is better than other tests. Stephens found
The computation differs based on what is known about the distribution:
The n observations,
The values
With the standard normal CDF
An alternative expression in which only a single observation is dealt with at each step of the summation is:
A modified statistic can be calculated using
If
Note 1: If
Note 2: The above adjustment formula is taken from Shorak & Wellner (1986, p239). Care is required in comparisons across different sources as often the specific adjustment formula is not stated.
Note 3: Stephens notes that the test becomes better when the parameters are computed from the data, even if they are known.
Alternatively, for case 3 above (both mean and variance unknown), D'Agostino (1986) in Table 4.7 on p. 123 and on pages 372–373 gives the adjusted statistic:
and normality is rejected if
Tests for other distributions
Above, it was assumed that the variable
Non-parametric k-sample tests
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. The R package kSamples implements this rank test for comparing k samples among several other such rank tests.