08-10-2011 06:04 AM
Hello everyone
I am using Linear Fit.vi to calculate Slope. Are there guidelines to make the right choice for "weight", "tolerance" and "method" taking into consideration the kind of data?
Thanks.
Dan07.
Solved! Go to Solution.
08-10-2011 10:35 AM
Hi dan07,
The linear fit help page gives some guidelines with weight and tolerance being of data type double and method being of data type U16. It also states that Weight should be the same size as Y etc.
Hope this answers your question and advises a little!
Tori
08-10-2011 12:59 PM
Don't wire the weight unless you have additional information about the data. For example if you know the standard deviation of each point because it is derived from several measurements, or if there is a known relation between x and the noise in the data. For example if certain points have a larger error, you could downweight them accordingly. (common is weight = 1/variance, see also).
The method is not a plain U16 but an enum, to get a correctly typed input simply right-click the terminal and "create control" or "create constant".
Tolerance is only used for the iterative methods (least absolute residual, bisquare). These are most useful if you have outliers in the data. Just try a few values over a few orders of magnitude and see how the results vary.
For regular use, only wire the x and y arrays and leave everything else at the default.
08-12-2011 11:25 AM
Altenbach
Thanks for helping. I followed you advice and used the Linear Fit at default settings, just wiring X and Y. Worked fine!
Dan07