PYTHON IMPLEMENTATION OF FUZZY LOGIC FOR ZERO-INFLATED POISSON SINGLE SAMPLING PLANS
Kavithanjali S* and Sheik Abdullah A1
Department of Statistics, Salem Sowdeswari College, Salem-636 010, Tamil Nadu, India * [email protected], 1 [email protected] Correspondence Email: [email protected]
Abstract
Acceptance sampling is used in Statistical Quality Control (SQC) to conduct lot quality evaluations through sample inspections which involve probability theory and fuzzy sets. It aims to optimize quality, costs, and productivity, frequently applying linguistic variables when accurate parameter values are not good enough which is handled using fuzzy set theory. This research analyses single sampling plans (SSP) in the presence of fuzzy number non-conformities, modelling them with the Zero-inflated Poisson (ZIP) distribution structure. This study presents a unique method to single sampling plans (SSP) inside the Zero-inflated Poisson (ZIP) distribution framework that makes use of fuzzy logic approaches. In addition, we show how to apply this method using a Python programme, providing practical suggestions for real-world quality control complications.
Keywords: Acceptance sampling plan, Single sampling plan (SSP), ZIP distribution, OC functions, Fuzzy Parameter.
I. Introduction
Acceptance sampling, which is critical in industrial sectors, maintains product quality while balancing time and cost restrictions. It categorizes features and variables, including single, double, and sequential sample plans, which are critical for raw material and product inspections. Designing single sampling plans (SSP) requires balancing producer and consumer interests using criteria such as lot size, sample size, and acceptance rates.
Stephens [16] and Schilling &Neubauer [15] provide details on SSP determination, while Duncan [4] and Schilling &Neubauer [15] expound on approaches based on the Poisson distribution. Technological developments seek towards zero defects, yet random fluctuations require models such as the zero-inflated Poisson (ZIP) distribution, which is a hybrid of the zero-inflated and Poisson distributions. ZIP finds applications across disciplines, from agriculture to manufacturing, detailed in Bohning et.al., [1], Lambert [10], Naya et al. [13], and Ridout et al. [14]. Under the assumption of a zero-inflated Poisson distribution, Loganathan and Shalini [11] created single sample plans based on characteristics. Xie et al. [18] address the construction of control charts using the ZIP distribution. In McLachlan and Peel [12], several theoretical elements of ZIP distributions are discussed. The ZIP (w, A) distribution's probability mass function (p.m.f.) may be found in Lambert [10] and McLachlan and Peel [12]. Kavithanjali and Sheik Abdullah [8] review a various sampling plans.
Lotfi A. Zadeh [9] invented fuzzy set theory. Many authors, including Tamaki, Kanagawa and Ohta [17], Grzegorzewski [6], Hrniewicz [7], Chakraborty [3], Buckley [2], EzzatallahBaloui et al. [5], have developed fuzzy statistical theory and statistical applications-based challenges in
Kavithanjali S, Sheik Abdullah A RT&A, No 3 (79) PYTHON IMPLEMENTATION OF FUZZY LOGIC FOR ZIP SSP_Volume 19, September 2024
recent years. In the ensuing sections, will take a look at the methods used, show the final results
of the study, and explain the relevance of our findings for quality control professionals. We are
optimistic that our research will contribute considerably to the developing spectrum of statistical
approaches designed to address the problems posed by challenging distributions in industrial
scenarios. This work investigates finding SSPs based on characteristics within ZIP distribution
conditions. Section 2 introduces the approach and terminology. Section 3 describes how to design
SSPs fuzzy OC functions and a Python script. Section 4 displays how to pick sample plans, FOC
bands, and conclusions, which highlight the study's findings regarding SSP determination.
II. Methodology
2.1 Basic Definitions:
2.1.1 Fuzzy Number: If and only if (i) N is normal (ii) N is fuzzy convex (iii) pN is upper semi continuous (iv) Supp ( N~ ) is bounded, the fuzzy subset N~ of the real line R with the membership function fifl ■' R ^ 01 is a fuzzy number.
2.1.2 Triangular Fuzzy: A triangular fuzzy number is a fuzzy number N with a membership function given by three numbers a < C < d, with the interval [a, b] as the base and x=c as the vertex.
2.1.3 Fuzzy a Cut: The a -cut of a fuzzy integer N is defined as N[a] = [XeR; ^N(x) > a} in a non-fuzzy set. Consequently, we have N\a\ = [NL (a),NU (a)]
Where NL[a] = inf[XeR;^N(x) > a} (Infimum of lower limit a -cut)
Nu[a] = sup[XeR; ^N(x) > a} (supremum of lower limit a -cut)
2.1.4 ZIP Distribution: The ZIP (9, A) distribution's probability mass function (p.m.f.) found in Lambert [9] and McLachlan and Peel [11]. P(X = d j p,A) = cpf(d) + (1 -p)P(X = d j A),
where
f(d) = {10 I and P(X = d/X) =
d = 0and P(X = dm = V— V d = 0,1,2-'andA> 0
0 if d ^ 0 ^0 otherwise
Given the ZIP (9,A) distribution, the probability mass function of the distribution can be written as
( <p + (1- <p)e-x Whend = 0
P(X = d / p,A) = P(d) = \ e-xAd
1(1-0)—;— When d = 1,2,...,0<<p <1,A> 0 v d\
To obtain the fuzzy ZIP probability mass function, replace A with the fuzzy number A >9. Let P(d) be the approximate probability that D equals d. Next, we get this fuzzy number's a -cut as
(p + (1- <p)e-x Whend = 0 P(X = d / cp,A) = P(d)[a]=\ -w \AeA(a)
[(1-V)—^ When d = 1,2,...,0<p<1,A>0
For every a e \0,l\ So that 3p\a\. The fuzzy parameter p(d)a\ has been supplanted by P\a,b\\a\.
(p + (1- <p)e-x Whend = 0 P[a,b][a] = \ -kxd ^^^ \Aenp(a)
[(1-V)—^ When d = 1,2,...,0<p<1,A>0
The ZIP (9, A) has a mean of (1- 9) and a variance of (1- 9)(1+^ 9).
III. OC function of SSP in ZIP distribution conditions
A Single Sampling Plan (SSP) with characteristics is defined by three parameters N, n, and c. A random sample of size n is taken from a large number of N units, and the number of
Kavithanjali S, Sheik Abdullah A RT&A, No 3 (79) PYTHON IMPLEMENTATION OF FUZZY LOGIC FOR ZIP SSP_Volume 19, September 2024
nonconforming units, X = d, is counted. If d < c, the lot is accepted, otherwise it is rejected.
Evaluating the performance of a sample plan entails examining its Operating Characteristic (OC)
function, which indicates its ability to discern acceptable from non-acceptable lots based on certain
criteria. Pa (p) = [x < c\
Using the Zero-Inflated Poisson model, the probability mass function of the number of defects in the lot is given by
( <p + (1- (p)e-x Whend = 0
P(X = d / 9,A) = P(d) = \ e-xAd
\(1-(p)—;— When d = 1,2,...,0<<p <1,A> 0 v d!
Given a sample size of n, the probability of finding no deficiencies will be P(X=0) = Pa(p) = (p + (1-cp)e-nP (1)
This is the single sample plan's OC function when c=1. Then equation becomes Pa(p) = <P + (1- <p)e-ni> (1 + np) (2)
Which is the single sampling plan's OC function for c=1
3.1 Python Programming
Python programming was used in this study on statistical quality control to create the Fuzzy OC Band table's upper and lower bounds. The Fuzzy Operating Characteristic (OC) and Fuzzy Probability of Acceptance curves were also drawn using Python. Python's extensive numerical calculation capabilities and flexible modules made it easy to use these statistical approaches inside the study framework.
Illustration 1: According to the company's experience, 0.5 percent of packages are empty. A department store has 60 items of this product on hand, and many customers select and browse asking if they can buy that item If our search shows that this sample has only one mismatch, the customer gets away buy every item in the store, otherwise, The fuzzy number where the customer can choose not to buy that product can be taken as P = (0,0.005,0.01). Consequently, the probability of purchase is similar to that to be described.
n=60, c=1, P =(0,0.005,0.01), I = np , ( = 0.0001
I =[0,0.3,0.6], ~[a\ = [0.3a , 0.6 - 0.3a\ Pa(p) =<p + (1- p)e-nP + (1- y)e-np (n p) Inp eA(a) Therefore, the <p + (1- <p)e-nv (1 + n p)decreasing, then Pa(p) =<p + (1- y)e-(06-03a) (1 + (0.6 - 0.3a)),(p + (1- p)e-(03a) (1 + 0.3«) Under ^ = 0, 0.005, 0.01 discover Pa [p\ = [0.8781,l\ [0.87860, 0.9999\[0.8790, 0.9999\In
Figurel it shows is expected that 88 to 100 lots out of every 100 lots in this process will be accepted.
1
0.9 O.B 0.7 0.6
CD
f. 0.5 <o
04
0.3 0 2 0.1
8.86 0.68 0.S 0.92 0 94 0.96 0 98 1 tizzy probability cf acceptance
Figure 1: Fuzzy Probability of acceptance with P =(0,0.005,0.01)
IV. FOC band
The SSP operational characteristic curve is built using fuzzy parameters. The operational characteristic curve represents both the proportion of defective p and the probability of acceptance (Pa(p)). The sampling plan's operational characteristic curve can be utilized to identify excellent and challenging lots. When a consumer rejects a product that meets the established conditions (i.e., the product quality is good), this risk is referred to as producer's risk; when a consumer accepts a product that does not meet the conditions (i.e., the product quality is bad), this risk is referred to as consumer's risk. An upper and lower band fuzzy parameter may be used to calculate the proportion defective, if the values of the upper and lower band are equal, this is referred to as superior state.
In firm related to example we had n=60 p = 0.0001, P =(0,0.005,0.01) c = 1,a2 = 0.005, a3 = 0.01, a = 0 A0\=\nknk + 9.91n\,9 < k < 9.99
From equation (2) Pa(p) = cp + (1- ^e-^ (1 + (X2aj), <p + (1 - y)e-@ia) (1 + (^a)) = <p + (1- <p)e-ink+o.oin) (1 + nk + 0.01n), <p + (1- p)e-(nk) (1 + nk)
Table 1: Fuzzy Probability of Acceptance p = 0.0001, c=1, n=60
k Pa (P )
0 0.878111, 1.000000
0.01 0.662661, 0.878111
0.02 0.462891, 0.662661
0.03 0.308510, 0.462891
0.04 0.199228, 0.308510
0.05 0.125777, 0.199228
0.06 0.078069, 0.125777
0.07 0.047828, 0.078069
0.08 0.029003, 0.047828
0.09 0.017450, 0.029003
0.1 0.010438, 0.017450
Example 1. Table 1 and Figure 2 illustrate the OC curve. This graphic shows how process quality will drop from extremely good to moderate, while the OC curve will expand.
Figure 2: OC Curve for SSP with Fuzzy Parameter of c=1, n=60 Illustration 2: Had p = 0.0001, c=0 and a2=0.005, aa=0.01, A[0] = [20k + 0.2,0 < k < 0.99,
leading to OC curve in terms of fuzzy ZIP distribution. From equation (1),
Pa(p) = <p + (1- (p)e-n* IAeA(0) = <p + (1 - y)e-(0 01n+nk),y + (1 - p)e-(nk) = <p + {1- <p)e-(0 2+20k),<p + (1- <p)e-(20k)
Operating Characteristic (00 Curve
Figure 3: OC Curve for a SSP with fuzzy parameter of c=0
Table 2: Fuzzy Probability of Acceptance ( = 0.0001, c=0 with different sample size(n)
n=10 n=20 n=30 n=40
K Pa(p) k Pa(p) k Pa(p) k Pa(p)
0 0.9048, 1.0000 0 0.8187, 1.0000 0 0.7408,1.0000 0 0.6704,1.0000
0.01 0.8187,0.9048 0.01 0.6704,0.8187 0.01 0.5489,0.7408 0.01 0.4494,0.6704
0.02 0.7408,0.8187 0.02 0.5489, 0.6704 0.02 0.4066,0.5489 0.02 0.3013,0.4494
0.03 0.6704,0.7408 0.03 0.4494,0.5489 0.03 0.3013,0.4066 0.03 0.2020,0.3013
0.04 0.6066,0.6704 0.04 .3679, 0.4494 0.04 0.2232,0.3013 0.04 0.1354,0.2020
0.05 0.5489,0.6066 0.05 0.3013,0.3679 0.05 0.1654,0.2232 0.05 0.0908,0.1354
0.06 0.4966,0.5489 0.06 0.2467,0.3013 0.06 0.1225,0.1654 0.06 0.0609,0.0908
0.07 0.4494,0.4966 0.07 0.2020,0.2467 0.07 0.0908,0.1225 0.07 0.0409,0.0609
0.08 0.4066,0.4494 0.08 0.1654,0.2020 0.08 0.0673,0.0908 0.08 0.0274,0.0409
0.09 0.3679,0.4066 0.09 0.1354,0.1654 0.09 0.0499,0.0673 0.09 0.0184,0.0274
0.1 0.3329,0.3679 0.1 0.1109,0.1354 0.1 0.0370,0.0499 0.1 0.0124,0.0184
n=60 n=80 n=100 n=120
K Pa(p) k Pa(p) k Pa(p) k Pa(p)
0 0.5489,1.0000 0 0.4494,1.0000 0 0.3679,1.0000 0 0.3013,1.0000
0.01 0.3013,0.5489 0.01 0.2020,0.4494 0.01 0.1354,0.3679 0.01 0.0908,0.3013
0.02 0.1654,0.3013 0.02 0.0908,0.2020 0.02 0.0499,0.1354 0.02 0.0274,0.0908
0.03 0.0908,0.1654 0.03 0.0409,0.0908 0.03 0.0184,0.0499 0.03 0.0083,0.0274
0.04 0.0499,0.0908 0.04 0.0184,0.0409 0.04 0.0068,0.0184 0.04 0.0026,0.0083
0.05 0.0274,0.0499 0.05 0.0083,0.0184 0.05 0.0026,0.0068 0.05 0.0008,0.0026
0.06 0.0151,0.0274 0.06 0.0038,0.0083 0.06 0.0010,0.0026 0.06 0.0003,0.0008
0.07 0.0083,0.0151 0.07 0.0018,0.0038 0.07 0.0004,0.0010 0.07 0.0002,0.0003
0.08 0.0046,0.0083 0.08 0.0008,0.0018 0.08 0.0002,0.0004 0.08 0.0001,0.0002
0.09 0.0026,0.0046 0.09 0.0004,0.0008 0.09 0.0001,0.0002 0.09 0.0001,0.0001
0.1 0.0015,0.0026 0.1 0.0003,0.0004 0.1 0.0001,0.0001 0.1 0.0001,0.0001
n=140 n=160 n=180 n=200
K Pa(p) k Pa(p) k Pa(p) k Pa(p)
0 0.2467,1.0000 0 0.2020,1.0000 0 0.1654,1.0000 0 0.1354,1.0000
0.01 0.0609,0.2467 0.01 0.0409,0.2020 0.01 0.0274,0.1654 0.01 0.0184,0.1354
0.02 0.0151,0.0609 0.02 0.0083,0.0409 0.02 0.0046,0.0274 0.02 0.0026,0.0184
0.03 0.0038,0.0151 0.03 0.0018,0.0083 0.03 0.0008,0.0046 0.03 0.0004,0.0026
0.04 0.0010,0.0038 0.04 0.0004,0.0018 0.04 0.0002,0.0008 0.04 0.0001,0.0004
0.05 0.0003,0.0010 0.05 0.0002,0.0004 0.05 0.0001,0.0002 0.05 0.0001,0.0001
0.06 0.0002,0.0003 0.06 0.0001,0.0002 0.06 0.0001,0.0001 0.06 0.0001,0.0001
0.07 0.0001,0.0002 0.07 0.0001,0.0001 0.07 0.0001,0.0001 0.07 0.0001,0.0001
0.08 0.0001,0.0001 0.08 0.0001,0.0001 0.08 0.0001,0.0001 0.08 0.0001,0.0001
0.09 0.0001,0.0001 0.09 0.0001,0.0001 0.09 0.0001,0.0001 0.09 0.0001,0.0001
0.1 0.0001,0.0001 0.1 0.0001,0.0001 0.1 0.0001,0.0001 0.1 0.0001,0.0001
Table 2 and Figure 3 show that separate curves in the plot indicate sample sizes ranging from 10 to 200.Each curve represents a unique sample size and indicates how the probability of accepting the null assumption varies with effect size (k) for different sample sizes.
• The probability of rejecting the null hypothesis rises with an increase in effect size, k.
• smaller sample sizes (lower (n )) typically have lesser (k ) discriminative powers to identify differences, which raises the likelihood of adopting the null hypothesis.
• With larger sample sizes, the ability to detect differences improves and the null theory is less likely to be accepted.
• The OC curve, in essence, represents the relationship between sample size, effect magnitude, and the chance of not rejecting the hypothesis. As a result of this, statisticians can evaluate their assumptions and make choices with greater certainty.
• Finally, the fuzzy ZIP distribution can be used to approximate the OC curve. In this regard, a plan of this such can be created using the OC fuzzy ZIP distribution. The OC curve shows that zero convergences with the acceptance number (c), which causes a rapid fall in the fuzzy probability of accepting the proportion of faulty goods with small fuzzy numbers. This is why there is the increase in n.
V. Conclusions
In this research introduces a new way to design SSP by combining fuzzy logic with the ZIP distribution. This improves how we control quality. In this method manages risks for both producers and consumers well. Importantly, In this plans work smoothly alongside traditional ones when damage is rare, making them adaptable. The suggested OC curves have clear restrictions, no acceptance values, and are simple to interpret, making them extremely helpful. This new approach improves the way we choose samples in quality control, particularly when dealing with complex distribution patterns. We seek to improve our goods and make users better through using fuzzy logic and ZIP distribution, particularly in competitive marketplaces.
References:
[1] Bohning D, Dietz E, Schlattmann P.(1999). The zero-inflated Poisson model and the decayed, missing and filled teeth index in dental epidemiology. Journal of royal statistical society, Series A, 162(2),195-209.
[2] Buckley J. J. Fuzzy probability: New approach and application, physica-velage, Heidelberg, Germany, (2003).
[3] Chakraborty T.K.(1994) A class of single sampling plan based on fuzzy Optimization, Opsearch, 63(1), 35-43.
[4] Duncan, A. J. Quality Control and Industrial Statistics. Homewood: Richard D. Irwin, Inc. 1986.
[5] EzzatallahBalouiJamkhaneh et. Al.,(2009). Acceptance Single Sampling Plan with fuzzy parameter with the using of Poisson distribution, International journal of mathematical, computational, physical, electrical and Computer Engineering, 3(1), 1017-1021.
[6] Grzegorzewski P.(1008) A soft design of acceptance sampling by attributes, Proceedings of the VIth International Workshop on Intelligent statistical quality control. Wurzburg, 14(16), 29-38.
[7] Hrniewicz. O.(1994). Statistical acceptance sampling with uncertain information from a sample and fuzzy quality criteria, Working Paper of SRI PAS, Warsaw,(in Polish), 16(1), 197-206.
[8] Kavithanjali, S Sheik Abdullah, A. (2024). A Review study on Various Sampling Plans, GVN Publication, 1(2), 15-28.
[9] L.A Zadeh. (1965). Fuzzy Sets, Information and Control, 38(4), 338-353.
[10] Lambert D.(1992). Zero-inflated Poisson regression with an application to defects in
manufacturing. Technometrics, 34(1), 1-14.
[11] Loganathan A, Shalini K.(2014). Determination of Single Sampling Plans by Attributes Under the Conditions of Zero-Inflated Poisson Distributions. Communication in Statistics-Simulation and Computation, 43(3), 538-548.
[12] McLachlan G, Peel D. Finite Mixture Models. New York: John Wiley & Sons, 2000.
[13] Naya H, Urioste JI, Chang YM, Motta MR, Kremer R, Gianola D.(2008). A comparison between Poisson and zero inflated Poisson regression models with an application to number of black spot in corriedale sheep. Genetics Selection Evolution. 40(1), 379-394.
[14] Ridout M, Demtrio CGB, Hinde J.( 1998). Models for Count Data with Many Zeros. Cape Town, International Biometric Conference, 34(1), 531-547.
[15] Schilling, E. G., Neubauer, D. V. Acceptance Sampling in Quality Control. Boca Raton: CRC Press. 2009.
[16] Stephens, K. S. The Handbook of Applied Acceptance Sampling Plans, Procedures and
Principles. Wisconsin: ASQ Quality Press. 2001.
[17] Tamaki f., Kanagawa a. And Ohta h. (1991) A Fuzzy Design of Sampling Inspection plans by Attributes, Japanese journal of fuzzy theory and systems, 3(4), 767-776.
[18] Xie M, He B, Goh TN.(2001). Zero-inflated Poisson model in statistical process control. Computational Statistics & Data Analysis, 38(2),191-201.