statsmodels.stats.diagnostic.anderson_statistic

statsmodels.stats.diagnostic.anderson_statistic(x, dist='norm', fit=True, params=(), axis=0)[source]

Calculate the Anderson-Darling a2 statistic.

Parameters:
  • x (array_like) – The data to test.

  • dist ({'norm', callable}) – The assumed distribution under the null of test statistic.

  • fit (bool) – If True, then the distribution parameters are estimated. Currently only for 1d data x, except in case dist=’norm’.

  • params (tuple) – The optional distribution parameters if fit is False.

  • axis (int) – If dist is ‘norm’ or fit is False, then data can be an n-dimensional and axis specifies the axis of a variable.

Returns:

The Anderson-Darling statistic.

Return type:

{float, ndarray}