[Scipy-svn] r5553 - trunk/scipy/optimize

scipy-svn@scip... scipy-svn@scip...
Sat Feb 14 16:03:00 CST 2009


Author: oliphant
Date: 2009-02-14 16:02:56 -0600 (Sat, 14 Feb 2009)
New Revision: 5553

Modified:
   trunk/scipy/optimize/minpack.py
Log:
Fix-up covariance estimates in the weighted non-linear least-squares problem by removing the un-necessary normalization.

Modified: trunk/scipy/optimize/minpack.py
===================================================================
--- trunk/scipy/optimize/minpack.py	2009-02-14 21:09:36 UTC (rev 5552)
+++ trunk/scipy/optimize/minpack.py	2009-02-14 22:02:56 UTC (rev 5553)
@@ -359,8 +359,8 @@
         f(xdata, *popt) - ydata is minimized
     pcov : 2d array
         A covariance matrix providing an estimate of the covariance matrix of
-        the parameter estimates.   This may not be accurate when sigma 
-        is given. 
+        the parameter estimates.   
+       
 
     Notes
     -----
@@ -405,8 +405,6 @@
 
     if (len(ydata) > len(p0)) and pcov is not None:
         s_sq = (func(popt, *args)**2).sum()/(len(ydata)-len(p0))
-        if sigma is not None:
-            s_sq /= (args[-1]**2).sum()
         pcov = pcov * s_sq
     else:
         pcov = inf



More information about the Scipy-svn mailing list