The Anderson-Darling test is commonly used
to test whether a data sample comes from a normal distribution. However,
it can be used to test for another hypothesized distribution, even
if you do not fully specify the distribution parameters. Instead,
the test estimates any unknown parameters from the data sample.
The test statistic belongs to the family of quadratic empirical
distribution function statistics, which measure the distance between
the hypothesized distribution, F(x)
and the empirical cdf, Fn(x)
as
n∫−∞∞(Fn(x)−F(x))w2(x)dF(x),
over the ordered sample values x1
is a weight function and n is the number of data
points in the sample.
The weight function for the Anderson-Darling test is
w(x)=[F(x)(1−F(x))]−1,
which places greater weight on the observations
in the tails of the distribution, thus making the test more sensitive
to outliers and better at detecting departure from normality in the
tails of the distribution.
The Anderson-Darling test statistic is
An2=−n−∑i=1n2i−1n[ln(F(Xi))+ln(1−F(Xn+1−i))],
where{X1<... are the ordered>
sample data points and n is the number of data
points in the sample.
In adtest, the decision to reject or not
reject the null hypothesis is based on comparing the p-value
for the hypothesis test with the specified significance level, not
on comparing the test statistic with the critical value.