From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

polynomial fits

I need to do a simple 2D polynomail fits (linear and parabola). Is there any vi's I can use to obtain the best fits with errors?
 
 
 
0 Kudos
Message 1 of 2
(3,285 Views)
Sorry, are you just looking for a polynomial fit with 1 independent variable (xy) giving you a line curve  or with 2 independent variables, giving you e.g. a parabolic plane.
 
for the first case, there is a plain polynomial fit, but unfortunately it does not give you parameter errors.
 
However, both (1D and 2D) are simple linear systems so you should be able to setup a H matrix and use "general LS fit" from the fitting palette. One of the outputs is the covariance matrix which will let you calculate the parameter error from the diagonal elements.
 
 
For a comparison of a 2D polynomial and levenberg Marquardt fit, have a look at my example:
 
 
The code shows how to setup the H matrix for a polynomial with 2 independent variables. For a simple polynomial with one independent variable it is even much simpler.
 
Let me know if you need more help.
0 Kudos
Message 2 of 2
(3,276 Views)