[SciPy-dev] Possible bug in scipy.stats.kurtosistest()

Rudolph van der Merwe rudolph@ska.ac...
Tue Apr 24 03:49:21 CDT 2007


I think I found a bug in the kurtosistest function in the scipy.stats
module. The relevant file is scipy/stats/stats.py

The kurtosistest function seems to be a direct implementation of the
algorithm described by D'Agostino et all in the following paper:

R. B. D'Agostina, A. Belanger, and R. B. D'Agostino, Jr. "A Suggestion
for Using Powerful and Informative Tests of Normality", The American
Statistician, Vol. 44, No. 4. (Nov., 1990), pp. 316-321

One of the first steps in the algorithm is calculating the kurtosis of
the distribution. This is done using the stats.kurtosis function. This
function can either calculate the Fisher or the Pearson form of the
kurtosis. The scipy code in kurtosistest makes use of the Fisher form
which is the default for the kurtosis function. The algorithm in
D'Agostino's paper, however, makes use of the Pearson form of the
kurtosis.

I verified this issue on the numerical example given in the paper. The
results calculated by scipy.stats.kurtosistest only agrees with the
paper if the call to kurtosis in kurtosistest is changed from

    b2 = kurtosis(a, axis)

to

   b2 = kurtosis(a, axis, fisher=False)

Since kurtosistest is used by the scipy.stats.normaltest function
(which does a D'Agostino-Pearson normality test), this bug affects
that function's correctness as well.

Is there a more formal way of filing this bug than posting a message
on this forum?

Rudolph

P.S. I'm using Scipy version 0.5.2

-- 
Rudolph van der Merwe
KAT (Karoo Array Telescope) / www.kat.ac.za


More information about the Scipy-dev mailing list