gumMC: Combination of Distributions by Monte Carlo

Description Usage Arguments Value References Examples

Description

Uncertainty propagation by Monte Carlo (GUM-Supp1 [1]).

Both gumS1(adapt=TRUE) and gumS2 provide adaptative procedures. gumS1 implements the code proposed in GUM-Supp1 which checks the convergence of the estimators by blocks. gumS2 implements the two-stage Stein procedure [2], which has been shown to have a less erratic stopping criterion than gumS1.

By default, gumS1 is non-adaptative and performs the user-specified number of simulations.

Usage

1
2
3
4
5
6
7
8
gumS1(fExpr, x.mu, x.u, x.pdf, x.df, x.cor = diag(length(x.mu)),
  x.cov = NULL, nrun = 1000, adapt = FALSE, ndig = 1, p = 0.95,
  delFrac = 1, stdev = TRUE, interval = TRUE, silent = FALSE,
  nrunMax = 1e+06)

gumS2(fExpr, x.mu, x.u, x.pdf, x.df, x.cor = diag(length(x.mu)),
  x.cov = NULL, nrun = 100, h1 = 30, ndig = 1, p = 0.95,
  silent = FALSE, nrunMax = 1e+06)

Arguments

fExpr

An expression or a function object.

x.mu

Named vector of mean values with names compatible with fExpr.

x.u

Named vector of standard uncertainty values (one of {x.u, x.cov} mandatory).

x.pdf

Named vector of pdf types (see PDFs).

x.df

Named vector of degrees of freedom for x.pdf.

x.cor

Named correlation matrix between model parameters.

x.cov

Named variance/covariance matrix between model parameters (one of {x.u, x.cov} mandatory).

nrun

Number of runs in each sample packet.

adapt

Flag to use the sequential adaptive method.

ndig

Number of significant figures to converge.

p

Coverage of confidence interval.

delFrac

Multiplicative factor on numerical tolerance. For compatibility with examples in GUM-Supp1 [1]. #'

stdev

Flag for adaptative method to converge standard deviation (gumS1; for gumS2 convergence is based on the variance).

interval

Flag to converge confidence interval (gumS1).

silent

Flag to run without printout.

nrunMax

Maximum number of runs allowed.

h1

Number of packets in first step of gumS2.

Value

A list containing:

y.mu

mean value of model

y.u

standard uncertainty of model

y.low

lower limit of confidence interval

y.high

upper limit of confidence interval

p

coverage of confidence interval (same as input)

X

(matrix) sample of inputs used to converge statistics

Y

(vector) sample of outputs corresponding to X

References

[1] Evaluation of measurement data - Supplement 1 to the "Guide to the expression of uncertainty in measurement" - Propagation of distributions using a Monte Carlo method. JCGM 101:2008. PDF

[2] G. W\"ubbeler, P. M. Harris, M. G. Cox and C. Elster (2010) A two-stage procedure for determining the number of trials in the application of a Monte Carlo method for uncertainty evaluation. Metrologia 47:317. CrossRef

Examples

1
2
3
4
5
6
7
8
fExpr = expression(x1+x2)
x.mu = c(1,1); names(x.mu)=c('x1','x2')
x.u = c(0.1,0.1); names(x.u)=c('x1','x2')
x.pdf = c('unif','triangle'); names(x.pdf)=c('x1','x2')
S=gumS1(fExpr,x.mu,x.u,x.pdf,x.df=NULL,nrunMax=1000)
pairs(cbind(S$X,S$Y))
S=gumS2(fExpr,x.mu,x.u,x.pdf,x.df=NULL)
ECIPlot(S$Y)

ppernot/rgumlib documentation built on May 25, 2019, 11:24 a.m.