# A Bayesian Control Chart for Monitoring Process Variance
## 4 The Construction of the EWMA Variance Chart with the Bayesian Approach
### Construction of the EWMA Variance Control Chart  
Assuming that the in-control process variance is known to be \(\sigma_{0}{}^{2}\) and the prior distribution of \(p\) is also known to be \(Beta(\alpha_{0},\ \beta_{0})\), we can further construct a Bayesian EWMA variance chart with the following control limits:  
\[CL_{EWMA}=\frac{n\alpha_{0}}{\alpha_{0}+\beta_{0}}\, \tag{30}\]  
\[UCL_{EWMA}=\frac{n\alpha_{0}}{\alpha_{0}+\beta_{0}}+k_{1}\sqrt{\frac{n\alpha _{0}\beta_{0}(\alpha_{0}+\beta_{0}+n)}{(\alpha_{0}+\beta_{0})^{2}(\alpha_{0}+ \beta_{0}+1)}\times\frac{\lambda}{2-\lambda}}, \tag{31}\]  
\[LCL_{EWMA}=\frac{n\alpha_{0}}{\alpha_{0}+\beta_{0}}-k_{2}\sqrt{\frac{n\alpha _{0}\beta_{0}(\alpha_{0}+\beta_{0}+n)}{(\alpha_{0}+\beta_{0})^{2}(\alpha_{0}+ \beta_{0}+1)}\times\frac{\lambda}{2-\lambda}}, \tag{32}\]  
where (\(k_{1},\ k_{2}\)) are coefficients of the control limits. The adjustment allowing unequal coefficients of the control limits conforms to the asymmetry of beta-binomial distribution. Next, we will discuss how to choose suitable coefficients (\(k_{1},\ k_{2}\)) to satisfy a required in-control average run length.  
The ARLs are again used to measure the performance of the proposed Bayesian EWMA variance chart. We evaluate the ARLs of the proposed Bayesian EWMA variance chart by a Monte Carlo simulation approach. In order to ensure that the in-control ARLs are at least 370.4, the coefficients of the control limits (\(k_{1},\ k_{2}\)) are chosen with a procedure as follows.  
1. Given \(\alpha_{0},\ \beta_{0},\ n\), and \(\lambda\), then \(UCL_{EWMA}\) and \(LCL_{EWMA}\) can be expressed as the function of \(k_{1}\) and \(k_{2}\) by Equations (31) and (32), respectively;
2. Let \(EWMA_{0}\) be equal to the mean of \(EWMA\), i.e., \(n\alpha_{0}/(\alpha_{0}+\beta_{0})\);
3. Simulate random numbers \(M_{t}\) from \(Beta\)-\(Binomial(n\),\(\alpha_{0}\),\(\beta_{0})\) and compute \(EWMA_{t}\) by Equation (25) until \(EWMA_{t}>UCL_{EWMA}\), then record the run length;
4. Repeat step 3 1000 times and obtain the average run length, \(\text{ARL}(k_{1})\);
5. Determine the least \(k_{1}\) to make sure the \(\text{ARL}(k_{1})\) is larger than 740.8;
6. Given \(k_{1}\), simulate random numbers \(M_{t}\) from \(Beta\)-\(Binomial(n\),\(\alpha_{0}\),\(\beta_{0})\) and compute \(EWMA_{t}\) using Equation (25) until \(EWMA_{t}>UCL_{EWMA}\) or \(EWMA_{t}<LCL_{EWMA}\), then record the run length;
7. Repeat step 6 1000 times and obtain the average run length, \(\text{ARL}(k_{2})\);
8. Determine the least \(k_{2}\) to make sure the \(\text{ARL}(k_{2})\) is larger than 370.4.  
Table 3 shows the coefficients of the control limits (\(k_{1},\ k_{2}\)) of the proposed Bayesian EWMA variance chart with \(\lambda=0.05\), where the \(ARL_{0}\)s are slightly beyond 370.4, for various different \(n\), \(\alpha_{0}\), and \(\beta_{0}\).  
The results in Table 3 show that \(k_{1}\) and \(k_{2}\) are close, while \(E_{0}(p)=0.5\); however, \(k_{1}\) changes inversely with \(E_{0}(p)\) and \(k_{2}\) changes positively with \(E_{0}(p)\). The in-control area gets bigger due to the increasing skewness of the beta-binomial distribution.