[Numpy-discussion] polyfit

2013-12-18 Thread Alan G Isaac
For teaching it is certainly nice to have numpy.polynomial.polynomial.polyfit providing modern (vs. traditional) parameter order, but - it is rather buried - np.polyfit uses traditional order and has the same name I recall there was some controversy (?) over all of this, but might it not be

Re: [Numpy-discussion] polyfit

2013-12-18 Thread Charles R Harris
On Wed, Dec 18, 2013 at 3:23 PM, Alan G Isaac alan.is...@gmail.com wrote: For teaching it is certainly nice to have numpy.polynomial.polynomial.polyfit providing modern (vs. traditional) parameter order, but - it is rather buried - np.polyfit uses traditional order and has the same name I

Re: [Numpy-discussion] polyfit

2013-12-18 Thread Charles R Harris
On Wed, Dec 18, 2013 at 3:38 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Dec 18, 2013 at 3:23 PM, Alan G Isaac alan.is...@gmail.comwrote: For teaching it is certainly nice to have numpy.polynomial.polynomial.polyfit providing modern (vs. traditional) parameter order,

Re: [Numpy-discussion] polyfit with fixed points

2013-03-07 Thread Charles R Harris
On Thu, Mar 7, 2013 at 9:22 AM, eat e.antero.ta...@gmail.com wrote: Hi, On Thu, Mar 7, 2013 at 1:52 AM, Jaime Fernández del Río jaime.f...@gmail.com wrote: On Tue, Mar 5, 2013 at 5:23 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, Mar 5, 2013 at 12:41 AM, Jaime

Re: [Numpy-discussion] polyfit with fixed points

2013-03-06 Thread Jaime Fernández del Río
On Tue, Mar 5, 2013 at 5:23 AM, Charles R Harris charlesr.har...@gmail.comwrote: On Tue, Mar 5, 2013 at 12:41 AM, Jaime Fernández del Río jaime.f...@gmail.com wrote: On Mon, Mar 4, 2013 at 8:37 PM, Charles R Harris charlesr.har...@gmail.com wrote: There are actually seven versions of

Re: [Numpy-discussion] polyfit with fixed points

2013-03-06 Thread Charles R Harris
On Wed, Mar 6, 2013 at 4:52 PM, Jaime Fernández del Río jaime.f...@gmail.com wrote: On Tue, Mar 5, 2013 at 5:23 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, Mar 5, 2013 at 12:41 AM, Jaime Fernández del Río jaime.f...@gmail.com wrote: On Mon, Mar 4, 2013 at 8:37 PM,

Re: [Numpy-discussion] polyfit with fixed points

2013-03-05 Thread Charles R Harris
On Tue, Mar 5, 2013 at 12:41 AM, Jaime Fernández del Río jaime.f...@gmail.com wrote: On Mon, Mar 4, 2013 at 8:37 PM, Charles R Harris charlesr.har...@gmail.com wrote: There are actually seven versions of polynomial fit, two for the usual polynomial basis, and one each for Legendre,

Re: [Numpy-discussion] polyfit with fixed points

2013-03-05 Thread Charles R Harris
On Tue, Mar 5, 2013 at 6:23 AM, Charles R Harris charlesr.har...@gmail.comwrote: On Tue, Mar 5, 2013 at 12:41 AM, Jaime Fernández del Río jaime.f...@gmail.com wrote: On Mon, Mar 4, 2013 at 8:37 PM, Charles R Harris charlesr.har...@gmail.com wrote: There are actually seven versions of

Re: [Numpy-discussion] polyfit with fixed points

2013-03-05 Thread David Pine
Jaime, If you are going to work on this, you should also take a look at the recent thread http://mail.scipy.org/pipermail/numpy-discussion/2013-February/065649.html, which is about the weighting function, which is in a confused state in the current version of polyfit. By the way, Numerical

[Numpy-discussion] polyfit with fixed points

2013-03-04 Thread Jaime Fernández del Río
A couple of days back, answering a question in StackExchange ( http://stackoverflow.com/a/15196628/110026), I found myself using Lagrange multipliers to fit a polynomial with least squares to data, making sure it went through some fixed points. This time it was relatively easy, because some 5

Re: [Numpy-discussion] polyfit with fixed points

2013-03-04 Thread Jaime Fernández del Río
On Mon, Mar 4, 2013 at 4:53 PM, Aron Ahmadia a...@ahmadia.net wrote: Interesting, that question would probably have gotten a different response on scicomp, it is a pity we are not attracting more questions there! I know there are two polyfit modules in numpy, one in numpy.polyfit, the other

Re: [Numpy-discussion] polyfit with fixed points

2013-03-04 Thread Charles R Harris
On Mon, Mar 4, 2013 at 5:53 PM, Aron Ahmadia a...@ahmadia.net wrote: Interesting, that question would probably have gotten a different response on scicomp, it is a pity we are not attracting more questions there! I know there are two polyfit modules in numpy, one in numpy.polyfit, the other

Re: [Numpy-discussion] polyfit with fixed points

2013-03-04 Thread Charles R Harris
On Mon, Mar 4, 2013 at 5:23 PM, Jaime Fernández del Río jaime.f...@gmail.com wrote: A couple of days back, answering a question in StackExchange ( http://stackoverflow.com/a/15196628/110026), I found myself using Lagrange multipliers to fit a polynomial with least squares to data, making

Re: [Numpy-discussion] polyfit with fixed points

2013-03-04 Thread Jaime Fernández del Río
On Mon, Mar 4, 2013 at 8:37 PM, Charles R Harris charlesr.har...@gmail.comwrote: There are actually seven versions of polynomial fit, two for the usual polynomial basis, and one each for Legendre, Chebyshev, Hermite, Hermite_e, and Laguerre ;) Correct me if I am wrong, but the fitted

[Numpy-discussion] polyfit in NumPy v1.7

2013-02-27 Thread David Pine
As of NumPy v1.7, numpy.polyfit includes an option for providing weighting to data to be fit. It's a welcome addition, but the implementation seems a bit non-standard, perhaps even wrong, and I wonder if someone can enlighten me. 1. The documentation does not specify what the weighting array w

Re: [Numpy-discussion] polyfit in NumPy v1.7

2013-02-27 Thread Charles R Harris
On Wed, Feb 27, 2013 at 6:46 AM, David Pine djp...@gmail.com wrote: As of NumPy v1.7, numpy.polyfit includes an option for providing weighting to data to be fit. It's a welcome addition, but the implementation seems a bit non-standard, perhaps even wrong, and I wonder if someone can enlighten

Re: [Numpy-discussion] polyfit in NumPy v1.7

2013-02-27 Thread josef . pktd
Please post inline so we have the context. On Wed, Feb 27, 2013 at 9:40 AM, David Pine djp...@gmail.com wrote: Chuck, Thanks for the quick reply. 1. I see your point about zero weights but the code in its current form doesn't take into account zero weights in counting the degrees of

Re: [Numpy-discussion] polyfit in NumPy v1.7

2013-02-27 Thread David Pine
Pauli, Josef, Chuck, I read over the discussion on curve_fit. I believe I now understand what people are trying to do when they write about scaling the weighting and/or covariance matrix. And I agree that what polyfit does in its current form is estimate the absolute errors in the data from the

Re: [Numpy-discussion] polyfit in NumPy v1.7

2013-02-27 Thread josef . pktd
On Wed, Feb 27, 2013 at 3:01 PM, David Pine djp...@gmail.com wrote: Pauli, Josef, Chuck, I read over the discussion on curve_fit. I believe I now understand what people are trying to do when they write about scaling the weighting and/or covariance matrix. And I agree that what polyfit does

[Numpy-discussion] polyfit on multiple data points

2009-04-13 Thread Mathew Yeates
Hi, I understand how to fit the points (x1,y1) (x2,y2),(x3,y3) with a line using polyfit. But, what if I want to perform this task on every row of an array? For instance [[x1,x2,x3], [s1,s2,s3]] [[y1,y2,y3,], [r1,r2,r3]] and I want the results to be the coefficients [a,b,c] and [d,e,f]

Re: [Numpy-discussion] polyfit on multiple data points

2009-04-13 Thread josef . pktd
On Mon, Apr 13, 2009 at 5:59 PM, Mathew Yeates myea...@jpl.nasa.gov wrote: Hi, I understand how to fit  the points (x1,y1) (x2,y2),(x3,y3) with a line using polyfit. But, what if I want to perform this task on every row of an array? For instance [[x1,x2,x3],  [s1,s2,s3]] [[y1,y2,y3,],  

[Numpy-discussion] Polyfit

2008-06-16 Thread Chandler Latour
Hello, I'm new to the whole numpy scene, but I've been wanting to run a regression on some data. I belive that polyfit is the way to go, but I was wondering if there exists a way to force the intercept to be 0. Any help would be much appreciated. Thanks

Re: [Numpy-discussion] Polyfit

2008-06-16 Thread Charles R Harris
On Mon, Jun 16, 2008 at 1:30 PM, Chandler Latour [EMAIL PROTECTED] wrote: Hello, I'm new to the whole numpy scene, but I've been wanting to run a regression on some data. I belive that polyfit is the way to go, but I was wondering if there exists a way to force the intercept to be 0. Any

Re: [Numpy-discussion] Polyfit

2008-06-16 Thread Chandler Latour
Yes, exactly what I meant. On Jun 16, 2008, at 2:39 PM, Charles R Harris wrote: On Mon, Jun 16, 2008 at 1:30 PM, Chandler Latour [EMAIL PROTECTED] wrote: Hello, I'm new to the whole numpy scene, but I've been wanting to run a regression on some data. I belive that polyfit is the way to

Re: [Numpy-discussion] Polyfit

2008-06-16 Thread Charles R Harris
On Mon, Jun 16, 2008 at 1:47 PM, Chandler Latour [EMAIL PROTECTED] wrote: Yes, exactly what I meant. Polyfit just fits polynomials, there is no way of fixing the constant to zero. Your best bet is to use linalg.lstsq directly to fit the function you want. Chuck

Re: [Numpy-discussion] Polyfit

2008-06-16 Thread Simon Palmer
At the risk of uttering a heresy, are you bound to Python for this? I bet you could find a C library that will work well, plus it is not a hard algorithm to code yourself. I am pretty sure I have used a numerical recipes algorithm for regression in my distant past. Also I can't help thinking

Re: [Numpy-discussion] Polyfit

2008-06-16 Thread Chandler Latour
I believe I'm bound to python. In terms of forcing the regression through the origin, the purpose is partly for visualization but it also should fit the data. It would not make sense to model the data with an initial value other than 0. On Jun 16, 2008, at 4:33 PM, Simon Palmer wrote:

Re: [Numpy-discussion] Polyfit

2008-06-16 Thread Anne Archibald
2008/6/16 Chandler Latour [EMAIL PROTECTED]: I believe I'm bound to python. In terms of forcing the regression through the origin, the purpose is partly for visualization but it also should fit the data. It would not make sense to model the data with an initial value other than 0. Polyfit is