pingouin.anderson

pingouin.anderson(*args, dist='norm')[source]

Anderson-Darling test of distribution.

Parameters
sample1, sample2,…array_like

Array of sample data. May be different lengths.

diststring

Distribution (‘norm’, ‘expon’, ‘logistic’, ‘gumbel’)

Returns
from_distboolean

True if data comes from this distribution.

sig_levelfloat

The significance levels for the corresponding critical values in %. (See scipy.stats.anderson() for more details)

Examples

  1. Test that an array comes from a normal distribution

>>> from pingouin import anderson
>>> x = [2.3, 5.1, 4.3, 2.6, 7.8, 9.2, 1.4]
>>> anderson(x, dist='norm')
(False, 15.0)
  1. Test that two arrays comes from an exponential distribution

>>> y = [2.8, 12.4, 28.3, 3.2, 16.3, 14.2]
>>> anderson(x, y, dist='expon')
(array([False, False]), array([15., 15.]))