LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

General Polynomial Fit

I need to fit a polynomial function and extract the coefficients a0, a1, etc, of my data. But in the General Polynomial Fit i have to especified the order, is there any way to find automatically the polynomial order and then extract the coefficients? Thank you.
0 Kudos
Message 1 of 6
(3,176 Views)
Make a loop fitting several orders to your data (1 to 4 or so), analyse the error of the polynomial fit, and choose the version with the least error. The Polynomial fit VI has an output labelled mse (second from bottom on the right hand side). This is the mean squared error of the polynomial fit.

Any other method requires assumptions about your data form and shape.

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Message 2 of 6
(3,176 Views)
I would caution that with this method you might find that a really high order poly is likley to fit the data better. You should take into consideration how complex your data is (ie how many dimensions of x should model it).
0 Kudos
Message 3 of 6
(3,176 Views)
Yes, I agree with you.
for polynomial fit to work properly, the number of data points should be way (at least some order) above the number of parameters (coeffients) estimated.
0 Kudos
Message 4 of 6
(3,176 Views)
Like I said, any other approach requires assumptions about data form and shape. I once did a system to interface to a spectrometer receiving signals from an SPR sensor, fitting the resulting curve and getting sub-pixel resolution. I found that a 30th order polynomial (householder) fitted the data most satisfactorily (I tested 3 to 50). In many fit algorithms, increased order of polynomials do not always result in a better fit, sometimes they can be drastically worse.

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 5 of 6
(3,176 Views)
Thinking about this question again, I`m not sure I`ve answered the correct question at all.

My original method (Scanning different fit orders) will give aou an N-order Polynomial which fits the signal well, but the assumption that your signal is then also an N-order Polynomial is generally false. If you are simply looking for a polynomial which well describes your signal, this is OK.

If you are dealing with simple clean signals then you MIGHT be able to make assumptions on the signal type based on various fit coefficients, but if you`re trying to understand fundamentals of a real-world complex signal based on fit-algorithm errors, I would be, in addition to the other respondants, very cautious. I`m not a very good mathmatecian (I love that the fit algorith
ms simply ), so I can`t begin to give a hint as to do this kind of analysis.

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 6 of 6
(3,176 Views)