02-27-2014 08:11 PM
Hello,
I am trying to compare a linear trendline in Excel with Linear Fit vi. The slope value what I get from Excel data and from LabVIEW match but not the intercept. How different are these two functions and which one is more accurate.
I am trying to do some voltages and current calibration, want to use LabVIEW but bit concerned with the intercept difference what I get. Please advice
Thanks
02-27-2014 08:16 PM - edited 02-27-2014 08:18 PM
Can you attach a typical dataset and tell us how much the result values differ. Also show is your LabVIEW code.
For example make sure that the indicators are wide enough (e.g. if the intecept is very close to zero, LabVIEW might display it as 5.45424e-17, but if the indicator is too narrow, you might not see the exponent and think it is 5.454. :D)
02-28-2014 11:15 AM
Hi,
[x] = [225,240.441,249.983,277.027,304.038,310.028]
[y] =[259.84,277.54,288.76,320.54,351.03,358.3]
Linear curve fitting equation from Excel is "y=1.1575x-0.5849
From LabVIEW :: Slope value 1.15507 and intercept : 0.0966
I use nothing other than Linear fit.vi with the above "x and y" array with "least absolute residual" as algorithm selected.
No wiring to Tolerance and weight inputs.
Thanks
02-28-2014 11:48 AM - edited 02-28-2014 11:57 AM
(Sorry, posting by phone).
"Least absolute residual" is not the common way to do linear fits and not the default.
How do they compare if you use the default method (least squares) instead?
02-28-2014 12:05 PM
Hi,
Values remain the same in Least square method too.
Slope - 1.15548, Intercept - 0.0966.
02-28-2014 12:18 PM
Using Excel 2007 and LV 2012 I get identical values. Slope = 1.15751 and intercept = -0.59163
02-28-2014 12:18 PM
02-28-2014 12:26 PM
Is it possible that your excel files contains extra decimal digits that are hidden?