[Scipy-tickets] [SciPy] #1285: polyfit documentation is wrong

SciPy Trac scipy-tickets@scipy....
Thu Sep 23 10:32:33 CDT 2010


#1285: polyfit documentation is wrong
-------------------------+--------------------------------------------------
 Reporter:  meawoppl     |       Owner:  somebody
     Type:  defect       |      Status:  new     
 Priority:  normal       |   Milestone:  0.9.0   
Component:  Other        |     Version:  0.7.0   
 Keywords:  whatthedoc?  |  
-------------------------+--------------------------------------------------
 In [38]: a = arange(50)

 In [39]: polyfit(a,a,1)
 Out[39]: array([  1.00000000e+00,   3.33920544e-15])

 The 0th element is clearly the slope, and the 1st the intercept.

 In the documentation it states that:
 . . .
 Fit a polynomial ``p(x) = p[0] * x**deg + ... + p[deg]`` of degree `deg`
 to points `(x, y)`. Returns a vector of coefficients `p` that minimises
 (Spelled wrong!) the squared
 . . .

 Where the polynomial ought to be reversed in the degrees.  It notably says
 that the highest power terms come first, so it even contradicts itself!

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1285>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list