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

scipy-svn@scip... scipy-svn@scip...
Tue Nov 18 00:15:18 CST 2008


Author: josef
Date: 2008-11-18 00:15:12 -0600 (Tue, 18 Nov 2008)
New Revision: 5142

Modified:
   trunk/scipy/stats/distributions.py
Log:
correction to genextreme for vector arguments in _pdf

Modified: trunk/scipy/stats/distributions.py
===================================================================
--- trunk/scipy/stats/distributions.py	2008-11-17 18:29:09 UTC (rev 5141)
+++ trunk/scipy/stats/distributions.py	2008-11-18 06:15:12 UTC (rev 5142)
@@ -1762,8 +1762,9 @@
         ##        p2 = exp(-pex2)*pex2/ex2
         ##        return p2
         cx = c*x
-        logex2 = where(c==0,0.0,np.log1p(-cx))
-        logpex2 = where(c==0,-x,logex2/c)
+        # Note: fit method requires that _pdf accepts vector x
+        logex2 = where((x==x)*(c==0),0.0,np.log1p(-cx))
+        logpex2 = where((x==x)*(c==0),-x,logex2/c)
         pex2 = exp(logpex2)
         # % Handle special cases
         logpdf = where((cx==1) | (cx==-inf),-inf,-pex2+logpex2-logex2)



More information about the Scipy-svn mailing list