Greg Willden gregwillden at gmail.com
Thu Oct 12 21:30:01 CDT 2006

On 10/12/06, Charles R Harris <charlesr.harris at gmail.com> wrote:
> And here is the location of the problem in numpy/linalg/linalg.py :
> def lstsq(a, b, rcond=1.e-10):
> The 1e-10 is a bit conservative. On the other hand, I will note that the
> condition number of the dot(V^T ,V) matrix is somewhere around 1e22, which
> means in general terms that you need around 22 digits of accuracy. Inverting
> it only works sorta by accident in the current case. Generally, using
> Vandermonde matrices and polynomial fits it a bad idea when the dynamic
> range of the interval gets large and the degree gets up around 4-5 as it
> leads to ill conditioned sets of equations. When you really need the best
> start with chebychev polynomials or, bestest, compute a set of polynomials
> orthogonal over the sample points. Anyway, I think rcond should be something
> like 1e-12 or 1e-13 by default and be available as a keyword in the polyfit
> function. If no one complains I will make this change, although it is just a
> bandaid and things will fall apart again as soon as you call polyfit(x,y,4).

Hey that's great.  I'm glad you tracked it down.

Pardon my ignorance of polyfit algorithm details.
Is there a way of choosing rcond based on N that would give sensible
defaults for a variety of N?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20061012/99a88411/attachment.html 
-------------- next part --------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
-------------- next part --------------
Numpy-discussion mailing list
Numpy-discussion at lists.sourceforge.net

More information about the Numpy-discussion mailing list