compare_mds_ssp: Compare MDS and Single Sampling Plans

View source: R/rMDSPTT.R

compare_mds_sspR Documentation

Compare MDS and Single Sampling Plans

Description

Compares the minimum sample size required by an MDS plan and a corresponding single sampling plan (SSP).

Usage

compare_mds_ssp(p, a, b, i = 1, beta = 0.25, c1 = 0, c2 = 1, n_max = 10000)

Arguments

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.

Details

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.

Value

A data frame containing the sample sizes required by the MDS and SSP plans.

Examples


# ----------------------------------------------------------
# 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
)

rMDSPTT documentation built on Oct. 2, 2026, 5:09 p.m.