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

scipy-svn@scip... scipy-svn@scip...
Fri Oct 5 05:08:32 CDT 2007


Author: edschofield
Date: 2007-10-05 05:08:16 -0500 (Fri, 05 Oct 2007)
New Revision: 3416

Modified:
   trunk/scipy/stats/kde.py
Log:
Use pre-computed normalization factor in stats.kde for efficiency


Modified: trunk/scipy/stats/kde.py
===================================================================
--- trunk/scipy/stats/kde.py	2007-10-04 21:59:25 UTC (rev 3415)
+++ trunk/scipy/stats/kde.py	2007-10-05 10:08:16 UTC (rev 3416)
@@ -131,8 +131,7 @@
                 energy = sum(diff*tdiff,axis=0)/2.0
                 result[i] = sum(exp(-energy),axis=0)
 
-        det_cov = linalg.det(2*pi*self.covariance)
-        result /= sqrt(det_cov)*self.n
+        result /= self._norm_factor
 
         return result
 



More information about the Scipy-svn mailing list