[Scipy-svn] r5301 - trunk/scipy/stats

scipy-svn@scip... scipy-svn@scip...
Tue Dec 30 13:08:40 CST 2008


Author: josef
Date: 2008-12-30 13:08:36 -0600 (Tue, 30 Dec 2008)
New Revision: 5301

Modified:
   trunk/scipy/stats/stats.py
Log:
fix 2 pvalues that are calculated at the wrong tail

Modified: trunk/scipy/stats/stats.py
===================================================================
--- trunk/scipy/stats/stats.py	2008-12-30 15:03:59 UTC (rev 5300)
+++ trunk/scipy/stats/stats.py	2008-12-30 19:08:36 UTC (rev 5301)
@@ -886,7 +886,7 @@
     alpha = math.sqrt(2.0/(W2-1))
     y = np.where(y==0, 1, y)
     Z = delta*np.log(y/alpha + np.sqrt((y/alpha)**2+1))
-    return Z, (1.0 - zprob(Z))*2
+    return Z, (1.0 - zprob(np.abs(Z)))*2
 
 
 def kurtosistest(a, axis=0):
@@ -928,7 +928,8 @@
     if Z.ndim == 0:
         Z = Z[()]
     #JPNote: p-value sometimes larger than 1
-    return Z, (1.0-zprob(Z))*2
+    #zprob uses upper tail, so Z needs to be positive
+    return Z, (1.0-zprob(np.abs(Z)))*2
 
 
 def normaltest(a, axis=0):



More information about the Scipy-svn mailing list