Analytical Explicit Formulas of Average Run Length of Homogenously Weighted Moving Average Control Chart Based on a MAX Process

: Statistical process control (SPC) is used for monitoring and detecting anomalies in processes in the areas of manufacturing, environmental studies, economics, and healthcare, among others. Herein, we introduce an innovative SPC approach via mathematical modeling and report on its application via simulation studies to examine its suitability for monitoring processes involving correlated data running on advanced control charts. Speciﬁcally, an approach for detecting small to moderate shifts in the mean of a process running on a homogenously weighted moving average (HWMA) control chart, which is symmetric about the center line with upper and lower control limits, is of particular interest. A mathematical model for the average run length (ARL) of a moving average process with exogenous variables (MAX) focused only on the zero-state performance of the HWMA control chart is derived based on explicit formulas. The performance of our approach was investigated in terms of the ARL, the standard deviation of the run length (SDRL), and the median run length (MRL). Numerical examples are given to illustrate the efﬁcacy of the proposed method. A detailed comparative analysis of our method for processes on HWMA and cumulative sum (CUSUM) control charts was conducted for process mean shifts in many situations. For several values of the design parameters, the performances of these two control charts are also compared in terms of the expected ARL (EARL), expected SDRL (ESDRL), and expected MRL (EMRL). It was found that the performance of the HWMA control chart was superior to that of the CUSUM control chart for several process mean shift sizes. Finally, the applicability of our method on a HWMA control chart is provided based on a real-world economic process.


Introduction
One aspect of statistical process control (SPC), the control chart, is a graphical tool used in quality control and process management to monitor quality, reduce variability, continually improve operability, etc.It is used for operations in many fields, such as the natural sciences, engineering, finance, and medicine.The main objective of a control chart is to detect the occurrence of an out-of-control situation as quickly as possible.There are several types of control charts, each of which can be used to monitor and analyze different parts of a process.In general, the selection of a control chart depends on the type of process and the purpose of the process monitoring.For instance, the Shewhart control chart can track and display large variations in a process parameter over time, whereas the exponentially weighted moving average (EWMA) control chart [1], in which more weight is placed on recent data points, is responsive to small to medium changes in a process parameter.Page [2] proposed the cumulative sum (CUSUM) control chart that can also detect small to moderate shifts in a process parameter by cumulatively summing deviations from the target value over time.Abbas [3] proposed the homogeneously weighted moving average (HWMA) control chart in which specific weights are applied to the current and previous samples.After studying the performance of the HWMA control chart for non-normal processes, they determined that the parameters of the chart could be modified to make it more robust to non-normality.Additionally, recent research by Abbas [3] examined that the relative efficacy of the HWMA control chart was superior to that of the CUSUM and EWMA control charts.Recently, Knoth et al. [4] focused attention on several concerns regarding the HWMA control chart by stating, "In steady-state, the HWMA chart loses performance relative to the EWMA chart".In order to address these concerns, the performance of the HWMA control chart has been reinvestigated under steady and zero conditions at various shifts and smoothing parameters, Riaz et al. [5].It has been found that the HWMA control chart is superior to the EWMA control chart for several shift sizes under zero state.Consequently, the authors aimed to provide an explicit formula for the average run length of the HWMA control chart in order to compare how well the control charts identified process changes.We have assumed that a change in the process occurs at the very beginning, the so-called zero-state.
Usually, control charts such as EWMA, CUSUM, and HWMA control charts are designed with symmetric two-sided upper and lower control limits.However, some real applications might require a one-sided approach involving either the upper or the lower limit.Usually, control charts have been conceptualized to monitor and analyze processes involving independent and identically distributed (i.i.d) data.However, in some cases, processes can exhibit autocorrelation in which previous data points can influence the current data point.Autocorrelation can lead to non-random patterns in the data that may affect the effectiveness of traditional control charts.In such situations, specialized control charts or adjustments to deal with autocorrelation are needed.
The most popular model for autocorrelated processes is the autoregressive (AR) moving average (MA) model comprising AR and MA components, which has been shown to provide relatively high forecasting accuracy.Autocorrelated processes can be influenced by internal and external factors that can influence the time series being modeled.Thus, the MA and ARMA models with exogenous variables (MAX(q,r) and ARMAX, respectively) have been developed.This combination allows for a more comprehensive approach to time series forecasting by considering both the inherent dynamics of the time series and the impact of external factors.An explanatory variable is used to support better the accuracy of the forecast.For example, the autoregressive integrated moving average model with exogenous variables has been found to be a valuable tool for energy traders and other market participants seeking to enhance their decision-making capabilities in the intraday market, Lucic and Xydis [6].As a result, this study focuses on the MAX model due to its usefulness to real-world data.
The average run length (ARL) commonly used to measure the performance of a control chart comprises two components.ARL 0 is the expected number of observations when the process is in control before the control chart signals that it is out of control, and its value should be as large as possible.On the other hand, ARL 1 is the expected number of observations when the process is out of control before the control chart signals that it is out of control, and its value should be as small as possible.
Several approaches have been used to estimate the ARL, including the Markov Chain approach (MCA), Monte Carlo simulation, numerical integral equation (NIE), and explicit formulas.Each has its merits.MCA provides a structured framework to model the control chart's behavior and state transitions [7], while Monte Carlo simulation can handle complex interactions and variability [8].The NIE method provides a mathematical framework for analyzing the control chart properties [9] and obtaining analytical expressions for the ARL under certain conditions.
The explicit formula method provides direct analytical solutions for the ARL under specific assumptions.Several researchers have used this approach and checked the accuracy of their solutions.For instance, Chananet and Phanyaem [10] proposed a solution for the ARL using explicit formulas for detecting changes in the mean of a seasonal autoregressive model with exogenous variables running on a CUSUM control chart.Phanyaem [11] used explicit formulas to derive the ARL for detecting changes in the mean of an AR-integrated MA (ARIMA(p,d,q)) model running on an EWMA control chart.Supharakonsakun [12] used explicit formulas to derive the ARL for detecting changes in the mean of a seasonal MA of order q (SMA(q)) process running on a modified EWMA control chart.Recently, Petcharat [13] provided explicit formulas for the ARL for detecting changes in the mean of a stationary seasonal autocorrelated process with a trend running on a CUSUM control chart.Peerajit [14] solved explicit formulas for the ARL for monitoring changes in the mean of a long memory seasonal fractionally integrated MAX model running on a CUSUM control chart.Petcharat [15] studied the performance of a seasonal MA process with exogenous variables running on an EWMA control chart.Recently, Suriyakat and Petcharat [16] proposed explicit formulas and numerical integral equation (NIE) approaches for the ARL to detect changes in the mean of a stationary MA process with exogenous variables running on an EWMA control chart and compare their performances.
The aim of the present study is to derive explicit formulas for the ARL to detect changes in the mean of a MAX(q,r) model with exponential white noise running on an HWMA control chart, which, to the best of our knowledge, has not yet been reported.We also conducted a simulation study to compare the performance of our method to detect changes in the mean of a MAX(q,r) model with exponential white noise running on HWMA and CUSUM control charts.

Materials and Methods
The characteristics of the MAX(q,r) process and HWMA and CUSUM control charts are presented here.

Homogenously Weighted Moving Average (HWMA) Control Chart
The HWMA statistic is considered under the assumption {H t ; t = 1, 2, 3, . ..}, as a sequence of i.i.d continuous random variables with a common probability density function.The HWMA statistic (H t ) is an upper HWMA statistic based on the MAX(q,r) process H t .The recursive formula can express it as in (1) where Y t is a sequence of the MAX(q,r) process with exponential white noise, the starting value Y 0 = u is an initial value, and u ∈ [0, b] where b is a control limit of the HWMA chart.The control limits of the HWMA control chart consist of Uppercontrollimit: where L is the width of the control limits.
The HWMA stopping time (τ b ) with a predetermined threshold b is defined as

Cumulative Sum (CUSUM) Control Chart
Page [2] proposed the CUSUM control chart for quality control, which can be used to spot minor differences in process mean.The CUSUM statistics based on the MAX(q,r) process can be expressed using the algorithm in (2) as follows: where C t is a sequence of the MAX(q,r) process with exponential white noise where h is a control limit and a usually called the CUSUM control chart's reference value.
The CUSUM stopping time (τ h ) with a predetermined threshold h is defined

Characteristics of Average Run Length
Let, {ε t , t = 1, 2, 3, . ..} be a sequence of independent and identically distributed random variables with a probability density function f (x) with the parameter α = α 0 , which is before a change-point time θ ≤ ∞; the parameters α 1 > α 0 are after the changepoint time.Generally, the change-point times are considered.The expectation E θ (.) for fixed θ under probability density function f (x) with parameter α 1 is that the change-point occurs at a point θ.In statistical process control (SPC), it is generally desirable to have an appropriate control chart that provides a large Average Run Length (ARL) at the change point time for θ = ∞.A large ARL means that, under normal operating conditions (when the process is in control), the control chart will typically require a long sequence of data points before signaling a false alarm or indicating a shift in the process.This is the behavior of the in-control state of ARL, denoted by ARL 0, or the state of no change (α = α 0 ).The expectation of the run length τ b for the in-control state can be defined as Meanwhile, if θ = 1, in the case of the change-point time from α 0 to α 1 , then the ARL is evaluated as the out-of-control state of ARL, denoted by ARL 1, which can be defined as 3. Average Run Length for MAX(q,r) Process 3.1.The Explicit Formula Method Theorem 1.The explicit formula of G(u) the ARL of MAX(q,r) process with an exponential white noise For the in-control process (α = α 0 ), the ARL of the HWMA control chart can be expressed as follows: Meanwhile, the out-of-control process (α = α 1 ), as well as α 1 = (1 + δ)α 0 , the ARL of the HWMA control chart, can be expressed as follows: Proof of Theorem 1 is shown in Appendix A.

Numerical Integral Equation Method
After the explicit formula of the ARL is proved, we will use the NIE method to check the accuracy of the results.Numerical Integral Equations were first proposed by Crowder [17] to approximate ARL for Gaussian distributions.Afterward, Champ and Rigdon [18] thoroughly investigated them by comparing the run length distributions derived from the MCA and the Integral Equation approach for the case of a Gaussian distribution.Extensive investigations of the Integral Equation have been conducted by Srivastava and Wu [19] for continuous-time systems and by Srivastava and Wu [20] for discrete processes.The advantage of using the NIE method with quadrature rules is that it provides a computationally efficient and accurate way to estimate the ARL.The ARL estimated via the NIE method derived with quadrature rules denoted G(u) is a well-known technique as given in Appendix B that can verify the ARL via the explicit formula.Different quadrature rules can be employed to obtain similar ARL estimates, and the results obtained from these rules are generally very close [21].
The approximation of the numerical integral for the function G(u) is, ). (5)

Existence and Uniqueness of ARL
Banach's Fixed-point Theorem provides theoretical support for the ARL equation's validity, ensuring a unique solution to the integral equation for explicit formulas.Let T be an operation on the class of all continuous functions defined by According to Banach's Fixed-point Theorem, if an operator T is a contraction, the fixed-point equation T(G(u)) = G(u) has a unique solution.The theorem can be used as follows below to show that the equation in ( 6) exists and has a unique solution.

Theorem 2. Banach's Fixed-point Theorem
Let (X, d) be defined on a complete metric space and T : X → X satisfy the conditions of a contraction mapping with contraction constant 0 Proof of Theorem 2. Let T, defined in ( 6), be a contraction mapping for

Numerical Results
We conducted a simulation study to compare the efficacies of the explicit formulas (G(u)) and NIE ( G(u)) methods for the ARL of an MAX(q,r) process running on an HWMA control chart via the following steps.
Step 1: Setting up the control limit for the MAX(q,r) process: i Determine the exponential white noise (α 0 ) and smoothing parameters for the incontrol process.ii Determine the initial values for the MAX(q,r) process and the HWMA statistic.iii Select acceptable values for ARL 0 and the shift sizes (δ).iv Compute the upper control limit (b) that yields the desired ARL for the control process using (3).
Step 2: For the in-control ARL: i Compute ARL 0 using (3) when given the upper control limit (b) from Step 1. ii Approximate the value of ARL 0 via the NIE method by using (5).iii If necessary, change the value of b according to the desired ARL 0 value.
Step 3: For the out-of-control ARL: i Compute ARL 1 for various shift sizes and α 1 = (1 + δ)α 0 by using (4) and the value of b from Step 1. ii Approximate ARL 1 via the NIE method by using (5).iii Compare the ARL values obtained using the explicit formulas and NIE methods.
To compare these, the absolute relative change (ARC) is computed as follows: × 100 (7) Next, the efficiency of the HWMA control chart is compared with that of the CUSUM control chart.Several performance measures are commonly used to assess a control chart's ability to detect process variations.First, the relative mean index (RMI) [23] is a statistical metric used to assess which control chart more efficiently detects shifts or changes in the process mean.A lower RMI indicates a more efficient control chart.The RMI is calculated as follows: where ARL i (r) is the ARL value for each control chart for the determined shift size i, ARL i (s) and is the lowest ARL for i obtained by each of the control charts.
The standard deviation run length (SDRL) and median run length (MRL) are tools for assessing the performance of control charts in maintaining process stability and quickly detecting an out-of-control situation [24].For the in-control process, th7e SDRL and MRL are calculated as follows: where ς represents a type I error.In this study, ARL 0 was fixed at 370, and it can be calculated as SDRL 0 and MRL 0 by ( 9) at approximately 370 and 256, respectively.On the other hand, for out-of-control situations, SDRL 1 and MRL 1 are calculated by where ψ represents type II error.
The control chart's effectiveness in detecting various types of process variations can be evaluated by considering the values of SDRL 1 , MRL 1 , and ARL 1 , after which informed decisions about its performance can be made.Lower values of these measurements indicate better performance in terms of sensitivity and efficiency.Furthermore, the comparison of the performances of the HWMA and CUSUM control charts in terms of the expected ARL (EARL), expected SDRL (ESDRL), and expected MRL (EMRL) is calculated as follows: For the results, a simulation of the in-control process is given with ARL 0 = 370, and then the initial parameter value was studied α 0 = 1.The out-of-control process α 1 = (1 + δ)α 0 is computed by determining shift sizes (δ) to be 0.001, 0.003, 0.005, 0.01, 0.03, 0.05, 0.1, 0.3, and 0.5.The control limits for the HWMA control chart running a MAX(q,r) process when ARL 0 = 370 are provided in Table 1.For example, for a MAX(2,1) process with parameter values δ = 1, θ 1 = 0.1, θ 2 = 0.2, β 1 = 0.2, the control limit is 0.00179.In Tables 2 and 3, the ARL values obtained using the explicit formulas and NIE methods for the MAX(1,1) and MAX(2,3) models running on an HWMA control chart for λ = 0.1 or 0.2 are presented.It can be seen that the ARL values from both methods are similar.This was confirmed by the ARC values being very low.A comparison of the ARL 1 results for MAX(1,1) and MAX(2,3) processes running on HWMA and CUSUM control charts is provided in Tables 4 and 5.In this case, the parameter values were set as ARL 0 = 370, λ = 0.1, 0.2, or 0.3, and the reference value (a) = 4.The ARL values derived by using the explicit formulas were lower for the HWMA control chart than for the CUSUM control chart for all shift sizes and all values of λ.In addition, as λ. was increased, the ARL 1 values decreased accordingly.Moreover, the SDRL and MRL values were the same as the ARL values.Subsequently, the ARL values obtained from each control chart using the explicit formulas method in Tables 4-6 were used to calculate the EARL, ESDRL, and EMRL values.It was found that the proposed method for the HWMA control chart provided the best performed the best because it obtained the lowest EARL, ESDRL, and EMRL values.Therefore, it can be concluded that the HWMA control chart performs better than the CUSUM control chart for this scenario, where the results of the performance comparison are consistent with Abbas [3].

Practical Applications with Real Data
In this section, the ARL formula has been applied to real data with the following steps.

1.
To estimate parameters from interesting data such as stock price, which must include a MAX model.2.
To estimate the parameter of exponentially distributed residuals.
To compare the performance using the ARL value calculated from 3 and other control charts.5.
To detect changes in the process mean, determine the UCL value using the equation in (3) and use actual data to compute control chart statistics before plotting the control chart statistics on a graph.
In the application to a real problem, the S&P 500 index was gathered as the observations for the MAX(q,r) process, and the AAPL stock price was collected as the exogenous variable (X).
The explicit formulas for the ARL of a MAX(q,r) process on the HWMA control chart are applied and compared with the performance with the CUSUM control chart using 41 real-world data observations of the S&P 500.The exogenous variable is Apple Inc. (AAPL) stock price from April 2023 to May 2023.
Time series model MAX in the practical real data S&P 500 with exogenous AAPL stock price decomposes the actual series into fitted values and residuals.The parameters of the practical time series model MAX are estimated using the Kolmogorov-Smirnov test.Then, the exponential distribution of residuals behaving as white noise was subsequently determined.
The model has an improvement pattern with three MAX processes, i.e., MAX(1,1), MAX(2,1), and MAX (3,1), so these models should be included in the model estimation as shown in Table 7. Consequently, the MAX(3,1) has the lowest RMSE, MAPE, and MAE, implying that the MAX (3,1) is the best model, as shown in Table 8.Based on the final result of the coefficient parameter in Table 9, the MAX(3,1) coefficient parameters are obtained as follows: θ1 =−1.085, θ2 =−0.765, θ3 =−0.435, β = 24.40.The in-control parameter is equal to 29.42908, as shown in Table 9.The parameters of this prediction model can be assigned as follows: Ŷt = 1.085ε t−1 + 0.765ε t−2 + 0.435ε t−3 + 24.40X t .The ARL values for MAX(3,1) on the HWMA and CUSUM control charts were compared using the explicit formula method, the results of which are summarized in Table 6; it can be seen that the results are obviously in agreement with those in Tables 4 and 5.The table shows that the HWMA control chart has the lowest RMI, EARL, ESDRL, and EMRL of all λ levels, as shown in Figure 1.To sum up, the explicit formula approach is a good alternative for practical applications in detecting mean process changes on the HWMA control chart.In addition, the HWMA (H t ) and CUSUM (C t ) statistics for the S&P 500 with Apple Inc. (AAPL) stock price as an exogenous variable fitted to the MAX(3,1) model are presented in Figure 2.These results indicate that the HWMA control chart can detect a shift at the first time at the fifth observation, while the CUSUM scheme is found the first time at the sixth observation.That is to say, the first hitting time for the HWMA control chart for the S&P 500 dataset fitted to the MAX(3,1) process with exogenous (AAPL) stock price takes a smaller hitting time than for the CUSUM control chart.
Hence, the results show that the HWMA control chart for the S&P 500 dataset fitted to the MAX(3,1) process with exogenous (AAPL) stock price is more effective than the CUSUM control chart.Hence, the results show that the HWMA control chart for the S&P 500 dataset fitted to the MAX(3,1) process with exogenous (AAPL) stock price is more effective than the CUSUM control chart.

Discussion and Conclusions
The zero-stated ARL derivations based on the explicit formulas and NIE methods for an MAX process with exponential white noise running on an HWMA control chart with a symmetric one-sided control limit were derived and evaluated.The control charts, such as EWMA and DEWMA control charts, which have similar characteristics to the HWMA control chart, were reviewed in the literature.However, the HWMA control chart, a recent control chart between EWMA and DEWMA control charts, was selected to compare the results with the CUSUM control chart.The efficiencies of the proposed method for MAX processes running on HWMA and CUSUM control charts were compared considering the differences between their parameters (the smoothing parameter for the HWMA control chart and the reference value for the CUSUM control chart).Consequently, the fixed parameter values for the HWMA and CUSUM control charts were independently selected.We will consider optimal parameters for the HWMA and CUSUM control charts in future

Discussion and Conclusions
The zero-stated ARL derivations based on the explicit formulas and NIE methods for an MAX process with exponential white noise running on an HWMA control chart with a symmetric one-sided control limit were derived and evaluated.The control charts, such as EWMA and DEWMA control charts, which have similar characteristics to the HWMA control chart, were reviewed in the literature.However, the HWMA control chart, a recent control chart between EWMA and DEWMA control charts, was selected to compare the results with the CUSUM control chart.The efficiencies of the proposed method for MAX processes running on HWMA and CUSUM control charts were compared considering the differences between their parameters (the smoothing parameter for the HWMA control chart and the reference value for the CUSUM control chart).Consequently, the fixed parameter values for the HWMA and CUSUM control charts were independently selected.We will consider optimal parameters for the HWMA and CUSUM control charts in future research.Although only exponential white noise was considered in the present research, it is representative of real data with events occurring randomly with nonlinear noise.Thus, this supports the applicability of our approach to real situations, such as the S&P 500 index with the AAPL stock price as an exogenous variable.The ARL values obtained by using the explicit formulas and NIE methods were similar.Furthermore, the existence and uniqueness of the ARL derivation based on the explicit formulas were proved.The ARL, SDRL, and MRL values obtained using the proposed method for MAX processes running on HWMA and CUSUM control charts were used to compare their performances.While varying the value of λ, the ARL, SDRL, and MRL values for the HWMA control chart were less than those for the CUSUM control chart.When applying the proposed method to real data from the S&P 500 index with the AAPL stock price as an exogenous variable, the ARL values for the HWMA control chart were less than those for the CUSUM control chart.Furthermore, the first out-of-control value detected by the HWMA control chart was sooner than that detected by the CUSUM control chart.The advantage of this research is that it brings these concepts and results for making strategies to detect the change in stock price level based on control limits of the proposed control charts.The detected change in the movement of stock price can generate the buying and selling signals for the investor.
In summary, the results indicate that the HWMA control chart performed better than the CUSUM control chart for all magnitudes of changes.In addition, the results obtained for a real-world scenario involving S&P 500 stock price datasets were consistent with those obtained in the simulation study.Although the proposed explicit formula derivation for the ARL can be applied to other scenarios, it is limited to cases involving exponential white noise and to the MAX model only.If the examined data contains further white noise patterns, determining the ARL value could require the use of alternative techniques, such as the NIE or Markov Chain approach, etc.For future research, explicit formulations for the ARL will be developed for other models relevant to real-world situations.(e.g., ARX, ARMAX, and ARIMAX) running on a HWMA control chart.

Appendix B
In this study, we use the Gauss-Legendre rule to evaluate the ARL )dW.
The approximation for an integral is evaluated by the quadrature rule as follows; where a k is a point and w k is a weight that is determined by the different rules.
Using the quadrature formula, the system of n linear equations is as follows; ).
This system can be shown as where

Table 1 .
Control limits of HEWMA control chart with MAX processes.

Table 7 .
MAX estimate for S&P 500 with Apple Inc. (AAPL) stock price as exogenous variable.

Table 9 .
Exponential white noise of residual using the Kolmogorov-Smirnov goodness of fit test.