C
I wrote a computer program to simulate the inspection of a lot using a sequential sampling plan.
Unfortunately, I cannot post links, but the literature says:
p1= AQL
p2= LTPD
a or alpha= Producer's Risk
b or beta= Consumer's Risk
k=log(p2*(1-p1)/p1/(1-p2))
h1=log((1-a)/b)/k
h2=log((1-b)/a)/k
s=log((1-p1)/(1-p2))/k
The acceptance number is: xa = s*n-h1,
while the rejection number is: xr = s*n+h2
n is the number of samples taken from the lot.
In the NIST's handbook chapter 6.2.6 there is an example with:
p1 = .01, p2 = .10, alpha = .05, beta = .10.
I simulate the inspection of a lot with exactly p1 defectives, so that I should get a rejection rate very close to alpha (which is the probability of rejecting a lot that has a defect level equal to p1).
I run the simulation for 10^6 lots and I get alpha = 0.0193 instead of 0.05 as expected, while beta is good (0.095 instead of 0.1).
But if I run the simulation using alpha = 2 * alpha, I get alpha = 0.0473, in good agreement with the expected value (beta is still good: 0.093).
That happens with any alpha, beta, p1 and p2. Why?
Thank you and sorry for my English
Cristiano
Unfortunately, I cannot post links, but the literature says:
p1= AQL
p2= LTPD
a or alpha= Producer's Risk
b or beta= Consumer's Risk
k=log(p2*(1-p1)/p1/(1-p2))
h1=log((1-a)/b)/k
h2=log((1-b)/a)/k
s=log((1-p1)/(1-p2))/k
The acceptance number is: xa = s*n-h1,
while the rejection number is: xr = s*n+h2
n is the number of samples taken from the lot.
In the NIST's handbook chapter 6.2.6 there is an example with:
p1 = .01, p2 = .10, alpha = .05, beta = .10.
I simulate the inspection of a lot with exactly p1 defectives, so that I should get a rejection rate very close to alpha (which is the probability of rejecting a lot that has a defect level equal to p1).
I run the simulation for 10^6 lots and I get alpha = 0.0193 instead of 0.05 as expected, while beta is good (0.095 instead of 0.1).
But if I run the simulation using alpha = 2 * alpha, I get alpha = 0.0473, in good agreement with the expected value (beta is still good: 0.093).
That happens with any alpha, beta, p1 and p2. Why?
Thank you and sorry for my English
Cristiano