[R] Calculating with tolerances

Jeff Newmiller jdnewmil at dcn.davis.ca.us
Fri Sep 10 02:46:36 CEST 2010


I think the reason this type of computation is not performed more routinely is the correlation issue.  If two quantities are negatively correlated, the standard deviation of a result computed with them may actually be smaller (percentage-wise) than the larger off the original two standard deviations. Estimation techniques that routinely yield values larger than those observed in practice will not be used by experienced analysts, whether they know why the technique is flawed or not.

In addition, the variety of error distributions that occur in practice would mean every calculation would involve a convolution of probability density distributions.  Normal distributions are common for statistical measures of central tendency, but not really so common in engineering measurement.

"Kjetil Halvorsen" <kjetilbrinchmannhalvorsen at gmail.com> wrote:

>I tried RSiteSearch("Interval aritmetic")
>which gives zero hits.
>
>There exist a   http://www.boost.org/
>free software library for interval aritmetic, which it shoub be
>possible to link to R.
>
>Kjetil
>
>On Thu, Sep 9, 2010 at 6:28 PM, Carl Witthoft <carl at witthoft.com> wrote:
>>
>> That won't do much good.  Tolerances don't add (except in rare
>> circumstances), and certainly not when they're in different units.
>>
>> There's nothing wrong with the first part, i.e. setting up variables whose
>> contents include the mean and the tolerance, but is that peak? or sigma?
>>  and so on.
>>
>> Then you need to apply the errors properly.  If the variables are
>> uncorrelated, there are some simple formulas for calculating the variance of
>> a product based on the magnitudes of the items and on their variances.
>>  Stuff all that into some function
>>
>> product.tolerance<- function(q,h){
>>        productmean = 5*q[1]*h[1]
>>        productvariance = 5*q[1]^2*h[2] + 5*h[1]^2*q[2] + q[2]*h[2]*5
>>        return(list(productmean,productvariance)
>>        }
>> That's not exactly correct, but you see how this goes.
>>
>> Carl
>>
>> <quote>
>> From: Bernardo Rangel Tura <tura_at_centroin.com.br>
>> Date: Thu, 09 Sep 2010 05:58:35 -0300
>>
>> On Thu, 2010-09-09 at 09:16 +0430, Jan private wrote:
>>> Dear list,
>>>
>>> I am from an engineering background, accustomed to work with tolerances.
>>>
>>> For example, I have measured
>>>
>>> Q = 0.15 +- 0.01 m^3/s
>>> H = 10 +- 0.1 m
>>>
>>> and now I want to calculate
>>>
>>> P = 5 * Q * H
>>>
>>> and get a value with a tolerance +-
>>>
>>> What is the elegant way of doing this in R?
>>>
>>> Thank you,
>>> Jan
>>
>> Hi Jan,
>>
>> 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
>> </quote>
>>
>> ______________________________________________
>> R-help at 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.
>>
>
>______________________________________________
>R-help at 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.

---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.



More information about the R-help mailing list