prob_contaminant: Probability of contaminated sample

Description Usage Arguments Details Value References See Also Examples

View source: R/prob_contaminant.R

Description

This function calculates the probability of exactly l contaminated samples out of t selected grab samples for given gram sample size r and serial correlation d at the process contamination level p for a production length of N.

Usage

1
prob_contaminant(l, r, t, d, p, N, method)

Arguments

l

number of contaminated in t selected samples

r

number of primary increments in a grab sample or grab sample size

t

number of grab samples

d

serial correlation of contamination between the primary increments

p

limiting fraction or proportion of contaminated increments

N

length of the production

method

what sampling method we have applied such as 'systematic' or 'random' selection methods

Details

Let S_t be the number of contaminated samples and S_t=∑ X_t where X_t=1 or 0 depending on the presence or absence of contamination, then P(S_t=l) formula given in Bhat and Lal (1988), also we can use following recurrence relation formula,

P(S_t=l)=P(X_t=1;S_{t-1}=l-1) + P(X_t=0;S_{t-1}=l)

which is given in Vellaisamy and Sankar (2001). Both methods will be produced the same results. For this package development, we directly applied formula which is from Bhat and Lal (1988).

Value

Probability of contaminated

References

See Also

prob_detect_single_grab, correlation_grab

Examples

1
2
3
4
5
6
7
8
  l <-  1
  r <-  25
  t <-  30
  d <-  0.99
  p <-  0.005
  N <-  1e9
  method <- 'systematic'
  prob_contaminant(l, r, t, d, p, N, method)

grabsampling documentation built on March 13, 2020, 5:07 p.m.