Learn R Programming

propagate (version 1.3-0)

WelchSatter: Effective degrees of freedom: Welch-Satterthwaite formula and its generalization to correlated components

Description

Calculates the 'effective degrees of freedom' of a combined standard uncertainty, the corresponding coverage factor and the expanded uncertainty. For independent uncertainty components, this is the Welch-Satterthwaite formula of the GUM (Welch 1947, Satterthwaite 1946). For correlated components with finite degrees of freedom, where the Welch-Satterthwaite formula is not applicable, the generalization of Willink (2007) is used, including the combination of jointly observed input quantities into a single component with \(n - 1\) degrees of freedom.

Usage

WelchSatter(ui, ci = NULL, df = NULL, df.tot = NULL, uc = NULL, alpha = 0.05, k = NULL,
            cov = NULL, group = NULL, method = c("auto", "gen", "sim", "WS"))

Value

A list with the following items:

ws.df

the effective degrees of freedom (not truncated), or df.tot if supplied.

k

the coverage factor for calculating the expanded uncertainty.

u.exp

the expanded uncertainty \(U\).

method

the formula used: "WS", "gen" or "sim"; for method = "auto", the selected one, which is "sim" for uncorrelated inputs (where it equals the Welch-Satterthwaite formula); "df.tot" if df.tot is supplied.

Arguments

ui

the standard uncertainties \(u_i\) of the input quantities \(x_i\).

ci

the sensitivity coefficients \(c_i = \partial y/\partial x_i\). If NULL, all \(c_i = 1\).

df

the degrees of freedom \(\nu_i\) of the \(u_i\). Inf is allowed for inputs with exactly known uncertainty (JCGM 100:2008, G.4.3).

df.tot

an optional known total degrees of freedom \(\nu_{\mathrm{tot}}\). Overrides the calculation of \(\nu_{\mathrm{eff}}\) and is used as given.

uc

the combined standard uncertainty \(u(y)\). If NULL, \(u(y)^2 = \sum_i \sum_j K_{ij}\) with the contribution matrix \(K\) defined in 'Details'.

alpha

the significance level: the coverage probability is \(1 - \alpha\).

k

an external coverage factor, say 2, that overrides the one obtained from alpha.

cov

an optional covariance matrix \(\mathbf{\Sigma}\) of the input quantities, with \(\Sigma_{ii} = u_i^2\) and \(\Sigma_{ij} = r_{ij} u_i u_j\). If NULL, the inputs are taken as uncorrelated.

group

an optional vector of length \(m\) that labels input quantities estimated jointly from the same \(n\) sets of observations (equal labels = same group, NA = component of its own). All members of a group must have the same df, \(n - 1\). See 'Details', Result 1.

method

the formula for correlated components: "auto" (default), "gen", "sim", or "WS" for the classical formula. See 'Details'.

Author

Andrej-Nikolai Spiess

Details

Contribution matrix. With sensitivity coefficients \(c_i\), standard uncertainties \(u_i\) and correlation coefficients \(r_{ij}\), the contribution matrix and the combined variance are (JCGM 100:2008, 5.2.2, Eq. (13)) $$K_{ij} = c_i c_j r_{ij} u_i u_j = c_i c_j \Sigma_{ij}, \qquad u(y)^2 = \sum_{i=1}^m \sum_{j=1}^m K_{ij}.$$

Welch-Satterthwaite formula (method = "WS"). For independent components (JCGM 100:2008, G.4.1, Eq. (G.2b)): $$\nu_{\mathrm{eff}} = \frac{u(y)^4}{\sum_{i=1}^m \frac{(c_i u_i)^4}{\nu_i}}.$$ It requires \(r_{ij} = 0\) for every pair of components that both have finite degrees of freedom (JCGM 100:2008, G.4.2), and its use with correlated components is outside the GUM.

Generalization to correlated components (Willink 2007). Willink distinguishes two situations: jointly observed input quantities (Result 1) and correlated components with independently estimated uncertainties (Results 2 and 3).

Result 1 (jointly observed input quantities, argument group). If a group of input quantities is estimated from the same \(n\) sets of simultaneous observations, as in JCGM 100:2008, H.2, the standard uncertainties of these inputs are themselves correlated, and the group is combined into a single component with \(n - 1\) degrees of freedom. This result is exact for sampling from a multivariate normal distribution, for any correlation and sensitivity coefficients: the variance of a fixed linear combination of the sample means is then estimated with exactly \(n - 1\) degrees of freedom (Willink 2007, section 4.1). Computationally, the contribution matrix is aggregated over the groups, \(K'_{GH} = \sum_{i \in G}\sum_{j \in H} K_{ij}\), and the formulas below are applied to the components of \(K'\) with \(\nu_G = n_G - 1\), where \(n_G\) is the number of sets of observations of group \(G\) (\(n\) in the argument group). If all inputs form one group, \(\nu_{\mathrm{eff}} = n - 1\).

Result 2 (method = "gen", Willink 2007, Eqs. (26)-(27)). For correlated components whose standard uncertainties are estimated independently (e.g. from previous evaluations or Type B): $$\nu_{\mathrm{eff}} = \max\left\{1,\; \frac{u(y)^4}{\sum_{i} \left(\sum_{j} K_{ij}\right)^2 / \nu_i}\right\}.$$

Result 3 (method = "sim", Willink 2007, Eq. (29)). The Welch-Satterthwaite value calculated as if the components were independent: $$\nu_{\mathrm{eff}} = \frac{\left(\sum_{i} K_{ii}\right)^2}{\sum_{i} K_{ii}^2/\nu_i}.$$

Choice (method = "auto"). In Willink's simulations, "sim" performed slightly better than "gen" in most situations, but considerably worse when the components cancel because of negative correlations or opposite signs of the sensitivity coefficients. "auto" therefore uses "sim" if \(u(y)^2 \ge \sum_i K_{ii}\) (no net cancellation) and "gen" otherwise. This rule is the practical suggestion of Willink (2007, section 4.2.2), who notes that the choice of formula after seeing the data is not fully resolved; it should be regarded as a heuristic.

Without correlations, "gen", "sim" and "auto" all reduce to the Welch-Satterthwaite formula, so that results for independent inputs are unchanged.

Coverage factor and expanded uncertainty. $$k = t_{\max(1, \lfloor\nu_{\mathrm{eff}}\rfloor)}(1 - \alpha/2), \qquad U = k\,u(y).$$ For the coverage factor, \(\nu_{\mathrm{eff}}\) is truncated to the next lower integer (JCGM 100:2008, G.4.1, Note 1), but to at least 1; the returned ws.df is not truncated. For \(\nu_{\mathrm{eff}} = \infty\), \(k\) is the Gaussian quantile.

For independent components, \(\nu_{\mathrm{eff}} \ge \min_i \nu_i\), so that values below 3 only occur if at least one input has \(\nu_i < 3\). The value is then used as it is, with a message: the output distribution is heavy-tailed, the coverage factor is large (e.g. \(k = 12.71\) for \(\nu_{\mathrm{eff}} = 1\) and \(\alpha = 0.05\)), and the Monte Carlo coverage interval of propagate is preferable. Versions up to 1.2-0 replaced \(\nu_{\mathrm{eff}} < 3\) by 3, which gave too small coverage factors.

If \(u(y) = 0\), i.e. all contributions vanish, \(\nu_{\mathrm{eff}}\) is undefined (\(0/0\)): ws.df and k are NA and u.exp is 0.

Use in propagate. propagate passes the input covariance matrix as cov. For type = "raw" with cov = "full" and complete joint observations, all inputs are one group (Result 1), so that the GUM coverage interval uses \(\nu_{\mathrm{eff}} = n - 1\); up to version 1.2-0, the classical formula was applied to these correlated inputs, which is outside the GUM and does not give \(n - 1\) (in the GUM H.2 example below, \(\nu_{\mathrm{eff}} = 0.13\) with the correlated \(u(y)\) in the numerator and 7.1 with the inputs taken as independent, instead of 4). For summary data, jointly observed subsets can be declared with the argument ws.group of propagate.

Scope and validation. All formulas are based on the first-order Taylor expansion of the measurement model. Willink (2007) evaluated Results 2 and 3 by simulation of the coverage probability for linear models with multivariate Gaussian errors and independent chi-square distributed variance estimates, with \(m = 2\) and \(m = 4\) components; "gen" achieved coverage probabilities similar to those of the Welch-Satterthwaite formula for independent components (about 93% or more for a nominal 95%) when \(\min_i \nu_i \ge 2\), and "sim" did so except when the components cancel (down to about 85%), which motivates the rule of "auto". Their performance for nonlinear models and non-Gaussian inputs has not been established. For the reliability of the Welch-Satterthwaite formula itself, see Hall and Willink (2001). If uc is the second-order uncertainty from propagate, \(\nu_{\mathrm{eff}}\) is a further approximation.

References

Evaluation of measurement data - Guide to the expression of uncertainty in measurement.
JCGM 100:2008. Joint Committee for Guides in Metrology (2008).
tools:::Rd_expr_doi("10.59161/JCGM100-2008E")

An Approximate Distribution of Estimates of Variance Components.
Satterthwaite FE.
Biometrics Bulletin (1946), 2: 110-114.

The generalization of "Student's" problem when several different population variances are involved.
Welch BL.
Biometrika (1947), 34: 28-35.

A generalization of the Welch-Satterthwaite formula for use with correlated uncertainty components.
Willink R.
Metrologia (2007), 44: 340-349.

Does "Welch-Satterthwaite" make a good uncertainty estimate?
Hall BD, Willink R.
Metrologia (2001), 38: 9-15.

See Also

propagate

Examples

Run this code
## GUM H.1.6: nu_eff = 16.8 (truncated to 16), k99 = 2.92, U99 = 93 nm.
WelchSatter(ui = c(25, 9.7, 2.9, 16.6), df = c(18, 25.6, 50, 2), uc = 32, alpha = 0.01)

## A dominating input with one degree of freedom:
## nu_eff < 3 is kept, k = t_1(0.975) = 12.71.
WelchSatter(ui = c(1, 0.1), df = c(1, 50))

## Two correlated components with independently estimated
## uncertainties and strong cancellation (Willink 2007, Table 1):
## "auto" selects "gen" (nu_eff = 1.44, larger k), which keeps the
## coverage probability; "sim" (nu_eff = 2.16) gives too narrow
## intervals in this situation (coverage about 91 % instead of 95 %).
COV <- matrix(c(1, -0.8 * 0.2, -0.8 * 0.2, 0.04), 2)
WelchSatter(ui = c(1, 0.2), df = c(2, 2), cov = COV, method = "gen")
WelchSatter(ui = c(1, 0.2), df = c(2, 2), cov = COV, method = "sim")
WelchSatter(ui = c(1, 0.2), df = c(2, 2), cov = COV)

## GUM H.2: resistance R = V/I * cos(phi) from n = 5 joint
## observations of V, I and phi (Willink 2007, section 4.1.1).
## As one group, nu_eff = n - 1 = 4 exactly.
data(H.2)
X <- as.matrix(H.2)[, c("V", "I", "phi")]
m <- colMeans(X)
V <- m[["V"]]; I <- m[["I"]]; phi <- m[["phi"]]
CI <- c(cos(phi)/I, -V * cos(phi)/I^2, -V * sin(phi)/I)
SIG <- cov(X)/5
WelchSatter(ui = sqrt(diag(SIG)), ci = CI, df = rep(4, 3), cov = SIG, group = c(1, 1, 1))
## Classical formula with the correlated u(y) in the numerator
## (outside the GUM): nu_eff = 0.13, far too small ...
WelchSatter(ui = sqrt(diag(SIG)), ci = CI, df = rep(4, 3), cov = SIG, method = "WS")
## ... and with the inputs taken as independent (no cov): nu_eff = 7.1.
WelchSatter(ui = sqrt(diag(SIG)), ci = CI, df = rep(4, 3), method = "WS")

Run the code above in your browser using DataLab