"Jan private" <jrheinlaen...@gmx.de> wrote in message news:1284029454.2740.361.ca...@localhost.localdomain... > 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 > Ahhh! "tracking how a (measuring) error propagates through a complex calculation"
That doesn't depend only on values+errors, it also depends on the calculations, so - as you imply - you'd have to define a new data type and appropriate methods for all the mathematical operators (not just the binary ones!). Not a trivial task! If you don't already know it, you should look at "Evaluation of measurement data - Guide to the expression of uncertainty in measurement" http://www.bipm.org/utils/common/documents/jcgm/JCGM_100_2008_E.pdf especially section 5. Hope that helps, Keith J ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.