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

scipy-svn at scipy.org scipy-svn at scipy.org
Sun Nov 16 23:55:25 EST 2008


Author: josef
Date: 2008-11-16 22:55:22 -0600 (Sun, 16 Nov 2008)
New Revision: 5140

Modified:
   trunk/scipy/stats/distributions.py
Log:
fix limiting behavior of genextreme._pdf at c*x=1

Modified: trunk/scipy/stats/distributions.py
===================================================================
--- trunk/scipy/stats/distributions.py	2008-11-17 01:06:57 UTC (rev 5139)
+++ trunk/scipy/stats/distributions.py	2008-11-17 04:55:22 UTC (rev 5140)
@@ -1756,7 +1756,9 @@
         ex2 = 1-c*x
         pex2 = pow(ex2,1.0/c)
         p2 = exp(-pex2)*pex2/ex2
-        return p2
+        limit = where(c == 1.0, 1.0, 0.0)
+        return where(c*x == 1.0, limit, p2)
+        #return p2
     def _cdf(self, x, c):
         return exp(-pow(1-c*x,1.0/c))
     def _ppf(self, q, c):




More information about the Scipy-svn mailing list