Learn R Programming

propagate (version 1.3-0)

conformity: Conformity assessment with measurement uncertainty (JCGM 106:2012)

Description

Conformity assessment of a measurand against tolerance limits, taking the measurement uncertainty into account, according to JCGM 106:2012. For a single measured item, conformity calculates the conformance probability and acceptance limits; for a production process inspected by a measuring system, it calculates the global consumer's and producer's risks, acceptance limits for a target consumer's risk and the capability indices of the process. Optionally, decision rules with the expanded uncertainty (ISO 14253-1, ASME B89.7.3.1, VDA 5) are applied, and plot draws the probability density function with the conforming and non-conforming parts and the decision zones (see 'Details').

Usage

conformity(object, lower = -Inf, upper = Inf, method = c("MC", "GUF"), prob = NULL,
           um = NULL, accept = NULL, risk = NULL, support = c(-Inf, Inf),
           rule = NULL, p = 0.95, interval = c("symmetric", "shortest"))

# S3 method for conformity print(x, digits = 4, ...)

# S3 method for conformity plot(x, density = TRUE, col = c(accept = "#2E9D48", reject = "#C8102E", zone = "grey70"), ...)

Value

An object of class conformity, a list. For a single item: type = "specific", method, estimate, u, nu, the tolerance limits, the conformance probability pc, the non-conformance probability pnc, prob, the acceptance limits accept and the standardized distances z of the estimate from the tolerance limits, p, the expanded uncertainties U (a vector c(U-, U+)) and the coverage interval. For a production process: type = "global", method, the tolerance limits, um, the acceptance limits accept, the guard band w and \(r = w/(2u_m)\) (if risk was given), pc, pnc, the risks RC and RP, the accepted fraction accepted, the non-conforming fraction among accepted items RC.accepted and process (mean, sd, Cp, Cpk, DPMO), p and the expanded uncertainty U. In both cases rules (NULL without rule) is a data frame with one row per rule: rule, description, the acceptance limits AL, AU, the rejection limits RL, RU and, for a single item, the decision, or, for a production process, the fractions accepted, rejected, undecided and the risks RC, RP; density contains the density of the measurand or of the process for plot.

Arguments

object

for a single measured item (um = NULL): a propagate object, a vector c(y, u) (normal PDF) or c(y, u, nu) (scaled and shifted t-distribution with nu degrees of freedom), or a sample of the measurand. For a production process (um given): the density function of the process (e.g. function(x) dnorm(x, 1500, 0.12)), a sample of it, or a propagate object whose Monte Carlo output describes the process (see 'Details').

lower, upper

the tolerance limits \(T_L\) and \(T_U\); one of them may be infinite (one-sided tolerance interval).

method

for a propagate object: "MC" uses the Monte Carlo sample, "GUF" the estimate, standard uncertainty and effective degrees of freedom of the GUM uncertainty framework (normal or scaled and shifted t-distribution).

prob

single item: the required conformance probability; acceptance limits are calculated such that a measured value at the limit has this conformance probability (guarded acceptance, JCGM 106:2012, 8.3).

um

production process: the standard uncertainty of the inspection measurement (normal PDF \(h(\eta_m|\eta)\)).

accept

production process: the acceptance limits c(AL, AU); default: the tolerance limits (simple acceptance), or the limits found for risk.

risk

production process: a target global consumer's risk; the acceptance limits are found as the tolerance limits shifted inwards by a guard band \(w\) (outwards if \(w < 0\)) such that \(R_C\) equals risk.

support

the support of the process density function (e.g. c(0, Inf) for a gamma density), used for the numerical integration.

rule

NULL (default) or one or several decision rules with the expanded uncertainty, or "all": "stringent" (stringent acceptance and stringent rejection, ISO 14253-1), "simple", "stringent.relaxed", "relaxed.stringent", "stringent.simple", "simple.stringent" (acceptance criterion first, rejection criterion second). For a production process, rule defines the acceptance limits and cannot be combined with accept or risk. See 'Details'.

p

the coverage probability of the expanded uncertainty used by rule.

interval

for a single item with method = "MC": the probabilistically symmetric or the shortest Monte Carlo coverage interval (JCGM 101:2008, 7.7), whose (asymmetric) half-widths are the expanded uncertainties \(U_-\) and \(U_+\).

x

an object of class conformity.

digits

the number of significant digits for printing.

density

logical. If TRUE, the probability density function of the measurand (single item) or of the process (production process) is drawn above the zone bars, with the parts inside and outside the tolerance interval shaded. Without rule, only the density is drawn.

col

the colours of the acceptance, rejection and uncertainty zones.

...

not used.

Author

Andrej-Nikolai Spiess

Details

Overview. For a single measured item, the conformance probability is calculated from the Monte Carlo output or the GUM uncertainty framework of a propagate object (or from an estimate and its standard uncertainty), together with acceptance limits with guard bands for a required conformance probability. For a production process, the global risks, the acceptance limits for a target consumer's risk and the capability indices are calculated. With rule, a single item gets the acceptance, rejection and uncertainty zones and the decision of each rule; a production process gets the accepted, rejected and undecided fractions and the consumer's and producer's risks of each rule. plot draws the probability density function with the conforming and non-conforming parts and the zones of the decision rules.

Single measured item (JCGM 106:2012, 7 and 8). The conformance probability is \(p_c = \Pr(T_L \le Y \le T_U)\). With method = "MC" it is the fraction of the Monte Carlo output within the tolerance interval, which accounts for an asymmetric or non-normal distribution of the measurand. With method = "GUF" it is \(p_c = F((T_U - y)/u) - F((T_L - y)/u)\), with \(F\) the standard normal distribution function or, for \(\nu < 1000\), the t-distribution function (JCGM 106:2012, 7.3, 7.4; JCGM 101:2008, 6.4.9). With prob, the acceptance limits are \(A_U = T_U - q_{p}\) and \(A_L = T_L - q_{1-p}\), where \(q\) are the quantiles of \(Y - y\) (one-sided at each limit), assuming that the distribution shifts with the measured value.

Production process (JCGM 106:2012, 9.5). The process distribution \(g_0(\eta)\) plays the role of the prior distribution of the property of the items, and a measured value has the normal distribution \(h(\eta_m|\eta)\) with standard deviation um. With the conformance region \(C\) and the acceptance interval \(A\), $$R_C = \int_{\eta \notin C} \Pr(\eta_m \in A | \eta)\, g_0(\eta)\, d\eta, \qquad R_P = \int_{\eta \in C} \Pr(\eta_m \notin A | \eta)\, g_0(\eta)\, d\eta$$ are the global consumer's and producer's risks, computed by numerical integration for a density function and as Monte Carlo averages for a sample. The output also contains the conforming fraction of the process, the accepted fraction, the non-conforming fraction among the accepted items, and the process mean, standard deviation, capability indices \(C_p = (T_U - T_L)/(6s)\) and \(C_{pk}\) (normal-theory definitions) and the number of defects per million (DPMO).

Decision rules (rule; ISO 14253-1, ASME B89.7.3.1, VDA 5). With the expanded uncertainty given by the coverage interval \([y - U_-, y + U_+]\) for coverage probability p (\(U_- = U_+ = k\,u\) for the GUF, with \(k\) from the normal or t-distribution; asymmetric for the Monte Carlo method; \(U = k\,u_m\) with \(k = \Phi^{-1}((1+p)/2)\) for a production process), the acceptance and rejection criteria are

criterionacceptance: measured value inrejection: measured value below / above
stringent\([T_L + U_-, T_U - U_+]\)\(T_L - U_+\) / \(T_U + U_-\)
simple\([T_L, T_U]\)\(T_L\) / \(T_U\)
relaxed\([T_L - U_+, T_U + U_-]\)\(T_L + U_-\) / \(T_U - U_+\)

Stringent acceptance accepts only if the whole coverage interval lies within the tolerance interval (protection of the consumer; guarded acceptance with guard band \(w = U\) in the terms of JCGM 106:2012, 8.3); stringent rejection rejects only if the whole coverage interval lies outside (protection of the producer; guarded rejection). A rule combines one acceptance and one rejection criterion; measured values that are neither accepted nor rejected lie in the uncertainty zone ("no decision"). "stringent" (stringent acceptance and stringent rejection) is the default rule of ISO 14253-1.

For a single item, the decision of each rule is returned. For a production process, each rule gives, by the integrals above with the acceptance interval \(A\) of the rule and the rejection limits \(R_L\), \(R_U\): the accepted fraction, the rejected fraction \(\Pr(\eta_m < R_L \mbox{ or } \eta_m > R_U)\), the undecided fraction (items in the uncertainty zone, e.g. to be measured again), the consumer's risk \(R_C\) (accepted and not conforming) and the producer's risk \(R_P\) (rejected and conforming). This shows directly what a rule costs the producer and gains the consumer. The rule "simple" gives the risks of simple acceptance (accept = tolerance limits), and the acceptance criterion "stringent" those of guarded acceptance with \(w = U\).

Process or measurand? For a single item, the propagate object describes the knowledge of one measurand (for Type A inputs, the uncertainty of a mean). For a production process, the sample must describe the scatter of the individual items, e.g. a propagate object of a transfer function whose inputs are the item-to-item distributions of the components (assigned with makeDat or as type = "sim"), not the uncertainties of their means.

References

Conformity assessment and measurement uncertainty:
Evaluation of measurement data - The role of measurement uncertainty in conformity assessment.
JCGM 106:2012. Joint Committee for Guides in Metrology (2012).
tools:::Rd_expr_doi("10.59161/JCGM106-2012")

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. Joint Committee for Guides in Metrology (2008).
tools:::Rd_expr_doi("10.59161/JCGM101-2008")

Decision rules:
Geometrical product specifications (GPS) - Inspection by measurement of workpieces and measuring equipment - Part 1: Decision rules for verifying conformity or nonconformity with specifications.
ISO 14253-1:2017. International Organization for Standardization, Geneva (2017).

Guidelines for Decision Rules: Considering Measurement Uncertainty in Determining Conformance to Specifications.
ASME B89.7.3.1-2001. American Society of Mechanical Engineers, New York (2001).

Capability of Measurement Processes.
VDA Volume 5, 2nd edition. Verband der Automobilindustrie (VDA), Berlin (2010).

See Also

propagate, makeDat; all examples of JCGM 106:2012 with comparisons against the published values: demo("JCGM106", package = "propagate").

Examples

Run this code
## JCGM 106, 7.3: Zener diode, V_b <= -5.40 V, y = -5.47 V, u = 0.05 V: pc = 0.92
conformity(c(-5.47, 0.05), upper = -5.40)

## JCGM 106, 7.4: motor oil, 12.5 <= Y <= 16.3 mm^2/s: pc = 0.66
conformity(c(13.6, 1.8), lower = 12.5, upper = 16.3)

## JCGM 106, 8.3.3: nandrolone, t-distribution with 9 degrees of freedom, decision limit 2.37 ug/L
conformity(c(2.00, 0.20, 9), lower = 2.00, prob = 0.95)

## JCGM 106, 9.5.3: precision resistors, R_C = 0.01, R_P = 0.07
conformity(function(x) dnorm(x, 1500, 0.12), lower = 1499.8, upper = 1500.2,
           um = 0.04, accept = c(1499.82, 1500.18))

## JCGM 106, 9.5.4: ball bearings, acceptance limit for R_C = 0.1 %: A = 1.7 um
conformity(function(x) dgamma(x, shape = 4, rate = 4), upper = 2, um = 0.25,
           risk = 0.001, support = c(0, Inf))

## Monte Carlo output of 'propagate' (asymmetric, JCGM 101:2008, 9.4):
## the conformance probability differs from the GUF value
DAT <- cbind(X1 = c(0.010, 0.005, Inf), X2 = c(0, 0.005, Inf))
RES <- propagate(expression(1E6 * (X1^2 + X2^2)), DAT, type = "stat", nsim = 1E5, check = FALSE)
conformity(RES, upper = 300)
conformity(RES, upper = 300, method = "GUF")

## Decision rules (ISO 14253-1) for the Zener diode: zones and decisions of all six rules
C1 <- conformity(c(-5.47, 0.05), upper = -5.40, rule = "all")
C1
plot(C1)

## ... and for the production of precision resistors: risks of each rule
R1 <- conformity(function(x) dnorm(x, 1500, 0.12), lower = 1499.8, upper = 1500.2,
                 um = 0.04, rule = "all")
R1$rules[, c("rule", "accepted", "undecided", "RC", "RP")]
plot(R1)

Run the code above in your browser using DataLab