adtest
Anderson-Darling goodness-of-fit hypothesis test.
h = adtest (x)
returns a test decision for the null
hypothesis that the data in vector x is from a population with a normal
distribution, using the Anderson-Darling test. The alternative hypothesis is
that x is not from a population with a normal distribution. The result
h is 1 if the test rejects the null hypothesis at the 5% significance
level, or 0 otherwise.
h = adtest (x, Name, Value)
returns a test
decision for the Anderson-Darling test with additional options specified by
one or more Name-Value pair arguments. For example, you can specify a null
distribution other than normal, or select an alternative method for
calculating the p-value, such as a Monte Carlo simulation.
The following parameters can be parsed as Name-Value pair arguments.
Name | Description |
---|---|
"Distribution" | The distribution being tested for. It tests whether x could have come from the specified distribution. There are two choise available for parsing distribution parameters: |
"Alpha" | Significance level alpha for the test. Any scalar numeric value between 0 and 1. The default is 0.05 corresponding to the 5% significance level. |
"MCTol" | Monte-Carlo standard error for the p-value, pval, value. which must be a positive scalar value. In this case, an approximation for the p-value is computed directly, using Monte-Carlo simulations. |
"Asymptotic" | Method for calculating the p-value of the Anderson-Darling test, which can be either true or false logical value. If you specify ’true’, adtest estimates the p-value using the limiting distribution of the Anderson-Darling test statistic. If you specify ’false’, adtest calculates the p-value based on an analytical formula. For sample sizes greater than 120, the limiting distribution estimate is likely to be more accurate than the small sample size approximation method. |
[h, pval] = adtest (…)
also returns the p-value,
pval, of the Anderson-Darling test, using any of the input arguments
from the previous syntaxes.
[h, pval, adstat, cv] = adtest (…)
also
returns the test statistic, adstat, and the critical value, cv,
for the Anderson-Darling test.
The Anderson-Darling test statistic belongs to the family of Quadratic Empirical Distribution Function statistics, which are based on the weighted sum of the difference over the ordered sample values , where is the hypothesized continuous distribution and is the empirical CDF based on the data sample with sample points.
See also: kstest
Source Code: adtest