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

scipy-svn@scip... scipy-svn@scip...
Wed Nov 12 20:38:12 CST 2008


Author: josef
Date: 2008-11-12 20:38:10 -0600 (Wed, 12 Nov 2008)
New Revision: 5075

Modified:
   trunk/scipy/stats/distributions.py
Log:
correct error at lower bound in _drv2_ppfsingle

Modified: trunk/scipy/stats/distributions.py
===================================================================
--- trunk/scipy/stats/distributions.py	2008-11-13 02:30:45 UTC (rev 5074)
+++ trunk/scipy/stats/distributions.py	2008-11-13 02:38:10 UTC (rev 5075)
@@ -3326,7 +3326,14 @@
         if (qb == q):
             return b
         if b == a+1:
-            return b
+    #testcase: return wrong number at lower index
+    #python -c "from scipy.stats import zipf;print zipf.ppf(0.01,2)" wrong
+    #python -c "from scipy.stats import zipf;print zipf.ppf([0.01,0.61,0.77,0.83],2)"
+    #python -c "from scipy.stats import logser;print logser.ppf([0.1,0.66, 0.86,0.93],0.6)"            
+            if qa > q:
+                return a
+            else:
+                return b     
         c = int((a+b)/2.0)
         qc = self._cdf(c, *args)
         if (qc < q):



More information about the Scipy-svn mailing list