[Matplotlib-users] polyfit degree problem ?

 [Matplotlib-users] polyfit degree problem ? From: sa6113 - 2008-05-03 08:11:12 ```Dear All, I have a problem using polyfit with a degree greater than 118 : The code is : matplotlib.mlab.polyfit( x, y, pow ) # pow is degree of polynomial for pow in range 118 and 238 the error is : LinAlgError, 'singular martix' and for pow greater than 237 this error raise : OverflowError : math range error -- View this message in context: http://www.nabble.com/polyfit-degree-problem---tp17032710p17032710.html Sent from the matplotlib - users mailing list archive at Nabble.com. ```

 [Matplotlib-users] polyfit degree problem ? From: sa6113 - 2008-05-03 08:11:12 ```Dear All, I have a problem using polyfit with a degree greater than 118 : The code is : matplotlib.mlab.polyfit( x, y, pow ) # pow is degree of polynomial for pow in range 118 and 238 the error is : LinAlgError, 'singular martix' and for pow greater than 237 this error raise : OverflowError : math range error -- View this message in context: http://www.nabble.com/polyfit-degree-problem---tp17032710p17032710.html Sent from the matplotlib - users mailing list archive at Nabble.com. ```
 Re: [Matplotlib-users] polyfit degree problem ? From: John Hunter - 2008-05-03 16:27:11 ```On Sat, May 3, 2008 at 3:11 AM, sa6113 wrote: > > Dear All, > > I have a problem using polyfit with a degree greater than 118 : > > The code is : > matplotlib.mlab.polyfit( x, y, pow ) # pow is degree of polynomial > > for pow in range 118 and 238 the error is : > LinAlgError, 'singular martix' > > and for pow greater than 237 this error raise : > OverflowError : math range error matplotlib.mlab.polyfit is deprecated (and is a thin wrapper to numpy.polyfit in the current implementation). Please direct polyfit questions and problems to the numpy list. JDH ```
 Re: [Matplotlib-users] polyfit degree problem ? From: Eric Firing - 2008-05-03 17:59:36 ```sa6113 wrote: > Dear All, > > I have a problem using polyfit with a degree greater than 118 : The problem is that polynomial fitting generally doesn't make sense for degree higher than 4 or 5--if that--and at very high degree it is inevitable that the matrix will become singular. In other words, there is not enough information in the data to uniquely determine the fit. Whatever it is you are trying to to, fitting a polynomial with a high degree is the wrong way to do it. Eric > > The code is : > matplotlib.mlab.polyfit( x, y, pow ) # pow is degree of polynomial > > for pow in range 118 and 238 the error is : > LinAlgError, 'singular martix' > > and for pow greater than 237 this error raise : > OverflowError : math range error ```