| Type: | Package |
| Title: | Uncertainty Estimation and Contribution Analysis |
| Version: | 0.3.0 |
| Date: | 2025-12-14 |
| Maintainer: | Hugo Gasca-Aragon <hugo_gasca_aragon@hotmail.com> |
| Description: | Implements the Gaussian method of first and second order, the Kragten numerical method and the Monte Carlo simulation method for uncertainty estimation and analysis. |
| Depends: | graphics (≥ 3.4.0), stats (≥ 3.4.0), mvtnorm (≥ 0.9), triangle (≥ 0.7), R (≥ 3.4.0) |
| License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| Encoding: | UTF-8 |
| NeedsCompilation: | no |
| Packaged: | 2025-12-14 20:52:21 UTC; hugo_ |
| Author: | Hugo Gasca-Aragon |
| Repository: | CRAN |
| Date/Publication: | 2025-12-14 21:30:02 UTC |
Uncertainty Estimation and Contribution Analysis
Description
Implements the Gaussian method of first and second order, the Kragten numerical method and the Monte Carlo simulation method for uncertainty estimation and analysis.
Details
The DESCRIPTION file:
| Package: | uncertainty |
| Type: | Package |
| Title: | Uncertainty Estimation and Contribution Analysis |
| Version: | 0.3.0 |
| Date: | 2025-12-14 |
| Authors@R: | person(given = "Hugo", family = "Gasca-Aragon", role = c("aut", "cre"), email = "hugo_gasca_aragon@hotmail.com", comment = c(ORCID = "0000-0002-5384-2530")) |
| Maintainer: | Hugo Gasca-Aragon <hugo_gasca_aragon@hotmail.com> |
| Description: | Implements the Gaussian method of first and second order, the Kragten numerical method and the Monte Carlo simulation method for uncertainty estimation and analysis. |
| Depends: | graphics (>= 3.4.0), stats (>= 3.4.0), mvtnorm (>= 0.9), triangle (>= 0.7), R (>= 3.4.0) |
| License: | GPL (>=2) |
| Encoding: | UTF-8 |
| NeedsCompilation: | no |
| Author: | Hugo Gasca-Aragon [aut, cre] (ORCID: <https://orcid.org/0000-0002-5384-2530>) |
Index of help topics:
plot.summary.uncertainty
Plots an output quantity's uncertainty summary.
It shows the uncertainty contribution from each
involved input quantity
plot.uncertainty Plots a probability density function related to
the measurement model
print.summary.uncertainty
Displays a list with the uncertainty
contribution from each input quantity
print.uncertainty Displays the detailed content of a measurement
model including its uncertainty estimate.
print.uncertaintyBudget
Prints an uncertainty budget object
summary.uncertainty Creates an uncertainty summary object
uncertainty Creates an uncertainty object for the output
quantity of a measurement model
uncertainty-package Uncertainty Estimation and Contribution
Analysis
uncertainty.default Generic function for calling an uncertainty
object
uncertaintyBudget Generic function for uncertainty budget object
uncertaintyBudget.default
Generic function for calling an uncertainty
budget object
Define an "uncertainty budget" object, including all the involved input quantities. Then estimate the output quantity object by defining a measurement model, using the "uncertainty budget" and applying an estimation method. Print or plot the output quantity estimates or create a "summary uncertainty" object to print or plot the uncertainty contributions to the output quantity described in the measurement model.
Author(s)
Hugo Gasca-Aragon [aut, cre] (ORCID: <https://orcid.org/0000-0002-5384-2530>)
Maintainer: Hugo Gasca-Aragon <hugo_gasca_aragon@hotmail.com>
References
JCGM 200:2012. International vocabulary of metrology—Basic and general concepts and associated terms (VIM)
JCGM 100:2008. Guide to the expression of uncertainty of measurement
JCGM 101:2008. Supplement 1 Propagation of distributions usign a Monte Carlo method
S.L.R. Ellison and A. Williams (2012) EURACHEM/CITAC Guide CG 4. Quantifying Uncertainty in Analytical Measurement, ISBN 978-0-948926-30-3.
Becker, R.A., Chambers, J.M. and Wilks, A.R. (1988) The New S Language. Wadsworth & Brooks/Cole.
See Also
uncertaintyBudget, print.uncertaintyBudget, uncertainty, print.uncertainty, plot.uncertainty, summary.uncertainty, print.summary.uncertainty, plot.summary.uncertainty
Examples
require(mvtnorm)
cor.mat <- matrix(c(1, -0.7, -0.7, 1), 2, 2)
u.budget <- uncertaintyBudget(x=list(name = c("x0", "x1"),
mean = c(10, 20), u=c(1, 5), unit = c("kg", "kg"),
dof = c(10, 10), type = c("A", "A"),
description = c("measurand mass", "sample mass"),
label = c("x[0]", "x[1]"), distribution = c("normal", "normal")),
y = cor.mat)
u.budget
## Gaussian first order estimates
GFO.res <- uncertainty(x = u.budget,
y = list(measurand_name = "ratio.GFO",
measurand_label = expression(ratio[GFO]),
measurand_model = "x0/x1",
measurand_description = "ratio of masses at 20 degrees celsius",
method = "GFO", alpha = 0.05))
contr.GFO <- summary(GFO.res)
## Monte Carlo estimates
MC.res <- uncertainty(x = u.budget,
y = list(measurand_name = "ratio.MC",
measurand_label = expression(ratio[MC]),
measurand_model = "x0/x1",
measurand_description = "ratio of masses at 20 degrees celsius",
method = "MC", alpha = 0.05, B = 1e5))
contr.MC <- summary(MC.res)
## print the estimates
MC.res
GFO.res
## print the uncertainty summary
contr.MC
contr.GFO
## Displaying both estimated distributions
## Not run:
plot(MC.res, col = 4, xlab = MC.res$measurand_model)
plot(GFO.res, lty = 2, col = 2, add = TRUE)
legend(0.7, 2.5, legend = c("Monte Carlo", "Gaussian First Order"),
lty = c(1, 2), col = c(4, 2), lwd = 2, bg = "white")
## End(Not run)
## Display both uncertainty summaries
## Not run:
barplot(cbind(contr.GFO$budget$contrib, contr.MC$budget$contrib),
beside = TRUE, horiz = TRUE, main = "Uncertainty contribution by method",
xlab = "percent Variance",
names.arg = c(GFO.res$measurand_label, MC.res$measurand_label))
## End(Not run)
##########################
## Example H.1 from GUM ##
##########################
# define the uncertainty budget
u.budget <- uncertaintyBudget(
x = list(
name = c("lambda.s", "alpha.s", "theta.bar", "Delta", "delta.alpha",
"delta.theta", "d.bar", "d.cr", "d.cnr"),
label = c("lambda[s]", "alpha[s]", "bar(theta)", "Delta", "delta[alpha]",
"delta[theta]", "bar(d)", "d[cr]", "d[cnr]"),
description = c("certified length of the reference gauge block", "reference gauge block cte",
"mean temperature", "Delta", "difference in the cte", "difference in temperature",
"mean difference in length", "d.cr", "d.dnr"),
mean = c(50.000623,11.5e-6,-1e-1, 0, 0, 0, 2.15e-4, 0, 0),
unit = c("mm", "oC^-1","oC","oC", "oC^-1", "oC", "mm", "mm", "mm"),
u = c(25e-6, 1.2e-6, 0.2, 0.35, 0.58e-6, 0.029, 5.8e-6, 3.9e-6, 6.7e-6),
distribution = c("t", "unif", "unif", "arcsine", "unif", "unif", "t", "t",
"t"),
dof = c(18, 1, 1, 1, 50, 2, 24, 5, 8),
type = c("B", "B", "A", "B", "A", "A", "A", "A", "A")
),
y = diag(1, 9)
)
# define the measurand
measurand_name <- "lambda"
measurand_label <- "lambda"
measurand_model <- paste("(lambda.s*(1+alpha.s*(theta.bar+Delta+delta.theta))",
"+d.bar+d.cr+d.cnr)/(1+(alpha.s+delta.alpha)*(theta.bar+Delta))", sep = "")
measurand_description = "length of end gauge block under calibration at 20 degrees celsius"
# estimate the measurand using the Gaussian First Order method (GUM)
u.GFO <- uncertainty(
x = u.budget,
y = list(measurand_name = measurand_name,
measurand_label = measurand_label,
measurand_model = measurand_model,
measurand_description = measurand_description,
alpha = 0.01,
method = "GFO"
)
)
u.GFO
# same result as reported in Table H.1
# estimate the measurand using the Gaussian Second Order method
u.GSO <- uncertainty(
x = u.budget,
y = list(measurand_name = measurand_name,
measurand_label = measurand_label,
measurand_model = measurand_model,
measurand_description = measurand_description,
alpha = 0.01,
method = "GSO"
)
)
u.GSO
# same results as reported in section H.1.6, U(99) = 93 nm,
# the difference is due to rounding error.
# u = 34 nm.
# estimate the measurand using the Monte Carlo method (GUM supplement 1)
u.MC <- uncertainty(
x = u.budget,
y = list(measurand_name = measurand_name,
measurand_label = measurand_label,
measurand_model = measurand_model,
measurand_description = measurand_description,
alpha = 0.01,
method = "MC", B = 1e5
)
)
u.MC
# this result is not reported in the GUM
Plots an output quantity's uncertainty summary. It shows the uncertainty contribution from each involved input quantity
Description
Builds a barplot with a bar for each source of uncertainty. If correlation is present then an additional entry is added. The current metric used to display is When correlation is present its contribution may be negative.
Usage
## S3 method for class 'summary.uncertainty'
plot(x, y = NULL, ...)
Arguments
x |
an uncertainty summary object |
y |
not used. |
... |
additional parameters to customize the plot |
Details
none
Value
None (invisible NULL)
Note
none
Author(s)
Hugo Gasca-Aragon
Maintainer: Hugo Gasca-Aragon <hugo_gasca_aragon@hotmail.com>
References
JCGM 200:2012. International vocabulary of metrology—Basic and general concepts and associated terms (VIM)
JCGM 100:2008. Guide to the expression of uncertainty of measurement
JCGM 100:2005. Supplement 1 Propagation of distributions usign a Monte Carlo method.
EURACHEM/CITAC Guide CG 4. Quantifying Uncertainty in Analytical Measurement
See Also
Examples
# create an uncertainty budget
cor.mat <- matrix(c(1, -0.7, -0.7, 1), 2, 2)
u.budget <- uncertaintyBudget(x = list(name = c("x0", "x1"),
mean = c(10, 20), u = c(1, 5), unit = c("kg", "kg"), dof = c(10, 10),
description = c("measurand mass", "sample mass"),
label = c("x[0]", "x[1]"), type = c("A", "A"), distribution = c("normal", "normal")),
y = cor.mat)
# estimate the measurand uncertainty using an uncertainty budget,
# a measurand definition and a selected estimating method.
GFO.res <- uncertainty(x = u.budget,
y = list(measurand_name = "ratio.GFO",
measurand_label = "ratio[GFO]",
measurand_model = "x0/x1",
measurand_description = "ratio of masses at 20 degrees celsius",
method = "GFO", alpha = 0.05))
# create an uncertainty summary object
GFO.sum <- summary(GFO.res)
# display the chart
## Not run: plot(GFO.sum)
Plots a probability density function related to the measurement model
Description
Plot a probability density function attributed to the measurand, depending on the selected method to estimate the uncertainty.
Usage
## S3 method for class 'uncertainty'
plot(x, y = NULL, xlab = parse(text = x$measurand_label),
main = "", ylab = "Probability density", from = x$mean - 4 * x$u, to = x$mean + 4 * x$u,
lwd = 2, add = FALSE, ...)
Arguments
x |
An uncertainty object |
y |
not used, exists only for compatibility with the S3 generic function. |
xlab |
string or expression, label for the x-axis. |
main |
string or expression, label for the plot. |
ylab |
string or expression, label for the y-axis. |
from |
numeric, lower value of the x-axis to display. |
to |
numeric, upper valur of the x-axis to display. |
lwd |
numeric, line width. |
add |
logic, decides to add the curve into an existing plot or to create a new plot. |
... |
additional parameters. |
Details
none
Value
None (invisible NULL)
Note
none
Author(s)
Hugo Gasca-Aragon
Maintainer: Hugo Gasca-Aragon <hugo_gasca_aragon@hotmail.com>
References
JCGM 200:2012. International vocabulary of metrology—Basic and general concepts and associated terms (VIM)
JCGM 100:2008. Guide to the expression of uncertainty of measurement
JCGM 100:2005. Supplement 1 Propagation of distributions usign a Monte Carlo method
EURACHEM/CITAC Guide CG 4. Quantifying Uncertainty in Analytical Measurement
See Also
Examples
# create an uncertainty budget
cor.mat <- matrix(c(1, -0.7, -0.7, 1), 2, 2)
u.budget <- uncertaintyBudget(x = list(name=c("x0", "x1"),
mean = c(10, 20), u = c(1, 5), unit = c("kg", "kg"), dof = c(10, 10),
description = c("measurand mass", "sample mass"),
label = c("x[0]", "x[1]"), type = c("A", "A"), distribution = c("normal", "normal")),
y = cor.mat)
# estimate the measurand uncertainty using an uncertainty budget,
# a measurand definition and a selected estimating method.
GFO.res <- uncertainty(x = u.budget,
y = list(measurand_name = "ratio.GFO",
measurand_label = "ratio[GFO]",
measurand_model = "x0/x1",
measurand_description = "ratio of masses at 20 degrees celsius",
method = "GFO", alpha = 0.05))
# plot the estimated pdf of the measurand
## Not run: plot(GFO.res)
Displays a list with the uncertainty contribution from each input quantity
Description
For each input quantity (source of uncertainty) it shows the uncertainty contribution, measured in percent of variance of the measurand model.
Usage
## S3 method for class 'summary.uncertainty'
print(x, ...)
Arguments
x |
An uncertainty summary object |
... |
Additional parameters |
Details
none
Value
None (invisible NULL)
Note
none
Author(s)
Hugo Gasca-Aragon
Maintainer: Hugo Gasca-Aragon <hugo_gasca_aragon@hotmail.com>
References
JCGM 200:2012. International vocabulary of metrology—Basic and general concepts and associated terms (VIM)
JCGM 100:2008. Guide to the expression of uncertainty of measurement
JCGM 100:2005. Supplement 1 Propagation of distributions usign a Monte Carlo method
EURACHEM/CITAC Guide CG 4. Quantifying Uncertainty in Analytical Measurement
Becker, R.A., Chambers, J.M. and Wilks, A.R. (1988) The New S Language. Wadsworth & Brooks/Cole.
See Also
Examples
# create an uncertainty budget
cor.mat <- matrix(c(1, -0.7, -0.7, 1), 2, 2)
u.budget <- uncertaintyBudget(x = list(name = c("x0", "x1"),
mean = c(10, 20), u = c(1, 5), unit = c("kg", "kg"), dof = c(10, 10),
label = c("x[0]", "x[1]"), distribution = c("normal", "normal"),
description = c("measurand mass", "sample mass"),
type = c("A", "A")),
y = cor.mat)
u.budget
# estimate the measurand uncertainty using an uncertainty budget,
# a measurand definition and a selected estimating method.
GFO.res <- uncertainty(x = u.budget,
y = list(measurand_name = "ratio.GFO",
measurand_label = "ratio[GFO]",
measurand_model = "x0/x1",
measurand_description = "ratio of masses at 20 degrees celsius",
method = "GFO", alpha = 0.05))
GFO.res
# create an uncertainty summary object
GFO.sum <- summary(GFO.res)
# implicit call to the print method
GFO.sum
# same as
print(GFO.sum)
# uncertainty summary structure
attributes(GFO.sum)
Displays the detailed content of a measurement model including its uncertainty estimate.
Description
Displays the estimated value of the output quantity of the measurement model, its standard deviation, its standard uncertainty, the degrees of freedom and the significance level and an CI with that significance level.
Usage
## S3 method for class 'uncertainty'
print(x, ...)
Arguments
x |
an uncertainty object |
... |
additional parameters |
Details
none
Value
None (invisible NULL)
Note
none
Author(s)
Hugo Gasca-Aragon
Maintainer: Hugo Gasca-Aragon <hugo_gasca_aragon@hotmail.com>
References
JCGM 200:2012. International vocabulary of metrology—Basic and general concepts and associated terms (VIM)
JCGM 100:2008. Guide to the expression of uncertainty of measurement
JCGM 100:2005. Supplement 1 Propagation of distributions usign a Monte Carlo method
EURACHEM/CITAC Guide CG 4. Quantifying Uncertainty in Analytical Measurement
Becker, R.A., Chambers, J.M. and Wilks, A.R. (1988) The New S Language. Wadsworth & Brooks/Cole.
See Also
Examples
# create an uncertainty budget
cor.mat <- matrix(c(1, -0.7, -0.7, 1), 2, 2)
u.budget <- uncertaintyBudget(x = list(name = c("x0", "x1"),
mean = c(10, 20), unit = c("kg", "kg"), u = c(1, 5), dof = c(10, 10),
label = c("x[0]", "x[1]"), distribution = c("normal", "normal"),
description = c("measurand mass", "sample mass"),
type = c("A", "A")),
y = cor.mat)
u.budget
# estimate the measurand uncertainty using an uncertainty budget,
# a measurand definition and a selected estimating method.
GFO.res <- uncertainty(x = u.budget,
y = list(measurand_name = "ratio.GFO",
measurand_label = "ratio[GFO]",
measurand_model = "x0/x1",
measurand_description = "ratio of masses at 20 degrees celsius",
method = "GFO", alpha = 0.05))
# implicit call to print method
GFO.res
# same as
print(GFO.res)
# structure of an uncertainty estimation object
attributes(GFO.res)
Prints an uncertainty budget object
Description
Print the description of each uncertainty source
Usage
## S3 method for class 'uncertaintyBudget'
print(x, ...)
Arguments
x |
an uncertainty budget object |
... |
additional parameters |
Details
none
Value
None (invisible NULL)
Note
none
Author(s)
Hugo Gasca-Aragon
Maintainer: Hugo Gasca-Aragon <hugo_gasca_aragon@hotmail.com>
References
JCGM 200:2012. International vocabulary of metrology—Basic and general concepts and associated terms (VIM)
JCGM 100:2008. Guide to the expression of uncertainty of measurement
JCGM 100:2005. Supplement 1 Propagation of distributions usign a Monte Carlo method
EURACHEM/CITAC Guide CG 4. Quantifying Uncertainty in Analytical Measurement
Becker, R.A., Chambers, J.M. and Wilks, A.R. (1988) The New S Language. Wadsworth & Brooks/Cole.
See Also
uncertaintyBudget.default, print
Examples
cor.mat <- matrix(c(1, -0.7, -0.7, 1), 2, 2)
u.budget <- uncertaintyBudget(x = list(name=c("x0", "x1"),
mean = c(10, 20), u = c(1, 5), unit = c("kg", "kg"), dof = c(10, 10),
label = c("x[0]", "x[1]"), distribution = c("normal", "normal"),
description = c("measurand mass", "sample mass"),
type = c("A", "A")),
y = cor.mat)
# implicitly calls the print method
u.budget
# same as
print(u.budget)
# uncertainty budget structure
attributes(u.budget)
Creates an uncertainty summary object
Description
Performs an uncertainty contribution estimation for the uncertainty object. The metric used to measure the contribution is percent of variance. If correlation is present an additional entry is shown with the whole contribution due to correlated input quantities.
Usage
## S3 method for class 'uncertainty'
summary(object, ndigits = 3, ...)
Arguments
object |
an uncerainty object |
ndigits |
numeric, the number of digits for displaying. |
... |
additional parameters |
Details
none
Value
An uncertainty summary object:
call |
the call invocation |
measurand.name |
name of the measurand |
measurand.label |
label of the measurand for displaying purposes |
budget |
a list with the name, mean, label, u(uncertainty), dof and uncertainty contribution for each input quantity plus a correlation entry if any |
Note
none
Author(s)
Hugo Gasca-Aragon
Maintainer: Hugo Gasca-Aragon <hugo_gasca_aragon@hotmail.com>
References
JCGM 200:2012. International vocabulary of metrology—Basic and general concepts and associated terms (VIM)
JCGM 100:2008. Guide to the expression of uncertainty of measurement
JCGM 100:2005. Supplement 1 Propagation of distributions usign a Monte Carlo method
EURACHEM/CITAC Guide CG 4. Quantifying Uncertainty in Analytical Measurement
Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth edition. Springer.
See Also
uncertainty.default, print.summary.uncertainty, summary
Examples
# create an uncertainty budget
cor.mat <- matrix(c(1, -0.7, -0.7, 1), 2, 2)
u.budget <- uncertaintyBudget(x = list(name = c("x0", "x1"),
mean = c(10, 20), u = c(1, 5), unit = c("kg", "kg"), dof = c(10, 10),
label = c("x[0]", "x[1]"), distribution = c("normal", "normal"),
description = c("measurand mass", "sample mass"),
type = c("A", "A")),
y = cor.mat)
u.budget
# estimate the measurand uncertainty using an uncertainty budget,
# a measurand definition and a selected estimating method.
GFO.res <- uncertainty(x = u.budget,
y = list(measurand_name = "ratio.GFO",
measurand_label = "ratio[GFO]",
measurand_model = "x0/x1",
measurand_description = "ratio of masses at 20 degrees celsius",
method = "GFO", alpha = 0.05))
GFO.res
# create an uncertainty summary object
GFO.sum <- summary(GFO.res)
# implicit call to the print method
GFO.sum
# same as
print(GFO.sum)
# uncertainty summary structure
attributes(GFO.sum)
Creates an uncertainty object for the output quantity of a measurement model
Description
Builds an uncertainty estimation object using a measurement model and an uncertainty budget object
Usage
uncertainty(x, ...)
Arguments
x |
an uncertainty budget object |
... |
additional parameters |
Details
Creates an uncertainty estimation object. Uses an uncertainty budget object to estimate the expected value and uncertainty of a measurement model by applying a selected estimation method.
Value
An uncertainty estimation object for the output quantity
Note
none
Author(s)
Hugo Gasca-Aragon
Maintainer: Hugo Gasca-Aragon <hugo_gasca_aragon@hotmail.com>
References
JCGM 200:2012. International vocabulary of metrology—Basic and general concepts and associated terms (VIM)
JCGM 100:2008. Guide to the expression of uncertainty of measurement
JCGM 100:2005. Supplement 1 Propagation of distributions usign a Monte Carlo method
EURACHEM/CITAC Guide CG 4. Quantifying Uncertainty in Analytical Measurement
Becker, R.A., Chambers, J.M. and Wilks, A.R. (1988) The New S Language. Wadsworth & Brooks/Cole.
See Also
Generic function for calling an uncertainty object
Description
Creates an uncertainty estimation object using a measurand model and an uncertainty budget object
Usage
## Default S3 method:
uncertainty(x, y, ...)
Arguments
x |
an uncertainty budget object |
y |
a list with the measurand description and selected estimation method, the measurand includes: measurand_name, measurand_model, measurand_label, measurand_description, alpha (significance level), method and method parameters. the valid methods are: GFO, GSO, MC. currently the only method parameter implemented is the number of simulated samples (B) for the method MC. use.correlation is a boolean field, if there are correlations and this flag is TRUE then the correlation is used to adjust the effective degrees of freedom for correlation, according to Castrup adjustment to Welch-Satterthwaite algoritm. if missing or NULL it is assumed as FALSE |
... |
additional parameters |
Details
Creates an uncertainty estimation object. Uses an uncertainty budget object to estimate the expected value and uncertainty of a measurand by applying a selected estimation method.
Value
An uncertainty estimation object with the structure:
method selected estimating method,
call current call invocation,
uncertaintyBudget an uncertainty budget object,
measurand name, label, model describing the measurand,
mean the estimated mean,
sd the estimated standard deviation,
u the estimated standard uncertainty,
alpha the significante level used in the estimation,
dof the estimated degrees of freedom,
U the estimated expanded uncertainty,
lcl the lower confidence interval,
ucl the upper confidence interval,
variables a vector with the input quantities,
contribution a vector with the uncertainty contributions,
cor.contribution the uncertainty contribution due to overall correlation,
partial a vector of the partial derivatives of the measurand.model with respect to each input quantity,
coeff a vector of the sensibility coefficients for each input quantity.
Note
none
Author(s)
Hugo Gasca-Aragon
Maintainer: Hugo Gasca-Aragon <hugo_gasca_aragon@hotmail.com>
References
JCGM 200:2012. International vocabulary of metrology—Basic and general concepts and associated terms (VIM)
JCGM 100:2008. Guide to the expression of uncertainty of measurement
JCGM 100:2005. Supplement 1 Propagation of distributions usign a Monte Carlo method
EURACHEM/CITAC Guide CG 4. Quantifying Uncertainty in Analytical Measurement
See Also
uncertainty, uncertaintyBudget.default, print.uncertainty, plot.uncertainty, summary.uncertainty
Examples
# create an uncertainty budget
cor.mat <- matrix(c(1, -0.7, -0.7, 1), 2, 2)
u.budget <- uncertaintyBudget(x = list(name = c("x0", "x1"),
mean = c(10, 20), units = c("kg", "kg"), u = c(1, 5), dof = c(10, 10),
label = c("x[0]", "x[1]"), distribution = c("normal", "normal"),
description = c("measurand mass", "sample mass"),
type = c("A", "A")),
y = cor.mat)
u.budget
# estimate the measurand uncertainty using an uncertainty budget,
# a measurand definition and a selected estimating method.
GFO.res <- uncertainty(x = u.budget,
y = list(measurand_name = "ratio.GFO",
measurand_label = "ratio[GFO]",
measurand_model = "x0/x1",
measurand_description = "ratio of masses",
method = "GFO", alpha = 0.05))
GFO.res
Generic function for uncertainty budget object
Description
Generic function for creating an uncertainty budget object
Usage
uncertaintyBudget(x, ...)
Arguments
x |
a list with the vector entries name, label, mean, u(uncertainty), distribution and dof, one for each quantity. |
... |
additional parameters |
Details
uncertaintyBudget is a generic function (under S3 protocol) for searching the default method.
Value
An uncertainty budget object with attributes:
name the name of each input quantity
mean the mean value of each input quantity
u the uncertainty of each input quantity
unit the unit of each input quantity
dof the degrees of freedom of each input quantity
label the label of each input quantity
distribution the distribution of each input quantity, valid values are (normal, unif, t, chisq, f, triangle, binomial, bernoulli, beta, gamma)
cor the correlation matrix among the input quantities
Note
none
Author(s)
Hugo Gasca-Aragon
Maintainer: Hugo Gasca-Aragon <hugo_gasca_aragon@hotmail.com>
References
JCGM 200:2012. International vocabulary of metrology—Basic and general concepts and associated terms (VIM)
JCGM 100:2008. Guide to the expression of uncertainty of measurement
JCGM 100:2005. Supplement 1 Propagation of distributions usign a Monte Carlo method
EURACHEM/CITAC Guide CG 4. Quantifying Uncertainty in Analytical Measurement
Becker, R.A., Chambers, J.M. and Wilks, A.R. (1988) The New S Language. Wadsworth & Brooks/Cole.
See Also
Generic function for calling an uncertainty budget object
Description
Creates an uncertainty budget.
Usage
## Default S3 method:
uncertaintyBudget(x, y, ...)
Arguments
x |
a list with the vector entries name, label, mean, unit, u(uncertainty), type, description, distribution and dof, one for each input quantity. |
y |
a correlation matrix of the input quantities, interpreted in the same order of input quantities as the vector name |
... |
additional parameters |
Details
Creates an uncertainty budget object
Value
An uncertainty budget object with attributes:
name the name of each input quantity, this is the identifier used in the measurement model computation
mean the mean value of each input quantity
u the uncertainty of each input quantity
unit the measurement unit of each input quantity
dof the degrees of freedom of each input quantity
type the type of source "A"=experimental, "B"=other means
label the label of each input quantity, used for displaying and plotting
description the full description of the input quantity
distribution the distribution of each input quantity, valid values are (bernoulli, beta, binomial, cuachy, chisq, exp, f, gamma, lognormal, poission, normal, unif, t, traingular, weibull, arcsine)
cor the correlation matrix among the input quantities
Note
none
Author(s)
Hugo Gasca-Aragon
Maintainer: Hugo Gasca-Aragon <hugo_gasca_aragon@hotmail.com>
References
JCGM 200:2012. International vocabulary of metrology—Basic and general concepts and associated terms (VIM)
JCGM 100:2008. Guide to the expression of uncertainty of measurement
JCGM 100:2005. Supplement 1 Propagation of distributions usign a Monte Carlo method
EURACHEM/CITAC Guide CG 4. Quantifying Uncertainty in Analytical Measurement
Becker, R.A., Chambers, J.M. and Wilks, A.R. (1988) The New S Language. Wadsworth & Brooks/Cole.
See Also
uncertaintyBudget, uncertainty, print.uncertaintyBudget
Examples
require(mvtnorm)
cor.mat <- matrix(c(1, -0.7, -0.7, 1), 2, 2)
u.budget <- uncertaintyBudget(x = list(name = c("x0", "x1"),
mean = c(10, 20), u = c(1, 5), unit = c("kg", "kg"), dof = c(10, 10),
label = c("x[0]", "x[1]"), type = c("A", "A"),
description = c("measurand mass", "sample mass"),
distribution = c("normal", "normal")),
y = cor.mat)
u.budget