AndersonDarlingTest

AndersonDarlingTest[data]
tests whether data is normally distributed using the AndersonDarling test.

AndersonDarlingTest[data,dist]
tests whether data is distributed according to dist using the AndersonDarling test.

AndersonDarlingTest[data,dist,"property"]
returns the value of "property".

Details and OptionsDetails and Options

  • AndersonDarlingTest performs the AndersonDarling 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 {x1,x2,} or multivariate {{x1,y1,},{x2,y2,},}.
  • The AndersonDarling test assumes that the data came from a continuous distribution.
  • The AndersonDarling 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 sum of the univariate marginal -values is used and is assumed to follow a UniformSumDistribution under .
  • AndersonDarlingTest[data,dist,"HypothesisTestData"] returns a HypothesisTestData object htd that can be used to extract additional test results and properties using the form htd["property"].
  • AndersonDarlingTest[data,dist,"property"] can be used to directly give the value of "property".
  • Properties related to the reporting of test results include:
  • "PValue"-value
    "PValueTable"formatted version of "PValue"
    "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 "TestData"
    "TestStatistic"test statistic
    "TestStatisticTable"formatted "TestStatistic"
  • 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 "TestConclusion" and "ShortTestConclusion" properties is controlled by the SignificanceLevel option. By default, is set to 0.05.
  • With the setting Method->"MonteCarlo", datasets of the same length as the input are generated under using the fitted distribution. The EmpiricalDistribution from AndersonDarlingTest[si,dist,"TestStatistic"] is then used to estimate the -value.

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Perform an AndersonDarling test for normality:

In[23]:=
Click for copyable input
In[24]:=
Click for copyable input
Out[24]=
In[27]:=
Click for copyable input
Out[27]=

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]=
Introduced in 2010
(8.0)