SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.test.distribution

Class AndersonDarling

• public class AndersonDarling
extends HypothesisTest
This algorithm calculates the Anderson-Darling k-sample test statistics and p-values.

The Anderson-Darling k-sample test tests whether the k samples are from the same distribution, which does not needs to be specified. The results produce two statistics and two p-values. TkN and pkN are the statistic and p-value when there are no tied observations. TakN and pakN are the statistic and p-value when the distribution is discrete, or when the continuous data are grouped. Under these two circumstances there may be tied observations.

"Scholz, F. W., and Stephens, M. A., "K-sample Anderson-Darling Tests", Journal of the American Statistical Association, Vol. 82, No. 399, 1987."
• Constructor Summary

Constructors
Constructor and Description
AndersonDarling(double[]... x)
Runs the Anderson-Darling test.
• Method Summary

All Methods
Modifier and Type Method and Description
String getAlternativeHypothesis()
Get the description of the alternative hypothesis.
String getNullHypothesis()
Get a description of the null hypothesis.
double pValue()
Get the p-value for the test statistics.
double pValueAlternative()
Gets the alternative p-value (adjusted for ties).
double statistics()
Get the test statistics.
double statisticsAlternative()
Gets the alternative Anderson-Darling statistic (adjusted for ties).
• Methods inherited from class com.numericalmethod.suanshu.stats.test.HypothesisTest

isNullRejected, nGroups, nObs, oneSidedPvalue
• Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• Constructor Detail

• AndersonDarling

public AndersonDarling(double[]... x)
Runs the Anderson-Darling test.
Parameters:
x - the k samples, each sample in form of a double array.
• Method Detail

• getAlternativeHypothesis

public String getAlternativeHypothesis()
Description copied from class: HypothesisTest
Get the description of the alternative hypothesis.
Specified by:
getAlternativeHypothesis in class HypothesisTest
Returns:
the alternative hypothesis description
Wikipedia: Alternative hypothesis
• getNullHypothesis

public String getNullHypothesis()
Description copied from class: HypothesisTest
Get a description of the null hypothesis.
Specified by:
getNullHypothesis in class HypothesisTest
Returns:
the null hypothesis description
Wikipedia: Null hypothesis
• pValue

public double pValue()
Description copied from class: HypothesisTest
Get the p-value for the test statistics.
Specified by:
pValue in class HypothesisTest
Returns:
the p-value
Wikipedia: P-value
• statistics

public double statistics()
Description copied from class: HypothesisTest
Get the test statistics.
Specified by:
statistics in class HypothesisTest
Returns:
the test statistics
Wikipedia: Test statistic
• pValueAlternative

public double pValueAlternative()
Gets the alternative p-value (adjusted for ties).
Returns:
the alternative p-value
• statisticsAlternative

public double statisticsAlternative()
Gets the alternative Anderson-Darling statistic (adjusted for ties).
Returns:
the alternative Anderson-Darling statistic