**3. The simulation procedure and some results**

In the present section, we describe the step-by-step procedure which has been followed in order to determine the basic performance characteristics of monitoring schemes mentioned previously. Two well-known runs-type rules are implemented in order to improve the performance of the control charts being considered. More precisely, if we denote by *LCL* and *UCL* the lower and the upper control limit of the underlying monitoring scheme, we apply the following runs rules

• The 2-of-2 rule. Under this scenario, an out-of-control signal is produced from the control chart, whenever two consecutive plotted points fall all of them

either on or above the *UCL* or all of them fall on or below the *LCL* (see, e.g., Klein [12]).

samples of size *n* = 5. In order to achieve a prespecified in-control performance level, namely, *FAR* equal to 1%, the remaining parameters are determined as *a* = 1, *j* = 2, *k* = 4, and *r* = 1. Under the aforementioned design, Triantafyllou [6] computed the exact *FAR* equal to 0.0096, while the simulation-based procedure proposed in

*Simulation-Based Comparative Analysis of Nonparametric Control Charts with Runs-Type Rules*

A different approach for appraising the ability of a monitoring scheme to detect a possible shift in the underlying distribution is based on its run length. We next focus on the waiting time random variable *N*, which corresponds to the amount of random test samples up to getting the first out-of-control signal from the monitoring scheme, in order to evaluate its performance. **Table 2** displays the exact and the simulation-based average run length for several designs of *Chart* 2 that meet a desired nominal level of in-control performance. The exact values of *ARL* needed for building up **Table 2**, have been picked up from Triantafyllou [6] and more

As it is readily observed, the simulation-based results seem to be quite close to the exact values in all cases considered. For example, let us assume that we draw a reference sample of size *m* = 400 and test samples of size *n* = 5. In order to achieve a

remaining parameters are determined as *a* = 5, *b* = 379, *j* = 2, *k* = 3, and *r* = 2. Under

**Reference sample 40 60** *n* **(***a***,** *j***,** *k***,** *r***)** *Exact FAR Simulated FAR* **(***a***,** *j***,** *k***,** *r***)** *Exact FAR Simulated FAR* 5 (1, 2, 3, 3) 0.0114 0.0119 (1, 2, 4, 1) 0.0096 0.0116 (3, 2, 3, 2) 0.0615 0.0632 (4, 3, 4, 2) 0.0478 0.0507 (4, 3, 4, 2) 0.0999 0.0897 (6, 3, 4, 2) 0.0969 0.1044 11 (2, 4, 8, 4) 0.0116 0.0158 (4, 4, 7, 5) 0.0108 0.0098 (1, 2, 4, 5) 0.0431 0.0551 (7, 4, 7, 4) 0.0518 0.0573 (1, 6, 10, 5) 0.0432 0.0437 (6, 3, 6, 5) 0.1030 0.1084 25 (4, 8, 12, 4) 0.0139 0.0150 (9, 10, 14, 5) 0.0097 0.0100 (5, 14, 17, 5) 0.0137 0.0126 (17, 12, 14, 5) 0.1031 0.1131 (10, 11, 14, 4) 0.0928 0.1049 (15, 11, 15, 4) 0.1037 0.1130 **Reference sample 100 200** *n* **(***a***,** *j***,** *k***,** *r***)** *Exact FAR Simulated FAR* **(***a***,** *j***,** *k***,** *r***)** *Exact FAR Simulated FAR* 5 (3, 3, 4, 3) 0.0119 0.0105 (7, 2, 3, 2) 0.0132 0.0159 (5, 2, 4, 3) 0.0505 0.0566 (10, 2, 4, 2) 0.0479 0.0473 (1, 1, 5, 3) 0.0934 0.1076 (21, 3, 4, 2) 0.1008 0.0937 11 (4, 3, 8, 5) 0.0146 0.0107 (8, 3, 6, 4) 0.0105 0.0103 (7, 3, 7, 6) 0.0460 0.0506 (16, 4, 6, 3) 0.0106 0.0097 (7, 3, 8, 5) 0.0524 0.0603 (26, 4, 6, 3) 0.0498 0.0492 25 (19, 11, 14, 4) 0.0113 0.0122 (39, 11, 14, 4) 0.0093 0.0090 (24, 11, 14, 4) 0.0490 0.0463 (45, 13, 16, 6) 0.0479 0.0445 (19, 14, 17, 5) 0.0504 0.0518 (45, 14, 17, 4) 0.0995 0.0992

prespecified in-control performance level, namely, *ARLin* equal to 370, the

the present chapter gives a corresponding *FAR* value equal to 0.0116.

specifically from **Table 2** therein.

*DOI: http://dx.doi.org/10.5772/intechopen.91040*

**Table 1.**

**201**

*Exact and simulation-based* FAR *for a given design of* Chart *2.*

• The 2-of-3 rule. Under this scenario, an out-of-control signal is produced from the control chart, whenever two out of three consecutive plotted points fall outside the control limits ð Þ *LCL*, *UCL* of the corresponding scheme.

We next illustrate the detailed procedure for determining the performance of *Chart* 2 enhanced with the 2-of-3 rule. It goes without saying that a similar algorithm has been constructed in order to study the corresponding characteristics of the remaining control schemes, namely, *Chart* 1 and *Chart* 3 enhanced with either the 2-of-2 or the 2-of-3 runs rule.

**Step 1.** Generate a reference sample of size *m* from the in-control distribution *F* and *k*<sup>2</sup> test samples of size *n* from the out-of-control distribution *G*.

**Step 2.** Determine the control limits of the monitoring scheme *Chart* 2, by selecting appropriately the parameters *a*, *b*,*r*.

**Step 3.** Calculate the test statistics *Yj*, *Yk*, *R* for each test sample, and examine whether *Chart* 2 produces an out-of-control signal or not, namely, whether at least one of the conditions mentioned in (2) is violated.

**Step 4.** Define a dummy variable *Ti*, *i* ¼ 1, 2, … , *k*<sup>2</sup> for each test sample separately. The variable *Ti* takes on the value 0 when all conditions in (2) are satisfied, while it takes on the value 1 otherwise.

**Step 5.** Determine all consecutive (uninterrupted) triplets consisting of *Ti* 0 *s* elements, namely, all triplets *Ti* ð Þ , *Ti*þ1, *Ti*þ<sup>2</sup> , *i* ¼ 1, … , *k*<sup>2</sup> � 2. Define the dummy variable *Dj*, *j* ¼ 1, 2, … , *k*<sup>2</sup> � 2 for each triplet separately. The variable *Dj* takes on the value 0 when the triplet consists of at least two 0s, while it takes on the value 1 otherwise.

**Step 6.** Calculate the alarm rate of the monitoring scheme as *AR* <sup>¼</sup> <sup>P</sup>*<sup>k</sup>*2�<sup>2</sup> *<sup>j</sup>*¼<sup>1</sup> *Dj<sup>=</sup>* ð Þ *k*<sup>2</sup> � 2 . When *F* = *G*, the aforementioned probability indicates the false alarm rate of the monitoring scheme, while in case of different distributions *F*, *G* the *AR* corresponds to its out-of-control alarm rate.

**Step 7.** Define a variable *RLh*, *h* ¼ 1, 2, … , *H* which counts the number of *Dj* 0 *s* elements, till the first appearance of a *Dj* equal to 1. The so-called average run length of the monitoring scheme is calculated as *ARL* <sup>¼</sup> <sup>P</sup>*<sup>H</sup> <sup>h</sup>*¼<sup>1</sup>*RLh=H*. When *<sup>F</sup>* <sup>=</sup> *G F*ð Þ 6¼ *<sup>G</sup>* , the aforementioned quantity indicates the in-control (out-of-control) average run length of the monitoring scheme.

All steps 1–7 are repeated *k*<sup>1</sup> times and the performance characteristics of the proposed *Chart* 2 enhanced with 2-of-3 runs rule, namely, the false alarm rate (*FAR*, hereafter), the out-of-control alarm rate (*ARout*, hereafter), the in-control average run length (*ARLin*, hereafter), and the out-of-control run length (*ARLout*, hereafter) are estimated as the mean values of the corresponding *k*<sup>1</sup> results produced by steps 6 and 7, respectively.

In order to ascertain the validity of the proposed simulation procedure described above, we shall first apply the algorithm without embodying any runs-type rule and compare the simulation-based outcomes to the corresponding results produced by the aid of the theoretical approximation appeared in Triantafyllou [6]. The simulation study has been accomplished based on the R software environment and involves 10.000 replications. **Table 1** displays several designs of the monitoring scheme mentioned as *Chart* 2 with a nominal level of in-control performance. Since we consider the same designs as those presented by Triantafyllou [6], the exact *FAR*s have been taken from his **Table 1**. As it is easily observed, the simulationbased results seem to be quite close to the exact values in all cases considered. For example, let us assume that we draw a reference sample of size *m* = 60 and test

*Simulation-Based Comparative Analysis of Nonparametric Control Charts with Runs-Type Rules DOI: http://dx.doi.org/10.5772/intechopen.91040*

samples of size *n* = 5. In order to achieve a prespecified in-control performance level, namely, *FAR* equal to 1%, the remaining parameters are determined as *a* = 1, *j* = 2, *k* = 4, and *r* = 1. Under the aforementioned design, Triantafyllou [6] computed the exact *FAR* equal to 0.0096, while the simulation-based procedure proposed in the present chapter gives a corresponding *FAR* value equal to 0.0116.

A different approach for appraising the ability of a monitoring scheme to detect a possible shift in the underlying distribution is based on its run length. We next focus on the waiting time random variable *N*, which corresponds to the amount of random test samples up to getting the first out-of-control signal from the monitoring scheme, in order to evaluate its performance. **Table 2** displays the exact and the simulation-based average run length for several designs of *Chart* 2 that meet a desired nominal level of in-control performance. The exact values of *ARL* needed for building up **Table 2**, have been picked up from Triantafyllou [6] and more specifically from **Table 2** therein.

As it is readily observed, the simulation-based results seem to be quite close to the exact values in all cases considered. For example, let us assume that we draw a reference sample of size *m* = 400 and test samples of size *n* = 5. In order to achieve a prespecified in-control performance level, namely, *ARLin* equal to 370, the remaining parameters are determined as *a* = 5, *b* = 379, *j* = 2, *k* = 3, and *r* = 2. Under


#### **Table 1.**

*Exact and simulation-based* FAR *for a given design of* Chart *2.*

either on or above the *UCL* or all of them fall on or below the *LCL* (see, e.g.,

• The 2-of-3 rule. Under this scenario, an out-of-control signal is produced from the control chart, whenever two out of three consecutive plotted points fall

We next illustrate the detailed procedure for determining the performance of *Chart* 2 enhanced with the 2-of-3 rule. It goes without saying that a similar algorithm has been constructed in order to study the corresponding characteristics of the remaining control schemes, namely, *Chart* 1 and *Chart* 3 enhanced with either

**Step 1.** Generate a reference sample of size *m* from the in-control distribution *F*

**Step 2.** Determine the control limits of the monitoring scheme *Chart* 2, by

**Step 3.** Calculate the test statistics *Yj*, *Yk*, *R* for each test sample, and examine whether *Chart* 2 produces an out-of-control signal or not, namely, whether at least

**Step 4.** Define a dummy variable *Ti*, *i* ¼ 1, 2, … , *k*<sup>2</sup> for each test sample separately. The variable *Ti* takes on the value 0 when all conditions in (2) are satisfied,

ments, namely, all triplets *Ti* ð Þ , *Ti*þ1, *Ti*þ<sup>2</sup> , *i* ¼ 1, … , *k*<sup>2</sup> � 2. Define the dummy variable *Dj*, *j* ¼ 1, 2, … , *k*<sup>2</sup> � 2 for each triplet separately. The variable *Dj* takes on the value 0 when the triplet consists of at least two 0s, while it takes on the value 1 otherwise. **Step 6.** Calculate the alarm rate of the monitoring scheme as *AR* <sup>¼</sup> <sup>P</sup>*<sup>k</sup>*2�<sup>2</sup>

ð Þ *k*<sup>2</sup> � 2 . When *F* = *G*, the aforementioned probability indicates the false alarm rate of the monitoring scheme, while in case of different distributions *F*, *G* the *AR*

**Step 7.** Define a variable *RLh*, *h* ¼ 1, 2, … , *H* which counts the number of *Dj*

elements, till the first appearance of a *Dj* equal to 1. The so-called average run length

the aforementioned quantity indicates the in-control (out-of-control) average run

All steps 1–7 are repeated *k*<sup>1</sup> times and the performance characteristics of the proposed *Chart* 2 enhanced with 2-of-3 runs rule, namely, the false alarm rate (*FAR*, hereafter), the out-of-control alarm rate (*ARout*, hereafter), the in-control average run length (*ARLin*, hereafter), and the out-of-control run length (*ARLout*, hereafter) are estimated as the mean values of the corresponding *k*<sup>1</sup> results produced by steps 6

In order to ascertain the validity of the proposed simulation procedure described above, we shall first apply the algorithm without embodying any runs-type rule and compare the simulation-based outcomes to the corresponding results produced by the aid of the theoretical approximation appeared in Triantafyllou [6]. The simulation study has been accomplished based on the R software environment and involves 10.000 replications. **Table 1** displays several designs of the monitoring scheme mentioned as *Chart* 2 with a nominal level of in-control performance. Since we consider the same designs as those presented by Triantafyllou [6], the exact *FAR*s have been taken from his **Table 1**. As it is easily observed, the simulationbased results seem to be quite close to the exact values in all cases considered. For example, let us assume that we draw a reference sample of size *m* = 60 and test

0 *s* ele-

*<sup>j</sup>*¼<sup>1</sup> *Dj<sup>=</sup>*

*<sup>h</sup>*¼<sup>1</sup>*RLh=H*. When *<sup>F</sup>* <sup>=</sup> *G F*ð Þ 6¼ *<sup>G</sup>* ,

0 *s*

**Step 5.** Determine all consecutive (uninterrupted) triplets consisting of *Ti*

outside the control limits ð Þ *LCL*, *UCL* of the corresponding scheme.

and *k*<sup>2</sup> test samples of size *n* from the out-of-control distribution *G*.

*Quality Control - Intelligent Manufacturing, Robust Design and Charts*

Klein [12]).

the 2-of-2 or the 2-of-3 runs rule.

selecting appropriately the parameters *a*, *b*,*r*.

while it takes on the value 1 otherwise.

corresponds to its out-of-control alarm rate.

length of the monitoring scheme.

and 7, respectively.

**200**

of the monitoring scheme is calculated as *ARL* <sup>¼</sup> <sup>P</sup>*<sup>H</sup>*

one of the conditions mentioned in (2) is violated.


#### **Table 2.**

*Exact and simulation-based* ARLin *for a given design of* Chart *2.*

the aforementioned design, Triantafyllou [6] computed the exact *ARLin* equal to 378.7, while the simulation-based procedure proposed in the present chapter gives a corresponding *ARLin* value equal to 379.1.

Each cell contains the *AR*s attained for *γ* = 0.2 (upper entry) and *γ* = 10 (lower entry). Based on the above table, it is evident that the proposed simulation algorithm seems to come to an agreement with the corresponding exact values of the out-ofcontrol alarm rate of *Chart* 2. For example, for a design (*a*, *j*, *k*, *r*) = (10, 2, 4, 2) with reference sample size *m* = 200 and test sample size *n* = 5, the exact alarm rate for a

**Reference sample 100 200** *n* **(***a***,** *j***,** *k***,** *r***)** *Exact ARout Simulated ARout* **(***a***,** *j***,** *k***,** *r***)** *Exact ARout Simulated ARout*

*Simulation-Based Comparative Analysis of Nonparametric Control Charts with Runs-Type Rules*

(10, 2, 4, 2) 0.8609

(15, 2, 4, 2) 0.9056

(25, 5, 8, 4) 0.9527

(26, 4, 8, 4) 0.9895

(39, 11, 14, 4) 0.9989

(45, 13, 16, 6) 0.9942

0.6331

0.8300

0.9936

0.9953

0.9999

0.9999

0.8661 0.6414

0.8908 0.8237

0.9573 0.9912

0.9835 0.9913

0.9963 0.9963

0.9963 0.9962

0.8513 0.5815

0.4854 0.3867

0.9693 0.8059

0.9768 0.9831

0.9974 0.9962

0.9989 0.9989

*Each cell contains the AR's attained for Y = 0.2 (upper entry) and Y = 10 (lower entry).*

(66.31%), while the simulation-based alarm rate of *Chart* 2 is quite close to the exact

In this section, we carry out an extensive numerical experimentation to appraise the ability of the distribution-free monitoring schemes *Chart* 1, *Chart* 2, and *Chart* 3

*ARL***<sup>0</sup>** *m n* **(***a***,** *b***)** *j r Exact ARLin ARLout* **(***a***,** *b***)** *j r Exact ARLin ARLout* 370 100 5 (2, 96) 2 2 363.7 15.77 (3, 71) 2 2 378.01 11.73

500 100 5 (3, 96) 3 3 499.88 14.94 (2, 71) 2 2 497.66 12.69

*Underlying distributions: Exponential with mean equal to 2 (in-control) and 1 (out-of-control) respectively.*

11 (6, 83) 5 5 363.06 6.76 (8, 71) 4 5 364.79 6.59 500 5 (7, 473) 3 3 382.01 10.88 (9, 352) 2 2 380.5 10.27 11 (29, 444) 4 5 373.14 16.71 (17, 303) 4 4 360.9 9.29

11 (6, 84) 5 5 485.85 7.79 (4, 70) 3 6 511.12 7.13 500 5 (7, 476) 3 3 503.77 12.62 (8, 352) 2 2 488.61 11.56 11 (28, 454) 4 5 499.79 27.63 (17, 309) 4 4 489.45 5.62

*Chart* **1** *Chart* **1 with 2-of-3 runs rule**

shift to Lehmann alternative with parameter *γ* = 0.2 (10) equals to 86.09%

**4. The proposed control charts enhanced with runs-type rules**

one, namely, it equals to 86.61% (64.14%).

*Comparison of the* ARLout*s with the same* ARLin *for* Chart *1.*

5 (5, 2, 4, 3) 0.8530

11 (7, 3, 8, 5) 0.9888

25 (19, 11, 14, 4) 0.9982

**Table 3.**

**Table 4.**

**203**

(3, 3, 4, 3) 0.4783

(19, 5, 7, 4) 0.9812

(24, 11, 14, 4) 0.9996

0.6062

*DOI: http://dx.doi.org/10.5772/intechopen.91040*

0.3333

0.8133

0.9982

0.9994

0.9999

*Exact and simulation-based* ARout *for a given design of* Chart *2.*

We next focus on the ability of the distribution-free monitoring scheme defined in (1), under the assumption that the process has shifted to an out-of-control state. When the process has shifted from distribution *F* to *G*, then the ability of the scheme to detect the underlying alteration is associated with the function *G*∘*F*�<sup>1</sup> . For example, under the well-known Lehmann-type alternative (see, e.g., van der Laan and Chakraborti [13]), the out-of-control distribution function can be expressed as *<sup>G</sup>* <sup>¼</sup> *<sup>F</sup><sup>γ</sup>* , where *γ* > 0. **Table 3** sheds light on the out-of-control performance of *Chart* 2 by offering the corresponding alarm rate of the proposed scheme under the Lehmann alternatives with parameter *γ* ¼ 0*:*2, 10. Since we consider the same designs as those presented by Triantafyllou [6], the exact values of *ARout* have been copied from his **Table 3**, while the simulated results have been produced by following the procedure described earlier.


*Simulation-Based Comparative Analysis of Nonparametric Control Charts with Runs-Type Rules DOI: http://dx.doi.org/10.5772/intechopen.91040*


#### **Table 3.**

the aforementioned design, Triantafyllou [6] computed the exact *ARLin* equal to 378.7, while the simulation-based procedure proposed in the present chapter gives a

*ARL***<sup>0</sup>** *m n* **(***a***,** *b***) (***j***,** *k***,** *r***)** *Exact ARLin Simulated ARLin* 370 200 5 (2, 188) (2, 3, 2) 376.4 369.9

*Quality Control - Intelligent Manufacturing, Robust Design and Charts*

300 5 (5, 287) (2, 3, 2) 358.9 365.0

400 5 (5, 379) (2, 3, 2) 378.7 379.1

500 5 (6, 473) (2, 3, 2) 369.8 372.6

11 (3, 180) (2, 3, 3) 367.7 377.7 25 (14, 178) (6, 9, 14) 369.9 369.2

11 (19, 285) (4, 7, 4) 372.6 374.8 25 (20, 213) (6, 9, 7) 367.2 373.8

11 (12, 366) (3, 6, 4) 384.8 378.4 25 (33, 296) (7, 10, 9) 373.0 377.9

11 (15, 440) (3, 5, 4) 369.1 374.8 25 (32, 362) (6, 9, 6) 369.4 365.1

For example, under the well-known Lehmann-type alternative (see, e.g., van der Laan and Chakraborti [13]), the out-of-control distribution function can be

mance of *Chart* 2 by offering the corresponding alarm rate of the proposed scheme under the Lehmann alternatives with parameter *γ* ¼ 0*:*2, 10. Since we consider the same designs as those presented by Triantafyllou [6], the exact values of *ARout* have been copied from his **Table 3**, while the simulated results have been produced by

**Reference sample 40 60** *n* **(***a***,** *j***,** *k***,** *r***)** *Exact ARout Simulated ARout* **(***a***,** *j***,** *k***,** *r***)** *Exact ARout Simulated ARout*

> 0.8209 0.5244

> 0.8758 0.7403

0.8825 0.5502

0.8424 0.7612

0.9978 0.9978

0.9991 0.9994

We next focus on the ability of the distribution-free monitoring scheme defined in (1), under the assumption that the process has shifted to an out-of-control state. When the process has shifted from distribution *F* to *G*, then the ability of the scheme to detect the underlying alteration is associated with the function *G*∘*F*�<sup>1</sup>

, where *γ* > 0. **Table 3** sheds light on the out-of-control perfor-

(2, 2, 4, 4) 0.7890

(4, 2, 4, 3) 0.8800

(7, 4, 7, 4) 0.9812

(6, 5, 9, 4) 0.9135

(12, 12, 14, 4) 0.9938

(9, 10, 14, 5) 0.9971

0.3931

0.7161

0.9076

0.9678

0.9982

0.9759

0.7783 0.3589

0.8805 0.7095

0.9737 0.9090

0.9278 0.9614

0.9922 0.9970

0.9929 0.9763 .

corresponding *ARLin* value equal to 379.1.

*Exact and simulation-based* ARLin *for a given design of* Chart *2.*

following the procedure described earlier.

0.5448

0.7351

0.5357

0.7556

0.9978

0.9993

5 (2, 2, 4, 3) 0.8284

11 (2, 4, 8, 4) 0.8883

25 (9, 11, 14, 4) 0.9983

**202**

(10, 11, 14, 4) 0.9991

(3, 2, 4, 2) 0.8853

(3, 5, 8, 4) 0.8483

expressed as *<sup>G</sup>* <sup>¼</sup> *<sup>F</sup><sup>γ</sup>*

**Table 2.**

*Exact and simulation-based* ARout *for a given design of* Chart *2.*

Each cell contains the *AR*s attained for *γ* = 0.2 (upper entry) and *γ* = 10 (lower entry).

Based on the above table, it is evident that the proposed simulation algorithm seems to come to an agreement with the corresponding exact values of the out-ofcontrol alarm rate of *Chart* 2. For example, for a design (*a*, *j*, *k*, *r*) = (10, 2, 4, 2) with reference sample size *m* = 200 and test sample size *n* = 5, the exact alarm rate for a shift to Lehmann alternative with parameter *γ* = 0.2 (10) equals to 86.09% (66.31%), while the simulation-based alarm rate of *Chart* 2 is quite close to the exact one, namely, it equals to 86.61% (64.14%).
