# GUM: Propagation of Measurement Uncertainty for Typical Metrology... In metRology: Support for Metrological Applications

## Description

A function for propagation of measurement uncertainty for typical metrology applications using the methods from the Joint Committee on Guides in Metrology (JCGM) Guide to the Expression of Uncertainty in Measurement (GUM). This approach approximates the uncertainty of a function of random variables that define a measurement result by computing the uncertainty of the first-order Taylor series for the measurement function. This function also serves as the primary computational tool underlying the GUM uncertainty templates found in the metRology for Microsoft Excel user interface.

## Usage

 ```1 2``` ```GUM(var.name, x.i, u.i, nu.i, measurement.fnc, correlation = diag(length(var.name)), shared.u.i = var.name, cl = 0.95, cov.factor = "Student's t", sig.digits.U = 2, ...) ```

## Arguments

 `var.name` Character vector of input variable names. `x.i` Vector of input variable values. `u.i` Vector of standard uncertainties (i.e. standard errors) for each input variable value. `nu.i` Degrees of freedom associated with each standard uncertainty. `measurement.fnc` Character string specifying the functional relationship between input variables that defines the output measurement result. `correlation` Matrix giving the correlation between the different input variable values. Default is to assume no correlation between input variable values. `shared.u.i` Character vector giving the relative relationship between the standard uncertainties for each variable value. Groups of variables based on a common shared standard uncertainty will all share the same variable name. The default is to assume all standard uncertainties are assessed independently, resulting a value of shared.u.i that is identical to var.name. `cl` Nominal confidence level to be used to compute the expanded uncertainty of the output measurement result. Default value is 0.95. `cov.factor` Type of coverage factor to be used. The default is to use the value from the Student's t distribution with confidence level specified above and nu.eff effective degrees of freedom. `sig.digits.U` Number of significant digits to be reported in the expanded uncertainty of the measurement result. The measurement result will be rounded to the same number of decimal places. `...` Arguments passed to other functions. Currently unimplemented.

## Details

Whenever possible, sensitivity coefficients are obtained analytically using the gradient attribute of the `deriv` function. In situations where some part of the measurement function is not found in derivative table, sensitivity coefficients are obtained by numeric partial differentiation using the `grad` function from the package numDeriv.

## Value

A list containing the 9 components:

 `y` Value of the measurement result obtained by evaluating the measurement function at the input variable values. `uc` The combined standard uncertainty of the measurement result, y. `nu.eff` The effective degrees of freedom associated with uc, computed using the Welch-Satterthwaite formula. `cl` The nominal confidence level used to obtain the coverage factor, k. `k` The coverage factor used to control the confidence level associated with the expanded uncertainty of the measurement result. `U` The expanded uncertainty of the measurement result, computed as U=k*uc. `contributions` Relative variance contributed to the standard uncertainty (uc) of the measurement result from each input variable. `sensitivities` Sensitivity coefficient associated with each input variable. `msgs` Error and warning messages that point out potential problems with the inputs to the `GUM` function or with the interpretation of the function's output.

## Author(s)

Hung-kung Liu hung-kung.liu@nist.gov and Will Guthrie will.guthrie@nist.gov

## References

Joint Committee on Guides in Metrology (JCGM), 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, 2008.

## See Also

`GUM.validate` a function to assess the statistical performance of GUM uncertainty intervals for the application of interest in terms of average attained coverage probability. `uncert` for a family of functions focused on the study and comparison of different approaches and numerical options in uncertainty analysis.

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11``` ```## a simple uncertainty analysis for the product of two quantities GUM(c("x1","x2"),c(2.3,1.1),c(0.030,0.015),c(5,9999),"x1*x2") ## example of the difference in the measurements of two standards, each ## with a standard uncertainty based on a common value drawn from a control chart ## representative of the measurement process made using a check standard that ## is comparable to the two individual standards under study GUM(c("s1","s2"),c(45.3,46.0),c(0.26,0.26),c(134,134),"s1-s2",shared.u.i=c("s1","s1")) ## compare with results for equivalent, alternative specification of shared.u.i GUM(c("s1","s2"),c(45.3,46.0),c(0.26,0.26),c(134,134),"s1-s2",shared.u.i=c("s2","s2")) ```

### Example output

```Attaching package: 'metRology'

The following objects are masked from 'package:base':

cbind, rbind

\$y
 2.53

\$uc
 0.04774149

\$nu.eff
 21.88965

\$cl
 0.95

\$k
 2.074479

\$U
 0.099

\$contributions
x1        x2
[1,] 0.4777887 0.5222113

\$sensitivities
x1  x2
[1,] 1.1 2.3

\$msgs
 "No errors or warnings." ""                       ""
 ""                       ""                       ""
 ""                       ""                       ""
 ""                       ""                       ""
 ""                       ""                       ""

\$y
 -0.7

\$uc
 0.3676955

\$nu.eff
 134

\$cl
 0.95

\$k
 1.977826

\$U
 0.73

\$contributions
s1  s2
[1,] 0.5 0.5

\$sensitivities
s1 s2
[1,]  1 -1

\$msgs
 "No errors or warnings." ""                       ""
 ""                       ""                       ""
 ""                       ""                       ""
 ""                       ""                       ""
 ""                       ""                       ""

\$y
 -0.7

\$uc
 0.3676955

\$nu.eff
 134

\$cl
 0.95

\$k
 1.977826

\$U
 0.73

\$contributions
s1  s2
[1,] 0.5 0.5

\$sensitivities
s1 s2
[1,]  1 -1

\$msgs
 "No errors or warnings." ""                       ""
 ""                       ""                       ""
 ""                       ""                       ""
 ""                       ""                       ""
 ""                       ""                       ""
```

metRology documentation built on May 2, 2019, 12:20 p.m.