LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

standard deviation for the slope from Linear Fit

Solved!
Go to solution

I need the standard deviation of the slope from the linear fit. 

Please confirm to me if what I am doing is correct.

I am using the "delta slope" from the Linear Fit Intervals changing the confidence level from 0.95 to 0.68. 

But still I am not sure that I can identify the delta slope as the standard deviation of the slope.

Thank you

0 Kudos
Message 1 of 12
(6,640 Views)

Hi,

as you can read in LabVIEW help for Linear Fit Intervals VI, delta slope returns the confidence radius of slope.

Isn't this what you need?

I hope this helps!

Bye!

 

Licia

0 Kudos
Message 2 of 12
(6,610 Views)

Actually this is exactly my question: is the radius the standard deviation?
As I read in this post it appeears to be a factor of 2, but no one confirmed to him.
http://forums.ni.com/t5/LabVIEW/confidence-interval-delta-slope/m-p/1009651

0 Kudos
Message 3 of 12
(6,602 Views)
Solution
Accepted by topic author gnappo

Hi,

I did some more research.

From what I understand, delta slope (or confidence radius) can also be referred to as margin of error.

You may need to do some more research on your own regarding this, but it seems that the two are different types of analysis. Standard deviation is a measure of the variability of a data set, whereas the delta slope (or margin of error) refers to the amount of random sampling error. Whether you can obtain a direct relationship between the two, I am not sure, however the first link below indicates that this can be done.

http://stattrek.com/AP-Statistics-4/Margin-of-Error.aspx?Tutorial=AP

http://en.wikipedia.org/wiki/Standard_deviation

http://en.wikipedia.org/wiki/Confidence_interval

http://en.wikipedia.org/wiki/Margin_of_error

I hope this provides some more insight.

As for the algorithm we use in Linear Fit Interval VI, I think the following document could be a good start.  There is a section called "confidence interval and prediction interval".    It describes the algorithm we use.

I hope this helps!

Bye,

 

Licia

Message 4 of 12
(6,595 Views)

Thanks Lyciap, as far as I understand the sdev of the slope = delta slope/(2*student inverse cumulative etc. etc.) which is really complicate.
Is there an easier way to get it with labview?

PS: I am a physicist. I like labview and I would like to use it as much as possible, but labview is NOT physicists-friendly.
For us any number is meaningless  if it is not associated with an error, which is the standard deviation.
Further graphs cannot be shown without the errors, and labview doesn't support that, because the graph with errors is not user friendly as the xy graph. Further it doesn't support the x errors. One can use the subvi given by a user (of Amsterdam if I remember correctly), but then the plot legend become a disaster because the errors are seen as independent plots.
Further we love to work with ntuplas (for the physicists around here: like the ones in paw and root), but labview doesn't support that.
Conclusion for labview developers: try to make us a little bit happier!

0 Kudos
Message 5 of 12
(6,582 Views)

As a physicist I have come to accept that there will always be tension with the lunkheads developers, and that the physicists will always lose.  As it should be, since we are inherently adaptable and tend to do our own thing anyways.

 

About this particular VI I can't say much since I never use it.  I have my own non-linear fit routines when I want confidence in my confidence limits.  What is missing in these discussions is the setting you choose for confidence level in the Confidence interval VI.  The default appears to be 0.95.  If you want to get the sdev you should really be using 0.68, and assuming normal errors, etc. that should be the source of this factor of 2 being thrown around.  Your method of changing from 0.95 (2 sigma) to 0.68 (1 sigma) is a roundabout way of doing it, but should work.

 

Try this experiment:

1. Generate fake data (Line + Gaussian noise) and save to Spreadsheet file.

2. Fit this data using LV and find the delta slope with 0.68 confidence level.

3. Use a different package (Matlab, Mathematica, Origon, Igor,...) to fit the SAME data and get the standard deviation.

4. Compare.

 

If they are different, let me know and I will try to dig a bit deeper, but if I take LV terminology at face value, then it should be the same result.  (Most bets are off if your errors are non-normal).

Message 6 of 12
(6,567 Views)

I don't think they are lunkheads. Labview is very useful anengineers even on topics we both are expert of...d simplified many things I had to do. It is just a problem of communication because each community has its own language. I find it difficult even to speak withengineers even on topics we both are expert...

0 Kudos
Message 7 of 12
(6,554 Views)

Perhaps still early in your training as a physicist, arrogance and self-righteousness will sink in with time.  Smiley Wink

 

Of course if I thought they were all lunkheads I wouldn't be 'virtually' hanging around them so often. 

 

Spoiler
And, just in case, I apologize to any lunkheads I may have upset by associating them with developers....Smiley Very Happy

 

 

Let me know how the curve fitting experiment turns out.

 

 

 

0 Kudos
Message 8 of 12
(6,540 Views)

Thank you to both of you. I checked as Darin said and I confirm thet the sdev is the delta slope when 0.683 is the confidence level.
Further it has to be divided by the output of the inverse cumulative for the student distribution giving as inputs 1-(1-0.68)/2 and number of points-2 (n dof).

Message 9 of 12
(6,488 Views)

Like Darin, I am (was?) a physicist, as well.  When I was doing industrial physics for a living, I rarely used the standard non-linear fit VIs for anything other than getting starting points for more robust fitting algorithms.  I can highly recommend the downhill simplex method used with a Lorentzian error distribution.  It is very robust against outliers - something a fit using a Gaussian error distribution is not.  If the previous sentences read like Greek to you, check out the chapters on data estimation in the online Numerical Recipes books.  Write a few test solutions in LabVIEW (very easy, since the major algorithms are already there) and check out the differences in results.

 

Good luck!  Have fun!

Message 10 of 12
(6,429 Views)