Empirical Bayes Prediction in a Sequential Sampling Plan Based on Loss Functions

The application of empirical Bayes for lot inspection in sequential sampling plans is usually conducted to estimate the proportion of defective items in the lot rather than for hypothesis testing of the variables’ process mean. In this paper, we propose the use of empirical Bayes in a sequential sampling plan variables’ process mean testing under a squared error loss function and precautionary loss function, for which the prediction is performed to estimate a sequence of the mean when the data are normally distributed in the case of a known mean and unknown variance. The proposed plans are compared with the sequential sampling plan. The proposed techniques yielded smaller average sample number (ASN) and provided higher probability of acceptance (Pa) than the sequential sampling plan.


Introduction
Acceptance sampling plans have been widely used in the industry for product quality inspection, with the advantages of destructive testing, large-lot auditing, and ability to choose good history-based suppliers. This method could reduce damage by requiring less product handling, error reduction, and less cost and time restraints in the manufacturing process. Acceptance sampling plans by variables can be classified into two types as follows: Estimation of the percentage of defective units out of the specification limits and statistical hypothesis testing to control the parameters of the process that are measured on a continuous scale, thus providing more information regarding the production in the lots than attributes with a small sample size. The variable sampling plan is utilized as part of quality assurance concerning the average quality of products, such as bulk materials in bags and drums [1], which are one of the variable sampling plan that aims to identify a process mean of the statistical hypothesis testing. Balamurali et al. [2] considered the repetitive group in the variables sampling plan in comparison with single, double, and sequential plans. Sankle and Singh [3] studied the single sampling plan by variables when the data were correlated with a known variance.
The Bayesian approach, as an alternative to the classical approach, is widely used in statistical inferences. Its principle is to incorporate information in the parameters' history through a prior distribution, assuming a known form of distribution. The parameters of a prior distribution, called hyperparameters, are usually assumed to be known or can be estimated regardless of the observed data. In contrast, when the hyperparameters are unknown and estimated from the observed data, it is called the empirical Bayes (EB) approach [4]. Studies involving EB have been performed by many authors, including Krutchkoff [5], Casella [6], Lu [7], Cui and George [8], Khaledi and Rivaz [9], and Maswadah [10].
The EB approach of estimation parameters can be obtained by using several loss functions, such as the square error loss (SEL) function and precautionary loss (PL) function. The loss functions are considered a loss in the stages of the quality procedure, which reduces the deviation from the true value and increases the target value [11]. They are applied in production quality assurance and the decision-making processes of producers and statisticians. Moskowitz and Tang [12] considered the Bayesian method of estimation parameters using the quadratic loss function and step-loss function applied in a variable acceptance sampling plan in cases of known and unknown variance. Jaheen [13] illustrated EB prediction of the estimation parameter using the linex and quadratic loss function. Naji and Rasheed [14] provided Bayesian estimation based on the PL function, where the parameters were the shape and scale of the Gamma distribution. Research on Bayesian and EB estimation loss functions includes Rahman et al. [15], Zaka and Akhter [16], and Lavanya and Alexander [17].
In addition, EB can be used to estimate newly observed data for predictive purposes, based on the posterior predictive distribution. Gimlin and Breipohl [18] studied the Bayesian approach in a sequential and non-sequential sampling plan of a binomial-distributed random variable with a beta prior distribution and aimed to identify a decision rule with the minimum average risk, using dynamic programming equations. Lam et al. [19] investigated the Bayesian approach in a sequential sampling plan by variables with data normally distributed under an unknown mean and known variance. The Markov technique was used to minimize the expected cost of the optimal sequential sampling plan. Liang et al. [20] studied the efficiency of the Bayesian approach in a sampling plan for lifetime testing under random censoring variables with the exponential distribution using the quadratic loss function in Bayes risk; the proposed plan minimized the total duration of the lifetime. Dunsmore and Wright [21] studied Bayesian prediction in a sequential sampling plan to test the lifetime of items that were taken by a group of items. The random variable followed an exponential distribution with a gamma prior distribution. For the sequential testing at stage k, if a lot was accepted at stage k, with k survivor items, then the predictive distribution was utilized to estimate the average lifetime of the k surviving items.
The EB method was also applied to estimate the percentage of defective units when the lots were accepted [22]. Shin and Shin [23] applied EB for the inspection of a repeated sampling plan by variables and using the data history to estimate the EB estimator, which was based on an estimation of the percentage of defective units. Karunamuni [24] studied EB in a sequential component problem based on an exponential family distribution. The minimum EB risk was used to determine the stopping time in the sequential decision. Delgadillo and Bremer [25] utilized the EB approach, combined with a specified cost function, to test the destruction of high-quality products in a Poisson process. The proposed method was compared with traditional methods, including single, double, multiple, and skip-lot sampling plans.
It can be seen that the sequential sampling plan often provides a smaller average sample number than single, double, or multiple plans. Thus, the sequential sampling plan can be considered as part of destructive testing for high-quality production. In this paper, we propose the use of the EB approach using SEL and PL functions for lot inspection in sequential sampling plans to test variables' sampling plan process mean. The EB method under the SEL function is easy to calculate, which is the mean of the posterior distribution function and the PL function, and can be applied for reliability and risk analysis. The prediction is then performed to estimate a sequence of the mean under a six-sigma-level quality. The proposed plan is then compared with the traditional approach, the sequential sampling plan by variables. The outline of this paper is as follows. In Section 2, the variable sampling for the process mean testing is described. Next, in Section 3, the traditional plan, sequential sampling plan by variables, is shown. In Section 4, the prediction based on the EB approach under SEL and PL functions is explained. Sections 5 and 6 cover the results of the simulation and application example. The final section presents the conclusion.

Variables Sampling for Process Mean Testing
The variable sampling plan is one of the acceptance sampling plans that is applied in quality assurance of lots. Quality characteristics are measured by a continuous scale [1]. In this paper, the variable process mean is utilized for the statistical hypothesis under a six-sigma quality level, then the process mean has 3.4 defective units per million opportunities (p) and it is assumed to shift to ±1.5σ. The proportion of defective units in the process is defined by: where USL is an upper specification limit and e − z 2 2 dz. Thus, the variable process mean hypothesis testing under USL is given by H 0 : µ 2 ≤ µ 1 vs. H 1 : µ 2 > µ 1 , where the parameter µ 1 is the acceptable process level (APL) and µ 2 is the rejectable process level (RPL). When data are assumed to have a normal distribution: X ∼ N(µ, σ 2 ), where σ is known, the parameters µ 1 and µ 2 can be estimated by: and: where ACL = µ 1 + Z α σ x are acceptance control limits, Z ∼ N(0, 1), x is the sample mean, σ x is the standard deviation of the data, σ x is the standard deviation of the sample mean, the producer's risk (α) is the probability of rejection at µ 1 , and the consumer's risk (β) is the probability of acceptance at µ 2 [26].

Sequential Sampling Plan by Variables
The sequential sampling plan can be categorized by attributes and variables. The sequential sampling plan is modified from the double sampling plan (DSP) and multiple sampling plan (MSP). The samples in this method are taken sequentially, one by one, from the process or lot, called item-by-item sequential sampling. When more than one sample is taken, it is then called group sequential sampling. In addition, the sequential sampling plan by attributes is a one-tailed test because it focuses on an increase of the proportion of the defective when compared with the acceptable quality level (AQL). In contrast, the sequential sampling plan by variables (SSP by variables) can be considered as a one-tailed and two-tailed test: Lower or upper specification limit testing (LSL/USL) and double testing, respectively [1]. Furthermore, when USL is specified, the acceptance limit line (Y 1 ) and rejection limit line (Y 2 ) for accepting the lot, continuing sampling, and rejecting the lot are: is the intercept of the rejection line, s = (µ 2 + µ 1 )/2 is the slope of the lines, L is the common logs, and A = log[(1 − β)/α], B = log[(1 − α)/β], and known σ Generally, the probability of acceptance (P a ) is constructed by: where w = (µ 2 + µ 1 − 2µ)/(µ 2 − µ 1 ). The average sample number (ASN) [27] is expressed as: Processes 2019, 7, 944 4 of 12

Empirical Bayes Prediction Approach
The Bayesian approach is widely applied in statistical inference, where the unknown parameters, δ, are considered as a random variable, depending on information in the history of the parameters, called the prior probability density function, and assuming a known prior distribution, π(δ|ω), and known hyperparameter, ω. Thus, inference concerning δ is performed using the Bayes' theorem, which can be expressed up to proportionality as the product of the likelihood function, L(δ), and the prior distribution, π(δ|ω). The posterior distribution, h(δ x), is obtained as following: where M(x ω) denotes the marginal distribution of x.
The EB is involved, when the unknown hyperparameter (ω) is estimated from the observed data, which do not conform to the Bayesian concept. The hyperparameter can be calculated from the marginal distribution of x, given by: In this case, the observed data, x, are a continuous random sample. The predictive distribution function is then developed to estimate the newly observed data or a future observation (x n+1 ), based on the previous observed data, x 1 , x 2 , x 3 , ..., x n or x, which can be derived from: Suppose that f (x n+1 δ) is a function of the new observed data.
In this paper, we propose the use of EB in the sequential sampling plan (EB in SSP) in the case of a known mean, µ 0 , and unknown variance, σ 2 . The parameter estimators are determined by SEL and PL functions.
Assuming X ∼ N(µ 0 , σ 2 ), informative prior on σ 2 : σ 2 ∼ IG(a, b), where σ 2 is the parameter and the hyperparameters are a and b that can be estimated from the marginal likelihood distribution as follows.

Determine the Marginal Likelihood Distribution Function
The hyperparameters a and b are obtained by the marginal likelihood distribution as follows: Then: Next, if L(a, b x) = M(x a, b) is not a closed form, the hyperparameters, a and b, can be obtained using a numerical method that is utilized by the Newton Raphson method [28]. Then, the estimators,â andb, will be substituted into the posterior distribution function.

Calculate the Posterior Distribution Function of σ 2
The posterior distribution function of σ 2 can be determined as follows: Thus, The posterior distribution function of σ 2 is an inverse gamma distribution, that is:

Obtain the EB Estimator of σ 2 with Respect to the SEL Function
The SEL function format is given by: where t is the estimation value of the parameters. Thus, the EB estimator of σ 2 is the mean of the posterior distribution [29], which can be determined by: Thus, the EB estimator of σ 2 under the SEL function iŝ

Determine the EB Estimator of σ 2 with Respect to the PL Function
The PL function format is provided by: The EB estimator of σ 2 for PL [29] is determined by: Then, the estimator under PL can be obtained [30] as follows: Processes 2019, 7, 944 6 of 12 From Equation (16), the estimator of σ 2 under PL is: After that, the estimators ofσ 2 SEL andσ 2 PL will be replaced into the posterior predictive distribution function.

Construct the Posterior Predictive Distribution Function of x n+1 x
The posterior predictive distribution function can be calculated as follows: Thus, .

Numerical and Results
In this study, we considered the variables process mean hypothesis USL testing under H 0 : µ 2 ≤ µ 1 vs. H 1 : µ 2 > µ 1 , where there is a comparison of two methods according to the SSP by variables and EB in SSP. In the case of EB in SSP, we considered the case of a known mean, µ, and unknown variance, σ 2 , assuming informative prior on σ 2 :σ 2 ∼ IG(a, b), where a and b denote hyperparameters. The parameter σ 2 is determined from SEL and PL functions. The hyperparameters, a and b, are obtained by Newton-Raphson. The data are generated from a standard normal distribution, the lot size is specified by N = 1000, the sample size is defined by n = 50, and the number of iterations is given by t = 1000. The proportion of defective units is determined by a six-sigma process level in which the proportion of defective units at APL is p = 0.00034, α = 0.05, and β = 0.10. The P a and the ASN are considered as the criteria for comparison. The result of the simulation with the two approaches is expressed in Table 1. In this paper, we considered the process mean USL testing with SSP by variables and EB in SSP using SEL and PL functions. When µ 1 and µ 2 were determined by referring to Equation (2) and then µ 1 = 1.50 and µ 2 = 1.92. In addition, Figure 1a-c show that when the process mean USL testing with SSP by variables and EB in SSP using SEL and PL functions, the limit lines for SSP by variables and EB in SSP approaches are included as follows: The acceptance limit line (Y 1 ) and rejection limit line (Y 2 ), where h 1 = 5.4387 and h 2 = 6.9826. It can be seen that the results of SSP by variable testing found that the cumulative of the sample mean are compared with Y 1 and Y 2 , then the cumulative of sample mean are less than Y 1 at the sample size n = 26. That is, to accept H 0 , and then the lot is accepted. Next, the EB in SSP for SEL and PL under USL testing are considered, where Y 1 , Y 2 , h 1 = 5.4387 and h 2 = 6.9826 are considered similar to the case of the SSP by variables. The hyperparameter estimators,â andb, are obtained from the Newton-Raphson numerical. The results of the EB in SSP for SEL and PL cases provide that the cumulative of the mean of the posterior predictive distribution (E(x n+1 x)) are comparable with Y 1 and Y 2 , indicating that the E(x n+1 x) is less than Y 1 , the result of which is to accept H 0 or the lot is accepted at the sample size n = 9 and n = 12. Thus, the proposed plans provide smaller sample sizes than SSP by variables.
In addition, the process mean USL testing with SSP by variables and EB in SSP using SEL and PL functions can be considered by P a and ASN. Table 1 shows that the P a and ASN of EB in SSP for SEL and PL are comparable with SSP by variables. The P a can be calculated by using Equation (4). The P a of the SSP by variables is the smallest, which is around 0.8849 to 0.9767, and it has a decreasing trend when the averages are large. However, the majority of the P a for EB in SSP for SEL and PL yield the highest P a that is stable close to 0.99. It is evident that P a of the proposed plans provides a higher and wider spread than the SSP by the variables, as can be seen in Figure 1d,e, respectively. Furthermore, the ASN for SSP by variables and EB in SSP can be calculated from Equation (5), for which the values of ASN for the SSP by variables are between 19 and 29 per lot. The majority of the ASN for the EB in SSP for SEL and PL are the smallest, from 4 to 25 per lot. Thus, it can be seen that the ASN values of the proposed plans are smaller and more spread than the SSP by variables. It can be seen in Figure 1f,g, respectively.

An Application Example
Real data considers liquid crystals' display with super twisted nematic (STN) technology for improvement of the LCD, which is considered the thickness of the liquid crystals' display [31]. APL(µ 1 ) is 0.70 mm, RPL(µ 2 ) is 0.77 mm, α= 0.05, and β= 0. 10 The sample mean of this data is 0.7088 and the standard deviation is 0.0172. The results show that the majority of the P a values of EB in SSP for SEL and PL provide higher values than SSP by variables, which is about 0.99, as can be seen in Figure 2a,b, respectively. In contrast, the ASN of the two proposed plans is mostly smaller than the SSP by variables, which are provided in Figure 2c,d. Therefore, it is clear that the result of EB in SSP for SEL and PL in the data provide similar simulation results.

An Application Example
Real data considers liquid crystals' display with super twisted nematic (STN) technology for improvement of the LCD, which is considered the thickness of the liquid crystals' display [31] The sample mean of this data is 0.7088 and the standard deviation is 0.0172. The results show that the majority of the Pa values of EB in SSP for SEL and PL provide higher values than SSP by variables, which is about 0.99, as can be seen in Figure 2a,b, respectively. In contrast, the ASN of the two proposed plans is mostly smaller than the SSP by variables, which are provided in Figure 2c,d. Therefore, it is clear that the result of EB in SSP for SEL and PL in the data provide similar simulation results.

Conclusions
In this paper, we considered the EB in SSP using SEL and PL functions for variables' process mean USL testing when data were assumed to be normally distributed under a situation of a known mean and unknown variance. The lot size was N = 1000, the sample size was n = 50, and the number of iterations was t = 1000. The proportion of defective units was determined by a six-sigma process level in which the proportion of defective units at APL was p = 0.00034, α = 0.05, and β = 0.10. The proposed plans were compared with the traditional SSP by variables. The result indicated

Conclusions
In this paper, we considered the EB in SSP using SEL and PL functions for variables' process mean USL testing when data were assumed to be normally distributed under a situation of a known mean and unknown variance. The lot size was N = 1000, the sample size was n = 50, and the number of iterations was t = 1000. The proportion of defective units was determined by a six-sigma process level in which the proportion of defective units at APL was p = 0.00034, α = 0.05, and β = 0.10. The proposed plans were compared with the traditional SSP by variables. The result indicated that the proposed methods provides a higher P a and smaller ASN than the traditional approach. The proposed methods also provided promising results in a real situation for variables' process mean testing and reduced the producer's risk, including cost savings in inspecting products in the lot. It is clear that the EB in SSP under SEL and PL functions use the data twice because of the prior distribution having less knowledge about the parameters. Thus, it is a good technique for solving this problem, which is to estimate the hyperparameters from observed data. It can be seen that the proposed plans are more sufficient than SSP by variables because they can reduce the sample size or ASN for inspection of the lot and provide high values of P a . In addition, we applied the proposed plan to real data of a liquid crystal display with super twisted nematic (STN) technology for improvement of the LCD, which yielded consistent results with those in the simulation. In future research, the EB in the SSP approach can be compared with other plans. The EB in the SSP approach can be performed using different types of priors and data.
Author Contributions: K.T. implemented code in R and simulations; K.J. wrote the paper; Y.A. provided the case study; S.S. contributed to concepts and revised the final document.