| mds_oc | R Documentation |
Calculates the operating characteristic (OC) values for a Multiple Dependent State Sampling (MDS) plan.
mds_oc(
p_design,
a,
p_oc,
b_oc,
i = 1,
beta = 0.25,
c1 = 0,
c2 = 1,
n_max = 10000
)
p_design |
Failure probability at the design condition. It must lie strictly between 0 and 1. |
a |
Termination ratio, defined as 'a = t/theta0'. |
p_oc |
Matrix or data frame of failure probabilities used for OC calculation. Rows correspond to 'a' and columns correspond to 'b_oc'. |
b_oc |
Quality ratios used for OC calculation. |
i |
Number of preceding lots considered in the MDS plan. |
beta |
Consumer's risk. |
c1 |
First acceptance number. |
c2 |
Second acceptance number. |
n_max |
Maximum sample size searched at the design condition. |
The sample size is first determined at the design condition using 'p_design' and the constraint 'Pa <= beta'. This sample size is then kept fixed while the failure probabilities in 'p_oc' are used to calculate the probability of acceptance for the quality ratios in 'b_oc'.
Let
A=P(D\leq c_1)
and
B=P(c_1<D\leq c_2).
The MDS probability of acceptance satisfies
P_a=A+B A^i.
The resulting 'Pa' values are the OC values for the specified quality ratios in 'b_oc', using 'Pa = A + B A^i'.
A data frame containing 'a', 'b', 'p', fixed 'n', 'ASN', 'A', 'B', and 'Pa'. The 'Pa' values are the OC values.
# ----------------------------------------------------------
# Example 1: User-defined failure probabilities
# ----------------------------------------------------------
a <- c(0.5, 1, 1.5, 2)
p_design <- c(
0.05, 0.10, 0.15, 0.20
)
b_oc <- 2:12
# User-defined probabilities for OC calculation.
# Rows correspond to a and columns correspond to b.
p_oc <- outer(
a,
b_oc,
function(a, b) pmin(0.95, a / (10 * b))
)
# The n values are determined using p_design and then
# kept fixed for all b values.
#
# The Pa values represent the OC values.
mds_oc(
p_design = p_design,
a = a,
p_oc = p_oc,
b_oc = b_oc,
i = 3,
beta = 0.25,
c1 = 0,
c2 = 1
)
# ----------------------------------------------------------
# Example 2: Weibull distribution
# ----------------------------------------------------------
shape <- 2
a <- c(0.5, 1, 1.5, 2)
# Design quality ratio
b_design <- 1
# Failure probabilities at b = 1
p_design <- 1 - exp(
-((a / b_design)^shape)
)
# Quality ratios for OC calculation
b_oc <- 2:12
# Failure probabilities for each a and b
p_oc <- sapply(
b_oc,
function(b)
1 - exp(-((a / b)^shape))
)
mds_oc(
p_design = p_design,
a = a,
p_oc = p_oc,
b_oc = b_oc,
i = 3,
beta = 0.25,
c1 = 0,
c2 = 1
)
# ----------------------------------------------------------
# Example 3: Generalized Exponential distribution
# ----------------------------------------------------------
alpha <- 2
a <- c(0.5, 1, 1.5, 2)
# Design quality ratio
b_design <- 1
# Failure probabilities at b = 1
p_design <- (
1 - exp(-a / b_design)
)^alpha
# Quality ratios for OC calculation
b_oc <- 2:12
# Failure probabilities for each a and b
p_oc <- sapply(
b_oc,
function(b)
(1 - exp(-a / b))^alpha
)
mds_oc(
p_design = p_design,
a = a,
p_oc = p_oc,
b_oc = b_oc,
i = 3,
beta = 0.25,
c1 = 0,
c2 = 1
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.