11.07.2014 Views

Multiattribute acceptance sampling plans - Library(ISI Kolkata ...

Multiattribute acceptance sampling plans - Library(ISI Kolkata ...

Multiattribute acceptance sampling plans - Library(ISI Kolkata ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Annexure<br />

Microsoft Visual Basic program as Excel Macro “Costcalculation” for<br />

obtaining the costs as relevant to Figure 3.1.3. The output of the program is<br />

the costs of an A kind plan with a 2 = 25, n = 250, N = 30000, and for a 1 = 5 (1) 20<br />

and the given cost parameters and parameters of the prior gamma<br />

distribution in section 3.1.6.<br />

Sub costcalculation()<br />

‘Fix lotsize<br />

Lotsize = 30000<br />

‘Input cost parameters and the parameters of the prior gamma distribution<br />

p1bar = 0.01<br />

p2bar = 0.035<br />

s1 = 1.2<br />

s2 = 40<br />

‘Fix a2 and Sample size(n)<br />

a2 =25<br />

n = 250<br />

‘Define the range for a1<br />

For a1 = 5 To 20<br />

‘Cost calculation using the function gammapoisson<br />

For x1 = 0 To a1<br />

For x2 = 0 To a2 - x1 ‘This is the range of <strong>acceptance</strong><br />

Z1 = p1bar * (s1 + x1) / (s1 + n * p1bar)<br />

Z2 = 0.675 * P2bar * (s2 + x2) / (s2 + n * P2bar)<br />

Z = (z1 + z2 - 0.05)<br />

Sum = sum + z * gammapoisson (x1, n * p1bar, s1) * gammapoisson (x2, n * P2bar, s2)<br />

Next x2<br />

Next x1<br />

Cost = lot * 0.05 + (lot - n) * z<br />

Next n<br />

138

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!