10-29-2015 02:09 PM
Dear altenbach,
I started to look at all your posts about fit 2d (the oldest is in 2004) and I downloaded all your files 2Dquadratic planefit, 2Dscatterfit2,3Dpolyfit, XuFit_004. Also I read this https://decibel.ni.com/content/docs/DOC-30394
Ok...I am completely lost.
I would like to ask you from which of your files I should start. I would like to fit with the function z=a+bx+cx**2 + dy+ey**2+fxy (second order polynamial) a set of experimental data (x,y,z are experimental data, all of them are 1D vectors with the same dimension, furthermore they are very large vectors about 100000 entries each).
I did not understand:
1) what is the difference between gridded data and scattered data.
2) if you suggest the polynomial fit (building the H matrix) or the Lev Mar fit.
I also ask you if there are more recent vi's to start from, because the old ones are very very hard to understand.
Thank you in advance
Solved! Go to Solution.
10-29-2015 03:22 PM - edited 10-30-2015 02:11 AM
Use the newer one. Some of the old examples use homebuilt, pre LabVIEW 8.0 subroutines. The fitting tools received a major overhaul with LabVIEW 8.0 and should be used out of the box.
@gnappo wrote:
I would like to ask you from which of your files I should start. I would like to fit with the function z=a+bx+cx**2 + dy+ey**2+fxy (second order polynamial) a set of experimental data (x,y,z are experimental data, all of them are 1D vectors with the same dimension, furthermore they are very large vectors about 100000 entries each).
Since your problem is linear in the coefficients, you should use the general linear fit, constructing the H matrix from the terms. No need for iterative procedures such a lev-mar. Create your H matrix with the various terms for each xy pair.
Gridded data mans that the x and y values form a rectangular grid with no missing values, i.e. the 2D data can be represented as a simple 2D array. Scattered data means that there is a list of (x,y,z) points and x and/or y are not evenly spaced. You can run this in the two modes to immediately see the difference.
10-29-2015 09:24 PM
11-04-2015 01:11 PM
May I ask you 2 questions?
1) z=f(x,y). Do you know how should I calculate the statistical error to be associated to the best fit output vector?
2) I would like to use as weight the statistical errors not only for the experimental z values, but also for x and y. Do you know if there is a way to do that?
Thank you