mds_asip: Multiple Dependent State Sampling Plan (MDS)

View source: R/rMDSPTT.R

mds_asipR Documentation

Multiple Dependent State Sampling Plan (MDS)

Description

Calculates the minimum sample size for a Multiple Dependent State Sampling (MDS) plan for inspection by attributes under a time-truncated life test.

Usage

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

Arguments

p

User-defined probability of failure before the termination time. It must lie strictly between 0 and 1.

a

Termination ratio, defined as 'a = t/theta0'. It must contain positive values.

b

Quality ratio, defined as 'b = theta/theta0'. It must contain positive values. It is included to identify the design condition associated with 'p'.

i

Number of preceding lots considered in the MDS decision. It must be a positive integer.

beta

Consumer's risk. It must be between 0 and 1.

c1

First acceptance number. It must be a non-negative integer.

c2

Second acceptance number. It must be greater than or equal to 'c1'.

n_max

Maximum sample size to be searched.

Details

The failure probability before the termination time is supplied directly by the user through 'p'. Thus, the function is distribution-free.

The MDS plan is specified by '(n, c1, c2, i)'.

Let D denote the number of defective units in a sample. Under the binomial model,

D\sim Binomial(n,p)

Define

A=P(D\leq c_1)

and

B=P(c_1<D\leq c_2).

The probability of acceptance of the MDS plan is obtained from

P_a=A+B A^i.

The minimum sample size is the smallest 'n' satisfying

P_a\leq\beta.

For this MDS plan, the sample size of every inspected lot is fixed at 'n'. Therefore, the average sample number (ASN) is exactly equal to 'n'.

Value

A data frame containing the design values, minimum sample size 'n', ASN, probabilities 'A' and 'B', and the probability of acceptance 'Pa'.

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)

mds_asip(
  p = p,
  a = a,
  b = 1,
  i = 3,
  beta = 0.25,
  c1 = 0,
  c2 = 1
)


# ----------------------------------------------------------
# Example 2: Weibull distribution
# ----------------------------------------------------------

shape <- 2
b <- 1

a <- c(
  0.5, 0.75, 1, 1.25,
  1.5, 1.75, 2
)

p <- 1 - exp(
  -((a / b)^shape)
)

mds_asip(
  p = p,
  a = a,
  b = b,
  i = 3,
  beta = 0.25,
  c1 = 0,
  c2 = 1
)


# ----------------------------------------------------------
# Example 3: 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

mds_asip(
  p = p,
  a = a,
  b = b,
  i = 3,
  beta = 0.25,
  c1 = 0,
  c2 = 1
)


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

Related to mds_asip in rMDSPTT...