AndersonDarlingTest performs the Anderson-Darling goodness-of-fit test with null hypothesis that data was drawn from a population with distribution dist and alternative hypothesis that it was not.

By default a probability value or -value is returned.

A small -value suggests that it is unlikely that the data came from dist.

The dist can be any symbolic distribution with numeric and symbolic parameters or a dataset.

The data can be univariate or multivariate .

The Anderson-Darling test assumes that the data came from a continuous distribution.

The Anderson-Darling test effectively uses a test statistic based on where is the empirical CDF of data and is the CDF of dist.

For univariate data the test statistic is given by where is the sorted data.

For multivariate tests, the mean of the univariate marginal test statistics is used. -values are computed via Monte Carlo simulation.

AndersonDarlingTest returns a HypothesisTestData object htd that can be used to extract additional test results and properties using the form htd["property"].

For a test for goodness-of-fit, a cutoff is chosen such that is rejected only if . The value of used for the and properties is controlled by the SignificanceLevel option. By default is set to .

With the setting Method, datasets of the same length as the input are generated under using the fitted distribution. The EmpiricalDistribution from AndersonDarlingTest is then used to estimate the -value.

Perform the Anderson-Darling test, grouping each dataset with its expected value:

The resulting -value distributions are approximately uniform, supporting the claim:

A power curve for the Anderson-Darling test:

Visualize the approximate power curve:

Estimate the power of the Anderson-Darling test when the underlying distribution is a UniformDistribution, the test size is 0.05, and the sample size is 6:

A collection of measurements were taken on 50 members from each of three iris species. It has been observed that the species setosa is easy to identify but that the remaining two species, versicolor and virginica, are often confused:

The distributions of petal lengths for each species:

The distributions are equivalent for versicolor and virginica, which are very different from setosa:

Assume the following petal length measures are known for the populations:

The normal mixture appears to fit the petal length distribution well: