This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

AndersonDarlingTest

AndersonDarlingTest[data]
tests whether data is normally distributed using the Anderson-Darling test.
AndersonDarlingTest
tests whether data is distributed according to dist using the Anderson-Darling test.
AndersonDarlingTest
returns the value of .
  • 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.
  • Properties related to the reporting of test results include:
"PValue"-value
"PValueTable"formatted version of
"ShortTestConclusion"a short description of the conclusion of a test
"TestConclusion"a description of the conclusion of a test
"TestData"test statistic and -value
"TestDataTable"formatted version of
"TestStatistic"test statistic
"TestStatisticTable"formatted
  • The following properties are independent of which test is being performed.
  • Properties related to the data distribution include:
"FittedDistribution"fitted distribution of data
"FittedDistributionParameters"distribution parameters of data
  • The following options can be given:
MethodAutomaticthe method to use for computing -values
SignificanceLevel0.05cutoff for diagnostics and reporting
  • 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 .
Perform an Anderson-Darling test for normality:
Test the fit of some data to a particular distribution:
Compare the distributions of two datasets:
Perform an Anderson-Darling test for normality:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=
 
Test the fit of some data to a particular distribution:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=
 
Compare the distributions of two datasets:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
Out[3]=
In[4]:=
Click for copyable input
Out[4]=
Perform an Anderson-Darling test for normality:
The -value for the normal data is large compared to the -value for the non-normal data:
Test the goodness-of-fit for a particular distribution:
Compare the distributions of two datasets:
Test for multivariate normality:
Test for goodness-of-fit to any multivariate distribution:
Create a HypothesisTestData object for repeated property extraction:
The properties available for extraction:
Tabulate the results of the Anderson-Darling test:
The full test table:
A -value table:
The test statistic:
Retrieve the entries from an Anderson-Darling test table for custom reporting:
Report test conclusions using and :
The conclusion may differ at a different significance level:
Use Monte Carlo-based methods for a computation formula:
Set the number of samples to use for Monte Carlo-based methods:
The Monte Carlo estimate converges to the true -value with increasing samples:
Set the random seed used in Monte Carlo-based methods:
The seed affects the state of the generator and has some effect on the resulting -value:
Set the significance level used for and :
By default is used:
It can be shown that a GammaDistribution is equivalent to an ExponentialDistribution[]. This conclusion is supported by simulation:
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:
By default, univariate data is compared to a NormalDistribution:
The parameters have been estimated from the data:
Multivariate data is compared to a MultinormalDistribution by default:
The parameters of the test distribution are estimated from the data if not specified:
Specified parameters are not estimated:
Maximum likelihood estimates are used for unspecified parameters of the test distribution:
If the parameters are unknown, AndersonDarlingTest applies a correction when possible:
The parameters are estimated but no correction is applied:
The fitted distribution is the same as before and the -value is corrected:
Independent marginal densities are assumed in tests for multivariate goodness-of-fit:
The test statistic is identical when independence is assumed:
The Anderson-Darling test statistic:
The Anderson-Darling test is not intended for discrete distributions:
The Anderson-Darling test is not valid for some distributions when parameters have been estimated from the data:
Provide parameter values if they are known:
Alternatively, use Monte Carlo methods to approximate the -value:
The distribution of the Anderson-Darling test statistic:
New in 8