[R] Calculating with tolerances (error propagation)

Jan private jrheinlaender at gmx.de
Thu Sep 9 12:50:54 CEST 2010


Hello Bernardo,

---------
If I understood  your problem this script solve your problem:

q<-0.15 + c(-.1,0,.1)
h<-10 + c(-.1,0,.1)
5*q*h
[1]  2.475  7.500 12.625
---------

OK, this solves the simple example. 
But what if the example is not that simple. E.g.

P = 5 * q/h

Here, to get the maximum tolerances for P, we need to divide the maximum
value for q by the minimum value for h, and vice versa. Is there any way
to do this automatically, without thinking about every single step?

There is a thing called interval arithmetic (I saw it as an Octave
package) which would do something like this.

I would have thought that tracking how a (measuring) error propagates
through a complex calculation would be a standard problem of
statistics?? In other words, I am looking for a data type which is a
number with a deviation +- somehow attached to it, with binary operators
that automatically knows how to handle the deviation.

Thank you,	
Jan



More information about the R-help mailing list