LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel and LabVIEW curve fitting

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

0 Kudos
Message 1 of 8
(3,447 Views)

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)

0 Kudos
Message 2 of 8
(3,445 Views)

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

 

 

0 Kudos
Message 3 of 8
(3,399 Views)

(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?

0 Kudos
Message 4 of 8
(3,392 Views)

Hi,

 

Values remain the same in Least square method too. 

 

Slope - 1.15548, Intercept - 0.0966.

 

 

0 Kudos
Message 5 of 8
(3,381 Views)

Using Excel 2007 and LV 2012 I get identical values. Slope = 1.15751 and intercept = -0.59163

0 Kudos
Message 6 of 8
(3,374 Views)
Can you also attach your excel file?

(Still on the road, will test later).
0 Kudos
Message 7 of 8
(3,373 Views)

Is it possible that your excel files contains extra decimal digits that are hidden?

0 Kudos
Message 8 of 8
(3,365 Views)