Math question: relative and absolute error

Can anyone help me with this:

I have a relative (%) error for a variable 1/x: denote by REL(1/x)

from here am I correct in saying that the absolute error ABS(1/x) is calculated from

ABS(1/x) = (1/x)*REL(1/x) ?

That’s the bit I’m pretty sure of.

What I ACTUALLY need to calculate is the absolute error of x, ABS(x)

So starting with REL(1/x) how do I get ABS(x)?

Cheers,
David

This sounds like some sort of course assignment, so I won’t give you the full answer, but I will point you to this site on error propagation, which should answer your question. (Also, I’ll tell you that your expression for ABS(1/x), in your notation, is correct.)

I thought people might assume this!

I’m a research student and we’re altering an existing program to calculate something different. I’m not very familiar with error calcuation (having stuck to mostly theoretical stuff) but we need some idea of how accuarate our results are and since the main quantity we’re dealing with is the inverse of one of the quantities in the program, for which the relative error is calculated, the absolute error is required.

[MikeS], I’ve had a look at that link you posted, and here’s what I think:

using the formula ABS[f(x)] = f[x + ABS(x)] - f(x)

(I think i’ve interpreted this ok but i’m not 100% sure…)

So let f(x) = 1/x and then I do a little algebra and get this:

ABS(x) = 1/(ABS[1/x] + 1/x) - x

Looks more or less ok to me, but like I said, I’m not wildly knowledgeable on error calculations. Also, it would be nice to have some kind of explaination for the original formula at the top of this post - looks like something to do with a derivative?

Cheers,
David

…this returns negative values for ABS(x) which kind of indicates I’ve messed up somewhere…unless its ok to take the modulus of this equation? Given its a kind of plus-or-minus this quantity thing…?

Ah, good. Since this isn’t a homework problem, I get to show off my error propagation mojo. :slight_smile:

For convenience, let y = 1/x. You have REL(y), which translates into Dy / y in the page’s notation. Since y = x[sup]-1[/sup], you can scroll down to the subsection “Products of Powers” and see that in this case, REL(x) = REL(y). Finally, since REL(x) = ABS(x) / x, this means that ABS(x) = REL(1/x) * x. The formula you derived agrees with this formula in the limit that REL(1/x) is much less than one, and since that’s probably a good approximation, it’ll be worth your while to use the simpler one.

Also, the “standard deviation” method described in the link I gave is much more accurate than the straight “addition of errors” method also described there; if you ever need to calculate errors entering into a quantity that depends on multiple variables, use the standard deviation method.

Finally, you’re right in saying that a negative error value is functionally the same as a positive one, since it’s a plus-or-minus thing.

Feel free to post again with further questions, and I’ll do my best to answer them.

Thanks for the explaination, so you’re basically saying that either the formula I derived or the one you derived ABS(x) = REL(1/x)*x is ok?

The kind of relative errors (for 1/x) we’re looking at here are varying from about maybe .2 to .001 if that makes any difference.

Again, thanks for the help.

Short answer: they’re probably both OK for your purposes, since you only need “some idea” about the accuracy of your results.

Long answer (a little technical, requires some calculus): your answer is a little more accurate. You can rearrange your formula to read

ABS(x) = x * (1 + REL(1/x))[sup]-1[/sup] - x

Now if REL(1/x) is less than one, we can expand (1 + REL(1/x))[sup]-1[/sup] in a Taylor series about REL(1/x) = 0:

(1 + REL(1/x))[sup]-1[/sup] = 1 - REL(1/x) + (REL(1/x))[sup]2[/sup] + …

This means that

ABS(x) = x * (1 - REL(1/x) + (REL(1/x))[sup]2[/sup] + … ) - x
= - x REL(1/x) + x (REL(1/x))[sup]2[/sup] + …

Now if REL(1/x) is much less than one, then the second term (and all subsequent terms) will be much smaller than the first term, and we can say that the whole expression is approximately equal to its first term, i.e. ABS(x) = x * REL(1/x). You’re making a small misestimation of your error, though; since the ratio of the second term to the first term is just REL(1/x), then your estimation of ABS(x) may be off by a percentage roughly equal to REL(1/x). So if REL(1/x) = 0.2, then the value of ABS(x) you get from the simpler formula will be accurate to within about 20%; if REL(1/x) = 0.01, the simpler formula will be accurate to within about 0.1%. It’s a little confusing, I know…

OK so I said ‘some idea’, I actually need to be as accurate as possible. Am I still ok or is there another level of accuracy I can get to?