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.
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.
04-27-2019 08:29 AM
Hi
I have some "simple" questions.
I am trying to fit a straight line, I have done this many times in the past. However for this data (see below) Igor gives me a slope of 254.3 +/- 11.6
In labview, see attached vi, with the same data I get 254.3 (ok !) with delta slope = 0
Why delta slope is "0" ? As one can see from the data, there is some space between lower and upper limits.
Also, is there a labview vi that gives the slope and the esd of the slope if X and Y arrays have some esd ? (I suspect "ponderation" is to be used, but it is not to me clear how exactly )
thanks for any idea
Solved! Go to Solution.
04-27-2019 02:01 PM
An interesting question/problem. I tried it, and tried playing with it, and learned some things (always a good thing!). Here are some observations:
Bob Schor
04-27-2019 02:18 PM
Hi
Thanks for your answer. The order of the arrays is not important (just funny for graphing), anyway I ordered them.
Note that RMSE is not 0 though (see modified version)
Regards
04-27-2019 03:11 PM
I can't "see" inside the code NI is using, so I'm uncertain as to the reason for this value. One (strong) possibility is that with only 5 points, there are not enough data to make a sensible estimate of the upper and lower limit for a linear fit. Try generating a 10-point set and see if that gives you a reasonable number. Two points determine an "exact" line, three allow you to have "error", but if you want to put a measure on the Error, you need more than a single sample (which means more points) ...
Bob Schor
04-28-2019 01:39 AM
Hi
Thanks for yuour answer, althtough I don't agree with it. Matthematically, even with 3 points one can calculate a esd of a slope (it has one degree of libherty). Igor and Origin can calculate that, why not LV ???
Anyway, I put 2 more points :
Igor gives a slope of 279.07 with 16.1 esd
LV gives 287. with delta 4.9 E-17 !! (Funny thing, the intercept and its delta is similar for both programs !)
What I am doing wrong ? I have calculate slopes before in LV and all was OK.
For testing with my data, I attached the code here.
Thanks
04-28-2019 11:43 AM - edited 04-28-2019 11:46 AM
You are running into conditioning problems, because your inputs are poorly scaled. Multiply your x-values with 1E9 and you get a nonzero value and then calculate the scaled value back later. (And no, higher order polynomial would make conditioning even worse (e.g. ~1e-18 for the quadratic terms).
04-28-2019 11:49 AM
Hi
That must be it. Thanks !
(Just a thought : how come Igor -treating the same data- does not have the same conditioning problem ?? Maybe they are adjusting the X values internally ?)
Anyway, that solves my problem
thanks again
N