Anderson-Darling testΒΆ
The Anderson-Darling test is a statistical test of whether a given sample of data is drawn from a given probability distribution. The library only provides the Anderson-Darling test for normal distributions.
Let be a sample of dimension 1 drawn from the (unknown) cumulative distribution function
assumed to be continuous.
We want to test whether the sample is drawn from a normal distribution ie whether
, where
is the cumulative distribution function of the normal
distribution.
This test involves the calculation of the test statistic which is
the distance between the empirical cumulative distribution function
and
. Letting
be independent random variables respectively distributed according to
, we define
the the order statistics
by:
The test statistic is defined by:
This distance is a quadratic
type, as in the Cramer-Von Mises test,
but gives more weight to deviations of tail values. The empirical value of the
test statistic denoted by is evaluated from the sample sorted
in ascending order:
Under the null hypothesis , the asymptotic
distribution of the test statistic
is known i.e. when
.
If
is sufficiently large, we can use the asymptotic distribution
to apply the test
as follows.
We fix a risk
(error type I) and we evaluate the associated critical
value
which is the quantile of order
of
.
Then a decision is made, either by comparing the test statistic to the theoretical threshold
(or equivalently
by evaluating the p-value of the sample defined as
and by comparing
it to
):
if
(or equivalently
), then we reject the normal distribution,
if
(or equivalently
), then the normal distribution is considered acceptable.