Optimization of Bayesian repetitive group sampling plan for quality determination in Pharmaceutical products and related materials

Sampling plans are extensively used in pharmaceutical industries to test drugs or other related materials to ensure that they are safe and consistent. A sampling plan can help to determine the quality of products, to monitor the goodness of materials and to validate the yields whether it is free from defects or not. If the manufacturing process is precisely aligned, the occurrence of defects will be an unusual occasion and will result in an excess number of zeros (no defects) during the sampling inspection. The Zero Inflated Poisson (ZIP) distribution is studied for the given scenario, which helps the management to take a precise decision about the lot and it can certainly reduce the error rate than the regular Poisson model. The Bayesian methodology is a more appropriate statistical procedure for reaching a good decision if the previous knowledge is available concerning the production process. This article proposed a new design of the Bayesian Repetitive Group Sampling plan based on Zero Inflated Poisson distribution for the quality assurance in pharmaceutical products and related materials. This plan is studied through the Gamma-Zero Inflated Poisson (G-ZIP) model to safeguard both the producer and consumer by minimizing the Average Sample Number. Necessary tables and figures are constructed for the selection of optimal plan parameters and suitable illustrations are provided that are applicable for pharmaceutical industries.


Introduction
Acceptance sampling plans have been widely applied in pharmaceutical products manufacturing industries for inspecting raw materials and the final products by drug manufacturers and other stakeholders with an interest in ensuring the protection of pharmaceutical products. In such a way, the governmental and non-governmental organizations and consumer advocacy groups, use sampling plans, which are considered a key component of pharmaceutical quality assurance and quality control. Sampling plans are generally less expensive than coverage of 100% inspection, notably because there is much less inspection. It is regularly used to determine the disposition of incoming material when 100% inspection is not advisable. Sampling inspection is implemented when samples are drawn at random from a lot of incoming products and it is inspected according to certain standards. A decision is made concerning the lot is dependent on the knowledge acquired using the sample. Sampling plans can be broadly classified as a lot by lot sampling by attributes and lot by lot sampling by variables and these classifications are mostly dealt with the quality characteristic of inspection products. Generally, an attribute sampling plan requires a larger number of samples than variable sampling plans but it is comparatively easy to use. In attribute sampling, a predetermined number of units from each lot are inspected by which each unit is classified as conforming or nonconforming. If the number of nonconforming units in the sample is less than or equal to the prescribed minimum, accept the lot, otherwise, it is rejected. Sampling plans are further categorized as single sampling, double sampling, multiple sampling, sequential sampling, repetitive group sampling plans and so on, depending on the number of samples to be taken from the lot. A Repetitive Group Sampling (RGS) plan is more appropriate in situations when sampling inspection products are destructive and highly costly. Through this plan, either acceptance or rejection regarding the lot based on repeated sample test results of the great deal is same. The RGS plan can give the minimum sample size with desired protection than the single sampling plan. Sherman (1965) introduced the designing procedure of the Repetitive Group Sampling plan for attribute quality characteristics. Soundararajan and Ramasamy (1986) have developed certain procedures and tables for the selection of parameters for the RGS plan based on Poisson distribution. Balamurali et al. (2005) developed tables and the operating procedure for RGS plan under the variable quality constraints. Aslam et al. (2011) developed extensive tables for variable repetitive group sampling plans to deal with process loss for various combinations of acceptable quality levels. Fallah Nezhad et al. (2016) introduced a repetitive group sampling plan based on the Process Capability Index for the lot acceptance problem which is based on the concept of the variable sampling plan. Perez Gonzalez et al. (2020) have developed optimal truncated repetitive sampling plans for inspecting lots of manufactured material using Poisson defect count data.
Due to the extreme COVID-19 pandemic, every pharmaceutical products and related materials manufacturing industry in the world has increased production in the last few years. Further, they are focused on improving the quality of their own materials in the production process for increasing customer satisfaction and continually reducing costs. For that purpose, they are driven by rapid technological changes such as computerized automatic control systems, advanced analytical procedures, scientific management algorithms, etc. These techniques are used for monitoring and controlling product quality at each stage of production. Therefore, the number of defects occurring will be a rare event in such a production process. However, random fluctuations and some unavoidable reasons (materials made on different days or machines, materials made on different stations, products manufactured with different source materials) in manufacturing processes may lead some products to be in an imperfect state. In this case, a Zero Inflated Poisson (ZIP) distribution would be more appropriate than the traditional Poisson distribution. The ZIP distribution is widely applied in many practical fields. For example, medical research centers, actuarial science, software developing management, manufacturing, agricultural science, etc., Lambert (1992) discussed the application of the Zero Inflated Poisson (ZIP) model to count defects in the manufacturing process. Gupta et al. (1996) provided a general analysis of zero inflated models. Xie and Goh (1993) constructed a control chart for decision making in controlling high yield processes. Bohning et al. (1999) has made few essential comparisons between ZIP distribution and Poisson distribution to measure the dental health of individuals in dental epidemiology research. Xie et al. (2001) proposed control charts based on the ZIP model instead of the conventional Poisson model. Rodrigues (2003) studied the zero inflated Poisson distribution under the Bayesian point of view using the data augmentation algorithm. Rodrigues (2006) discussed an application of the full Bayesian significance test introduced by Pereira and Stern (1999) to compute the evidence of Poisson distribution against Zero-Inflated Poisson distribution (ZIP). Sim and Lim (2008) proposed the zero inflated models which will take the account of excess number of zeros in statistical process control. Mussida et al. (2013) reported that the ZIP distribution is well performed to model the excess zero counts data. Loganathan and Shalini (2014) developed the design of a single sampling plan by attributes under the conditions of Zero Inflated Poisson Distribution (ZIP). Unhapipet et al. (2017) have dealt with Bayesian predictive inference under the ZIP model for various types of prior distributions. Rao and Aslam (2017) have designed the resubmitted lots with an attribute single sampling plan for ZIP distribution.
The basic assumption underlying the theory of conventional sampling plans by attributes is that the lot or process fraction nonconforming is a constant, which implies that the production process is stable. However, in practice, the lots formed from a process will have quality variations, which occur due to random fluctuations. The variations in the lots are categorized into two types namely within-lot and between-lot variations. When the between-lot variation is more than the within-lot variation, the proportion of nonconforming units in the lots will vary continuously. In such cases, the decision on the submitted lots should be made with the consideration of the between-lot variations and hence the conventional sampling schemes cannot be employed. Alternatively, the sampling plans based on the Bayesian methodology can be applied which uses the knowledge on the process variation in making a decision on the disposition of the lot. Hald (1981) has discussed a detailed procedure and implication of the Bayesian Single Sampling Plan under the consideration of Gamma Poisson and Beta binomial distributions. Moreover, Calvin (1990), Case and Keats (1982), Guthrie and Johns (1959) are also made discussion on choosing a prior distribution for the lot fraction non-conforming items in the Bayesian sampling plan. Suresh and Latha (2001) have used gamma prior distribution and Poisson sampling to generate the tables for acceptance probabilities, point of inflection and its angle. Vijayaraghavan et al. (2008) discussed the Bayesian Single Sampling Plan using Gamma Poisson distribution and described a method to study the efficiency of their sampling plan compared to Conventional Poisson Single Sampling Plan. Similarly, Kaviyarasu and Sivakumar (2019) have developed the procedures and tables for a Single sampling plan based on ZIP distribution under the Bayesian perspective. Sano et al. (2020) demonstrated the formulation and manufacturing conditions that satisfy the criteria with a minimum number of experiments using Bayesian optimization for the pharmaceutical products. These techniques are helping to optimize the formulation and manufacturing methods of pharmaceutical products to eliminate unnecessary experiments and accelerate method development tasks However, sampling inspection is an effective way to ensure the product quality in pharmaceutical industries at various stages of the manufacturing process and before it is shipped for marketing. The present article proposed a new design and procedure of group sampling plan under the Bayesian perspective to determine the optimized plan parameters for desired quality levels. This proposed sampling plan is technically effective and economically efficient for ensuring the quality of the products in pharmaceutical industries.

WHO guidelines for the sampling of pharmaceutical products and related materials
According to the World Health Organization (WHO), sampling is a selection of a portion of pharmaceutical products/ goods for a definite purpose. The procedure which is used for sampling must be appropriate towards samples. Likewise, for solid oral dosage forms or liquid dosages or semi solid dosages, there are specific sampling regulatory procedures. WHO has published different plans for a sampling of raw materials which can be categorized as n plan, p plan, and r plan (Schilling & Neubauer, 2017). These sampling plans take into consideration the material variability, history of the sampler, and quantity needed for analysis.

The n plan
The "n plan" should be utilized using excessive carefulness and is mostly utilized when the sampled material is considered as uniform and is brought from a known basis as well as when the supplier is recognized and reliable. Samples can be withdrawn from any part of the container. The n plan is based on the formula 1 n N = + , where N is the number of sampling units in the consignment. The value of n is obtained by simple rounding. According to this plan, original samples are taken from n sampling units selected at random, and these are subsequently placed in separate sample containers.

The p plan
The "p plan" may be used when the material is uniform, is received from a recognized source, and the main purpose is to test for identity. The p plan is based on the formula 0.4 n N = , where N is the number of sampling units. The data for p is obtained by rounding up to the next highest integer. According to this plan, samples are taken from each of the N sampling units of the consignment and placed in separate sample containers. These original samples are transferred to the control laboratory, visually inspected, and tested for identity (a simplified method may be used). If the results are concordant, p final samples are formed by appropriate pooling of the original samples.

The r plan
The "r plan" may be used when the material is suspected to be non-uniform and is received from a source that is not well known. The r plan may also be used for herbal medicinal products used as starting materials. This plan is based on the formula 1.5 r N = , where N is the number of sampling units. The figures for r are obtained by rounding up to the next highest integer. However, these types of sampling plans only provide the size of the sample whereas it is not an appropriate method to determine the quality level of the bulk materials and ensure quality assurance. In such a situation, we recommend the riskbased Bayesian sampling plans to ensure the quality assurance of the products. Generally, risk-based Bayesian sampling plans are traditional in nature, drawing upon the producer and consumer type of risks as depicted by the OC curve. Therefore, the proposed BRGS sampling plan for the inspection has multiple advantages for the producer and the consumer. It helps accept a good lot of products and reject a bad lot. The use of a BRGS plan also motivates the producer to enhance the quality level.
In this paper, we proposed a new design of the Bayesian Repetitive Group sampling plan (BRGS) by attribute under the conditions of Gamma-Zero Inflated Poisson (G-ZIP) distribution for the application of pharmaceuticals products and related materials. In the next section, provides an operating procedure of the Repetitive Group Sampling plan. In the fourth section, a brief description of the Bayesian G-ZIP distribution along with its performance measure is given. The fifth section provides the operating procedure and tables for selecting the proposed plan and to determine the optimum plan parameters for the specified quality levels through the unity value approach. In the sixth section, numerical illustrations are provided and describe the effectiveness and application of the proposed sampling plan towards the pharmaceutical industries. The results are summarized in the concluding section.

Glossary
N-Lot size n -Sample size p -Proportion of defective c -Acceptance number d -Number of defects P a (p) -Probability of acceptance for given p -Acceptance Quality Level (AQL) α -Producer's risk -Limiting Quality Level (LQL) β -Consumer's risk

Designing of Repetitive Group Sampling plan
The idea of a Repetitive Group Sampling plan was proposed by Sherman (1965). The simple operating procedure for the standard characteristics follows an attribute in nature. The operating procedure of the RGS plan is as follows, • Step (i): Take a random sample of size n from the lot.
• Step (ii): Observe the number of non-conforming items, d in the sample.
• Step (iii): (a) If ≤ , then Accept the lot (b) If > , then Reject the lot (c) If < ≤ , then repeat the steps (i) and (ii) until a decision is made on lot. Thus, the RGS plan is completely specified by its parameters, namely sample size n and the acceptance numbers and . It is observed that the RGS plan is reduced to a single sampling plan when = and it is always noted that < . In such a way, in large lot, let p be the unknown proportion of defectives respectively, the probability of acceptance and rejection functions are defined as, From the above equations, the probability of acceptance and probability of rejection can be obtained from the group sample, when = ′ . Let and be the probabilities for eventually accepting and rejecting the lot, and are the acceptance numbers of the RGS plan. The probability of acceptance of the RGS plan as given below, It is usual practice in selecting a sampling plan to fix the operating characteristic curve according to desired discrimination. The OC curve is in turn fixed by suitably chosen parameters such as considering two points on it, namely( , 1 − ) and ( , ). Where, is the Acceptable Quality Level (AQL), is the producer's risk, is Limiting Quality Level (LQL) and is the consumer's risk.

The Operating Characteristic function of Bayesian RGS plan
The sampling plan based on a Poisson distribution has often been used to monitor the defects in sampling units. However, in a zero-defect manufacturing environment, it is frequently observed that significantly higher zero-defect counts come together with occasional nonconformities in certain samples. In such a case, the traditional sampling plan for monitoring the number of conformities is faced with several problems, and consequently, it fails to achieve the expected control. In such a case, one can use an alternative of distribution to monitor the production process, namely a Zero-Inflated Poisson (ZIP) distribution. As given by Lambert (1992) the probability function of a Zero Inflated Poisson distribution is as follows, with 0 < < 1, > 0. Here, ω and λ is the parameters of ZIP distribution. When = 0, this model is reduced by the Poisson model. Additionally, the mean and variance of the ZIP distribution are given as ( ) When the manufacturing process is well monitored, the occurrence of defects would be a rare event. The number of defects for many sampled products would be zero. Under such circumstances, the appropriate probability distribution of the number of defects in the sampled products is a ZIP distribution. According to Loganathan and Shalini (2014), the OC function under the conditions of ZIP distribution can be defined as, where np λ = , that is n is the sample size and p is proportion defects.
Bayesian methods arise naturally when the prior information is available for planning and estimation. When the number of nonconformities in sample follows the model of Zero Inflated Poisson distribution with parameter ( , ) np ω , when the proportion of nonconformities p varies at random from lot to lot and is distributed according to a gamma distribution, which is a natural conjugate prior to p, then the prior density function of the p is given by, Where, t is the scale parameter and s is the shape parameter. If ( ) E p p = is gives the scale parameter is obtained by Here, the prior knowledge s is estimated from the past history of the production process. Further, the uniform distribution is assumed to be the conjugate prior to ω with parameters a and b . The probability density function of the ω is defined as, The limitation of the parameter ω can be taking 0 a = and 1 b = , that is the uniform prior on (0,1). Then the equation for the standard uniform distribution is ( ) 1 f ω = with limitation 0 1 ω ≤ ≤ . Thus, parameter ω could be considered as the weighting parameter. Therefore, the predictive distribution of the number of defectives x is reduced to the G-ZIP distribution. When the production process is not stable, the non-conforming items and the average number of defects p are independently distributed. According to Hald (1981), the average probability of acceptance ̅ is approximately obtained by, Thus, therefore, the predictive distribution of the number of defectives x is reduced to the G-ZIP distribution and is given as, (1 ) , 0 ; , , 1 1 (1 ) , 1, 2,3 , 1

Determination of plan parameters
The determination of parameters for the Bayesian RGS plan under the conditions of G-ZIP distribution can be obtained through the two points on the OC curve approach for the specified strength 1 2 ( , , , ) p p α β . The plan parameters are determined to protect both the producers and consumers. Hence, the optimum plan parameters are studied by satisfying the following conditions, Here is the Acceptable Quality Level (AQL) corresponding to the producer's risk, is the Rejection Quality Level (LQL) corresponding to the consumer's risk. Under these conditions, can determine the plan parameters and minimize the Average Sample Number at the level of Limiting Quality Level (LQL). The ASN of the RGS plan is given by, R p p = . • Step 3. Select the R value from Table 1 and 2 that is the nearest to computed R value.
• Step 4. Determine the values of 1 np , and 2 np that correspond to the operating ratio R value located. • Step 5. The sample size is obtained by 1 1 n np p = or 2 2 np p whichever is larger. Also, the optimal parameter c that can be obtained corresponding to the operating ratio value R obtained in Step 2.

Numerical illustration
The quality control authorities are desired to determine a sampling plan by protecting both the producers and consumers risk in the pharmaceuticals manufacturing industry. Suppose that, they want to determine plan parameters for a proposed sampling plan with given values of

The advantage of proposed sampling plan
In this section, we describe the advantages of proposed BRGS plan over WHO guidelines recommended plans such as n plan, p plan and r plan. The p plan is primarily used to test the identity and only a few samples are required. Therefore, this plan is not suitable for making a comparison with the other existing plans. Hence, we compare the performance of the proposed BRGS plan with other two plans in terms of the operating characteristic curve. For instance, the quality control inspector fixed the parameters In order to compare these plans, we provide the OC curves of n plan with parameters ( ) In all the three plans, the same acceptance criteria with these plans recommended sample size are used. Now, we will investigate how these three plans are performing under identical AQL and LQL requirements. Figure 1 portrays the OC curves of these three plans.

Fig. 1. The Operating characteristic (OC) curves of BRGS plan, n plan and r plan
This figure clearly shows that for smaller values of fraction non-conforming, the BRGS plan has a higher probability than the other two plans. This means that the BRGS plan yields a lesser producer's risk and it also safeguards the consumer's interest compared to the other two sampling plans. Similarly, it is noted that for all higher values of fraction non-conforming, the probability of acceptance is low for the BRGS plan than the other two sampling plans. Thus the proposed sampling plan gives better precision and protection to consumers compared to other conventional sampling plans.

The significance of BRGS plan in pharmaceuticals and materials
The quality of finished pharmaceutical products frequently needs to be verified at the time of their importation or purchase. For example, before a pharmaceutical manufacturer releases a batch of new drugs to the public, it would like to test a sample from the batch to determine whether or not it is safe for public consumption. The choice of the sampling plan should always take into consideration the risks and consequences associated with the error. For instance, a well-designed drug manufacturing company is fully integrated to serve the drugs needed for government agencies of a country with quality and reliability.
Suppose the quality inspector has found the value of lot fraction nonconforming is 0.06 p= . Now, we obtained the consumer risk of RGS plan under ZIP distribution for different values of 0.01, 0.05, 0.09 ω = are 16.41%, 13.27%, 11.00% respectively. Similarly, the RGS plan under G-ZIP distribution will provide the consumer risks as 14.05%, 12.43%, 10.64%. It can be observed from Table 3. Thus, the proposed Bayesian RGS plan will give more protection to the consumer than the RGS plan under the ZIP distribution by reducing the risk of accepting lots of poor quality.
Similarly, the quality authorities has found the value of lot fraction nonconforming is 0.005 p = , the RGS plan under ZIP distribution has the producers risk, when 0.01, 0.05, 0.09 ω = are respectively 0.16%, 0.31%, and 0.21%. The RGS plan under the G-ZIP distribution has producer risks as 0.51%, 0.22%, and 0.02% at the same specified quality levels. Thus, when is moderately large, the RGS under G-ZIP distribution provides more protection to the producer by reducing the risk of rejecting lots of good quality than the RGS plan under ZIP distribution. are respectively 14.56%, 12.66%, 10.66%. Therefore, the application of the proposed BRGS plan will reduce the total risks of producer and consumer simultaneously.

The comparative analysis
The Operating Characteristic curve describes clearly the performance of the sampling plan against good and bad quality. Hence, we describe some interesting trends of the plan parameters under the G-ZIP model over other sampling plans. Suppose the quality control inspector fixed the parameters 1 From the comparison, it is noted that for all lower values of proportion defective (p), the probability of acceptance is high. Therefore, the proposed plan provides more protection to the consumer than the compared sampling plans by reducing the risk of accepting lots of poor quality. Further, we can note that for all high values of proportion defective (p), the probability of acceptance is low, which concludes that this plan provides more protection to the producer by reducing the risk of rejecting lots of good quality. The given figure clearly shows that the proposed sampling plan gives better precision and production to consumers as well as producers for our considered combinations (see Table 3) and it is performed better than the RGS plan under ZIP distribution and Bayesian RGS plan under Gamma Poisson distribution.

Conclusion
In this article, we have investigated the application of Bayesian Repetitive Group Sampling plan under the conditions of Gamma-Zero Inflated Poisson distribution in pharmaceuticals products and related materials. The proposed sampling plan is useful when the production processes are well monitored and produce a significant number of non-defectives in the process. Further, this sampling plan is considered the past history of the production process, which is useful, and can be taking much attention to a certain amount of inherent or natural variability in the process. This article also provides a detailed procedure for designing and selecting the plan parameters through the unity value approach. From the illustrations, it can be observed that the optimum proposed RGS plan may require more items to be sampled from a lot submitted for inspection. However, it reduces the risk of producers regarding the rejection of good quality lots and safeguards the consumer against poor quality lots with an assigned risk. Therefore, the proposed sampling plan has better performance measures than some existing sampling plans. This sampling plan can be applied in various disciplines including Government pharmaceuticals agencies, drug regulatory authorities, quality control laboratories and customs, medical research centers and food industries, etc. It is strongly suggested that the proposed plan can be utilized in industries for lot sentencing and product quality determination. A further study can be extended to other types of sampling plans available in the literature.