[Scipy-tickets] [SciPy] #403: kurtosistest calculates incorrect value

SciPy scipy-tickets@scipy....
Tue Apr 24 16:04:49 CDT 2007


#403: kurtosistest calculates incorrect value
---------------------+------------------------------------------------------
 Reporter:  peridot  |       Owner:  somebody
     Type:  defect   |      Status:  new     
 Priority:  normal   |   Milestone:          
Component:  Other    |     Version:          
 Severity:  normal   |    Keywords:          
---------------------+------------------------------------------------------
 From an email from Rudolph van der Merwe <rudolph@ska.ac.za>

 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.

-- 
Ticket URL: <http://projects.scipy.org/scipy/scipy/ticket/403>
SciPy <http://www.scipy.org/>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list