# A Bayesian Control Chart for Monitoring Process Variance
## 2 Preliminary Settings  
Assuming that a service process is of concern and a critical quality characteristic to be monitored, \(X\), has a mean \(\mu\) and variance \(\sigma^{2}\). In order to monitor the process variance, a random sample of size \(2n\), \(X_{1}\), \(X_{2}\),..., \(X_{2n}\) is taken from the service process. For convenience in the calculation of Equation (1), the sample size is even; if not, one observation is deleted. Thus, we define that:  
\[Y_{j}=\frac{\big{(}X_{2j}-X_{2j-1}\big{)}^{2}}{2},\,j=1,\,2,\,\ldots,\,n. \tag{1}\]  
It is easy to show that \(E(Y_{j})=\sigma^{2}\) for \(j=1,\,2,\,\ldots,\,n.\) When \(M\) is the total number of instances in which \(Y_{j}>\sigma^{2}\), then \(M\) follows from a binomial distribution with parameters \(n\) and \(p\), which is defined as:  
\[p=P\Big{(}Y_{j}>\sigma^{2}\Big{)} \tag{2}\]  
The value of \(p\) depends on the population of \(X\) and is always between 0.2 and 0.5 [23]. If the population of \(X\) is normal distribution, then \(p=0.3173\), which is independent of variance parameter \(\sigma^{2}\); if the population of \(X\) is exponential distribution, then \(p=e^{-\sqrt{2}}=0.2431\), which is also independent of rate parameter and hence \(\sigma^{2}\). When \(p\) is fixed and known, the binomial distribution can be used to determine the control limits in a process control scheme. However, \(p\) is usually unknown in practice because the process distribution may be non-normal and unknown, especially in service processes. Moreover, in some special situations, \(p\) may not be fixed even under in-control. The reason for this is that the value of \(p\) is not only associated with the shift of variance but also with the skewness of the distribution. Randomized skewness of the distribution will disturb or mislead the judgment about whether the process variance shifts. Thus, we will consider the random behavior of \(p\) from the Bayesian perspective. The Bayesian approach views parameter \(p\) as a random variable that describes the previous information about parameter \(p\) stated in a prior distribution from which we can obtain the posterior distribution or posterior predictive distribution. Because the beta distribution is the conjugate prior probability distribution for the binomial distributions, it is a suitable model for the random behavior of parameter \(p\). Assuming that the prior distribution of \(p\) is a beta distribution:  
\[p\,\sim Beta(\alpha,\,\beta),\]where the shape parameters \(\alpha\) and \(\beta\) are chosen to reflect any existing belief or information. The statistic \(M\) defined above follows a binomial distribution with parameters \(n\) and \(p\):  
\[M\sim Binomial(n,\ p) \tag{4}\]  
Therefore, the marginal distribution of \(M\) is the beta-binomial distribution with parameters \(n\), \(\alpha\), and \(\beta\):  
\[M\sim Beta-Binomial(n,\ \alpha,\ \beta). \tag{5}\]  
Given the prior distribution of \(p\), the probability function of \(M\) is then written as:  
\[f_{M|n,\ \alpha,\ \beta}(m)=\left( \begin{array}{c}n\\ m\end{array} \right)\frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)} \frac{\Gamma(m+\alpha)\Gamma(n-m+\beta)}{\Gamma(n+\alpha+\beta)},m=0,\ 1,\ \ldots,\ n, \tag{6}\]  
and the mean as well as variance are:  
\[E(M)=n\times\frac{\alpha}{\alpha+\beta} \tag{7}\]  
and  
\[Var(M)=\frac{n\alpha\beta(\alpha+\beta+n)}{(\alpha+\beta)^{2}(\alpha+\beta+1)}, \tag{8}\]  
respectively. Notice that the variability of the beta-binomial distribution is larger than that of the binomial distribution with \(p=\alpha/(\alpha+\beta)\), and the difference will get smaller as \((\alpha+\beta)\) increases or \(n\) decreases. Figure 1 depicts several probability functions of the beta-binomial distributions for comparison. Panel A of Figure 1 shows that, compared with the binomial distribution, the beta-binomial distributions are more dispersive. Panel B of Figure 1 shows that the skewness of the beta-binomial distributions increases as \(\alpha/(\alpha+\beta)\) decreases from 0.5.