Statistical Project of X Control Chart with Variable Sample Size and Interval

Control charts with adaptive schemes are tools used to monitor processes and to signal the presence of special causes. However, the use of adaptive schemes is not common yet because they are topics rarely covered in textbooks and are not available in traditional software used for statistical analysis. This work aims to present how to plan and estimate the optimal parameters of an adaptive chart for monitoring the mean of a process using sample size and variable interval ((X_bar-VSSI). The X_bar-VSSI chart was chosen because it is a scheme with great potential for practical application, for the chart only requires knowledge of the sample size and the time between sample selections after established the optimal parameters for the chart. Markov chains were used to evaluate the chart performance based on the average time between the instant when the process changes and the moment when the chart signals the condition out of control. It is presented two functions written in R language to assist the user in planning a statistical project based on the X_bar-VSSI adaptive scheme.


Introduction
Control charts are used to monitor the production process in order to signal deviations from the target value of a quality characteristic that one wants to monitor. Detection of small or moderate deviations by traditional charts proposed by Shewhart [1] is slow, that is why several charts have been proposed. Some authors introduced the adaptive control charts which are called this way because they do not present all their fixed parameters. Construction of this kind of chart provides that at least one of its parameters may vary and it can be: the control limits, the sample size and the time interval in which a sample is collected. For instance, consider the chart of adaptive control in which vary the sample size and the time interval in which a sample is collected. In this scheme, according to information obtained by the most recent sample, one can modify the size and collect interval of next sample.
Designing a control chart to use in practice, involves elaboration of a sampling plan by means of specification of sample size and time interval between removal of samples, and calculation of control limits. The mechanism which involves determination of limits distance of chart control at centerline is closely related to statistical testing of hypothesis. Extending the control limits decreases the risk of monitored statistics to be located beyond the control limits, with the adjusted process (error type I). However, extending the boundaries increases the risk of monitored statistic being located within the control limits when the process is out of adjustment, known as error type II [2]. In adaptive control charts, it is common to use Markov chains to evaluate the performance of chart according to the set of chosen parameters [3,4,5]. In order to assess the statistical properties, it is used the subjacent idea of dividing the variation interval of monitored statistic on a finite set of status. The transient statuses of the chain are located in the control region of chart and the absorbing status in the region established as out of control.
The adaptive charts are not available in traditional statistical softwares, despite showing better performance than the charts with fixed parameters. Determination of adaptive parameters is not a trivial task, therefore, this paper proposes the use of a free software to plan and estimate the optimal parameters of an adaptive chart for X with variable sample size and interval ( X VSSI − ). The average number of samples until the moment in which the chart indicates the out of control condition (ARL) and the average time between the instant at which the process is changed and the time when the chart indicates the out of control condition (ATS) are performance measures used as reference to parameters choice.
The X VSSI − chart was chosen because it is a scheme with great potential for practical application, for the chart requires only knowledge of sample size and the time among samples selection after established the optimal parameters.

X
The statistical properties of control chart are optimized considering the approach presented by Zimmer [4], ie, a Markov chain is used to establish the parameters keeping statistical risks type I and type II under control. The rest of the paper is organized as follows: section 2 presents the c control chart. In section 3, it is described the procedure to evaluate the performance of a X VSSI − chart using Markov chains.

Control Chart
Reynolds [6] was the first to consider the adaptive design of control chart by varying the time interval in which a sample is collected. Then there appeared a large number of papers for the purpose of varying the other control chart parameters, being proven that this technique generally increases the chart power in detection of special causes just modifying the quality characteristic average (variable) that is desired to monitor [7][8][9][10]. The X VSSI − control chart is adaptive with respect to the sample size and time interval at which a sample is collected. This chart was used by Prabhu [11,12], Costa [3] and Park [9] to monitor a process statistics.
In a control chart with sample size and interval variables (see Figure 1), the sample size and the time interval in which a sample is collected can vary according to the information provided by the most recent sample collected. In this chart type, random samples of different sizes are collected at variable intervals of length according to the function: where i = 1,2, ..., is the sample number; ( ) n i is the size of the i th sample ( ) Where i x is the sample mean of the i th subgroup; 0 µ and 0 σ are the mean and standard deviation of the process when in control.
The choice between the pairs ( ) For a chart X VSSI − , one can divide the control region in three mutually exclusive and exhaustive regions, as follows (see Figure 1): • Region within the alarm limits: .
• Region between the limits for alarm and control: .
• Region outside the control limits: .
If the statistic falls within the region , the control (or inspection) is relaxed using the pair , otherwise if the current point lies within the region , the control will be tighter by using the pair .

Control Chart
The statistical performance of a control chart can be evaluated by calculating the ARL and ATS statistics. Depending on the process operation conditions, one has the ARL when the process is in control (ARL 0 ), that is, the expected number of samples between two successive false alarms and the ARL for process out of control (ARL δ ), which represents the expected number of samples between the occurrence of special cause which alters the monitored parameter and signal triggered by the chart. Similarly, one has the ATS when the process is in control (ATS 0 ), representing the average time between two successive false alarms and ATS for process out of control (ATS δ ), representing the expected time between the occurrence of special cause and the signal triggered by the chart.
It is possible to calculate the ARL and ATS statistics using Markov chains. One observes the expected number of transitions before the monitored statistic lies in the absorbing state of the chain. The Markov chain proposed in Zimmer [4] was used in this study to assess the ARL in control and out of control, ARL 0 and ARL δ , respectively. Each transition probability is calculated as the probability of the statistic falls within one of the regions of the control range ( 1 In this chain, there are two transient states and one absorbing state that corresponds to the process out of control. The state transition matrix of chain that represents the operation of process in control, 0 P , can be divided into four sub-matrices: where { } T b is a vector with initial probabilities; I is the identity matrix; { } 1 is a unit vector and 0 Q is a transition matrix obtained by: . Φ denotes the standard normal cumulative function; K and w are the limits that define the region of the chart control.
The average time that the chart can produce a false alarm is: where {h} is a vector with the sampling intervals. The transition matrix of the process running out of control is given by: In order to calculate the performance measures ARL δ and ATS δ it is used: being the transition matrix given by: 11 12 21 22 where: The vector with initial probabilities { } T b is defined according to the initial conditions of operation in the process:

X
In this paper, it is considered the condition known as Steady-State, ie, it is assumed that the process starts in control and at some future instant, it occurs a special issue that causes a shift at the target value of monitored statistic.
Planning a control chart can be formalized as an optimization problem in which the decision variables are the parameters of the chart. Figure 2  In order to illustrate that the optimization problem is reduced to find the pair (n 1 ,n 2 ) that minimizes the objective function, consider without generality loss that A pair of samples ( 1 n , 2 n ) is selected; since ( 1 n , 2 n ), 0 n and k are known, w can be inferred directly from the expression (12). The shortest range of optimal sampling ( 1 h ) is given by: given that 0 1 h = hour, it is assumed that it is possible to inspect 60 parts every hour. For more details, see Celano [13,14].
Once defined h 0 , h 1 , w and k, h 2 is obtained by means of the expected time to collect a sample: The optimization problem is finally reduced to finding the pair ( 1 n , 2 n ) which minimizes the objective function. The next section presents an application example of how to plan an optimal statistical project that shows which values for the pair ( 1 n , 2 n ) should be used. For this, it has been used the R software [15] to obtain the optimal parameters of a X VSSI − chart.

Example
In this section, it is proposed two functions (see Appendix) developed for use in R environment that evaluate the performance of the X VSSI − control chart and solve the optimization problem shown in Figure 2. The R is a free software that allows the user to add functionality, making it flexible to generate statistical analyzes and receive contributions of many researchers through specific packages which are freely available in a central repository called CRAN (Comprehensive R Archive Network). The R can be obtained directly on the Internet at: http://www.r-project.org.
The first function, called VSSI, evaluates the performance of the control chart calculating the ATS δ when supplied by the user: n 1 , n 2, n 0, delta ( δ ), h0 andr_insp.
The second function, VSSI.optimum, solves the optimization problem shown in Figure 2. Here it is necessary to provide: n 0, delta ( δ ), h0,r_insp and a value for nmax which is referred to the largest size of admissible sample to collect.
In order to illustrate the use of functions, consider the example presented in Costa [16]. A packaging line has an average value of milk 1000 ml and standard deviation estimated to be 4.32 ml. Monitoring is performed in the process average by inspecting samples of size n 0 = 5 at each time unit. Suppose that this unit is equal to h 0 =1 hour. In this example, the parameters planned for the control chart are fixed, ie, the sample size, the sampling interval and limits do not change after estimated. To use the X VSSI − control chart in the example shown it is necessary to calculate the control limits (w and k) and the sampling scheme ( ) Consider the case in which 2.0 δ = . Figure 4 illustrates the results obtained with the VSSI function. It is observed that the ATS is lower (ATS δ=2 <ATS δ=1 ), because, when major shifts in the process mean occur, the performance of the chart is better.
However, anoptimal scheme to monitor this process is what performs best, ie the lowest ATS δ . By means of the VSSI.optimum function, one can obtain the parameters that minimize the ATS δ . Figure 5 shows the best schemes for the cases shown in Figures 3 and 4.
In this case, the user who wants to control the average value of a process considering the possibility of a displacement presented here, just build the X VSSI − control chart with the parameters shown in Figure 5.
Additional X VSSI − charts can be constructed easily by modifying the input values of VSSI and VSSI.optimum functions.

Conclusions
It was presented in this paper the way how one evaluates the effectiveness of the control chart of by means of Markov chains and mainly how to obtain the parameters that minimize the ATS. For this, two functions written in the language for R environmental were created with the purpose of solving the optimization problem that involves minimizing the ATS and presentation of the best parameters to be used in creation and use of the control chart. Adaptive schemes are more efficient than the known schemes of control charts with fixed parameters. However, the use of adaptive schemes for control charts is not common in practice, since the traditional statistical software present no routines for these types of charts. Thus, with the programs presented here, the user has a tool in which it is able to plan the use of control chart to monitor the average value of a desired quality characteristic.
It is suggested that future works present, with the support of the R software, how to plan statistical projects for control charts with adaptive schemes for other statistics such as standard deviation and sampling amplitude.