Help with Error analysis!

  • Thread starter Thread starter sid
  • Start date Start date

sid

sid

Soldato
Joined
9 Feb 2003
Posts
5,178
Location
London
Hi guys,

say you have a set of 3 points x1,x2,x3 each of which have corresponding errors s1,s2,s3

You plot this using a X-Y scatter graph against points y1,y2,y3

And try to put a straight line fit through it.

Basically the way I see this, since you have individual errors for x1, x2, x3 there will be a range of gradients with which you can fit this straight line yeah?

So how do you get a value for this gradient with errror bars? I know excel can't do this, but any other programs?

I hope i have explained myself clearly.
Y values don't have an error btw.

sid
 
ok program downloaded and installed

how do i do what i want with it then

sid

edit/

I'm not even sure what I'm trying to do here is the best thing? if you have 3 data points and the thing you want to find out is the gradient, then do the errors in the individual points matter? cos doesn't the fact that I'm using the gradient get around that.

sid
 
Last edited:
Matlab has some brilliant line of best fit plots in the cftool program.

yeah but i'm sort of looking for the error in the gradient of the straight line equation of the 3 points

you can fit multiple straight lines through 3 points within their error margins

not sure how to compute it,

not found anything in cftool btw

sid
 
I'd say that seen as you are sort of treating the gradient as a variable then you can use the errors equation.
Error in m(x,y,...),
Sm = Sq rt [ (dm/dx)^2 . Sx^2 + (dm/dy)^2 . Sy^2 + ...]
where Sm is the error in m, Sx error in x etc.

You started with y = mx + c, rearrange to m= (y-c)/x
There's no error in y (Sy=0) so scrap that part of the error equation and be left with
Sm = Sq rt [ {(y-c)/x^2}^2 . Sx^2 ]

Put numbers in and you have your error in the gradient.

Alternatively, faff around trying to see how far you can take the line before it doesnt fit through one of the error bars. There must be some way of doing it electronically - I just don't happen to know one.

Hope that's good enough for you.
 
I see where you are getting at with that but

There are a range of different values for X and Y and each X value has a different error.

So I don't have single values for x or y to plug in.
 
OK heres what you get after plotting the actual points in matlab

Linear model Poly1:
f(x) = p1*x + p2
Coefficients (with 95% confidence bounds):
p1 = 0.8249 (0.7659, 0.8839)
p2 = -0.4761 (-28.39, 27.44)

Goodness of fit:
SSE: 6.947
R-square: 1
Adjusted R-square: 0.9999
RMSE: 2.636

That 95% confidence thing doesn't make much sense to me because the curve fits pretty much bang on so why the error shift.

sid
 
Back
Top Bottom