| compare_mds_ssp | R Documentation |
Compares the minimum sample size required by an MDS plan and a corresponding single sampling plan (SSP).
compare_mds_ssp(p, a, b, i = 1, beta = 0.25, c1 = 0, c2 = 1, n_max = 10000)
p |
User-defined failure probability. |
a |
Termination ratio. |
b |
Quality ratio. |
i |
Number of preceding lots in the MDS plan. |
beta |
Consumer's risk. |
c1 |
MDS first acceptance number and SSP acceptance number. |
c2 |
MDS second acceptance number. |
n_max |
Maximum sample size searched. |
The SSP uses acceptance number 'c1', while the MDS plan uses '(c1, c2, i)'. Both plans use the same failure probability ‘p' and consumer’s risk 'beta'.
The MDS sample size is determined from
P_a=A+B A^i\leq\beta.
The SSP sample size is determined from
P(D\leq c_1)\leq\beta.
Since the sample size is fixed for each inspected lot under both plans, ASN is equal to sample size for both plans.
A data frame containing the sample sizes required by the MDS and SSP plans.
# ----------------------------------------------------------
# Example 1: User-defined failure probabilities
# ----------------------------------------------------------
p <- c(0.05, 0.10, 0.15, 0.20)
a <- c(0.5, 1, 1.5, 2)
compare_mds_ssp(
p = p,
a = a,
b = 1,
i = 3,
beta = 0.25,
c1 = 0,
c2 = 1
)
# ----------------------------------------------------------
# Example 2: Generalized Exponential distribution
# ----------------------------------------------------------
alpha <- 2
b <- 1
a <- c(0.5, 0.75, 1, 1.25, 1.5, 1.75, 2)
p <- ( 1- exp(-a / b))^alpha
compare_mds_ssp(
p = p,
a = a,
b = 1,
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.