# 11.2 Chart characteristics

Consider the change point model (11.1). For fixed denote and the corresponding probability measure and expectation, respectively. Hereby, stands for the case of no change, i.e. the so called in-control case. Then the Average Run Length (ARL) (expectation of the run length ) is defined as

 (11.7)

Thus, the ARL denotes the average number of observations until signal for a sequence with constant expectation. or stands for no change, and mark, that just at the first time point (or earlier) a change takes place from to . Therefore, the ARL evaluates only the special scenario of of the SPC scheme. Other measures, which take into account that usually , were introduced by Lorden (1971) and Pollak and Siegmund (1975), Pollak and Siegmund (1975). Here, we use a performance measure which was firstly proposed by Roberts (1959). The so called (conditional) Average Delay (AD, also known as steady-state ARL) is defined as

 (11.8)

where is the value of in (11.1), i.e. the expectation after the change. While measures the delay for the case , determines the delay for a SPC scheme which ran a long time without signal. Usually, the convergence in (11.8) is very fast. For quite small the difference between and is very small already. and are average values for the random variable . Unfortunately, is characterized by a large standard deviation. Therefore, one might be interested in the whole distribution of . Again, we restrict on the special cases and . We consider the probability mass function (PMF) and the cumulative distribution function (CDF). Based on the CDF, one is able to compute quantiles of the run length .

For normally distributed random variables it is not possible to derive exact solutions for the above characteristics. There are a couple of approximation techniques. Besides very rough approximations based on the Wald approximation known from sequential analysis, Wiener process approximations and similar methods, three main methods can be distinguished:

1. Markov chain approach due to Brook and Evans (1972): Replacement of the continuous statistic by a discrete one

2. Quadrature of integral equations which are derived for the ARL, Vance (1986) and Crowder (1986) and for some eigenfunctions which lead to the AD

3. Waldmann (1986) approach: Iterative computation of by using quadrature and exploiting of monotone bounds for the considered characteristics

Here we use the first approach, which has the advantage, that all considered characteristics can be presented in a straightforward way. Next, the Markov chain approach is briefly described. Roughly speaking, the continuous statistic is approximated by a discrete Markov chain . The transition is approximated by the transition with and . That is, given an integer the continuation region of the scheme , zreflect, or is separated into or intervals of the kind (one exception is as the first subinterval of ). Then, the transition kernel of is approximated by the discrete kernel of , i.e.

for all and . Eventually, we obtain a Markov chain with or transient states and one absorbing state. The last one corresponds to the alarm (signal) of the scheme.

Denote by the matrix of transition probabilities of the Markov chain on the transient states, a vector of ones, and the ARL vector. stands for the ARL of a SPC scheme which starts in point (corresponds to ). In the case of a one-sided CUSUM scheme with the value approximates the original ARL. By using we generalize the original schemes to schemes with possibly different starting values . Now, the following linear equation system is valid, Brook and Evans (1972):

 (11.9)

where denotes the identity matrix. By solving this equation system we get the ARL vector and an approximation of the ARL of the considered SPC scheme. Remark that the larger the better is the approximation. In the days of Brook and Evans (1972) the maximal matrix dimension (they considered cusum1) was 15 because of the restrictions of the available computing facilities. Nowadays, one can use dimensions larger than some hundreds. By looking at different one can find a suitable value. The quantlet XFGrarl.xpl demonstrates this effect for the Brook and Evans (1972) example. 9 different values of from 5 to 500 are used to approximate the in-control ARL of a one-sided CUSUM chart with and (variance ). We get

 5 10 20 30 40 50 100 200 500 113.47 116.63 117.36 117.49 117.54 117.56 117.59 117.59 117.6
<>

The true value is 117.59570 (obtainable via a very large or by using the quadrature methods with a suitable large number of abscissas). The computation of the average delay (AD) requires more extensive calculations. For details see, e.g., Knoth (1998) on CUSUM for Erlang distributed data. Here we apply the Markov chain approach again, Crosier (1986). Given one of the considered schemes and normally distributed data, the matrix is primitive, i.e. there exists a power of which is positive. Then has one single eigenvalue which is larger in magnitude than the remaining eigenvalues. Denote this eigenvalue by . The corresponding left eigenvector is strictly positive, i.e.

 (11.10)

It can be shown, Knoth (1998), that the conditional density of both the continuous statistic and the Markov chain tends for to the normalized left eigenfunction and eigenvector, respectively, which correspond to the dominant eigenvalue . Therefore, the approximation of can be constructed by

Note, that the left eigenvector is computed for the in-control mean , while the ARL vector is computed for a specific out-of-control mean or again.

If we replace in the above quantlet ( XFGrarl.xpl ) the phrase arl by ad, then we obtain the following output which demonstrates the effect of the parameter again.

 5 10 20 30 40 50 100 200 500 110.87 114 114.72 114.85 114.9 114.92 114.94 114.95 114.95
<>

Fortunately, for smaller values of than in the ARL case we get good accuracy already. Note, that in case of cusum2 the value has to be smaller (less than 30) than for the other charts, since it is based on the computation of the dominant eigenvalue of a very large matrix. The approximation in case of combination of two one-sided schemes needs a twodimensional approximating Markov chain. For the ARL only exists a more suitable approach. As, e.g., Lucas and Crosier (1982) shown it is possible to use the following relation between the ARLs of the one- and the two-sided schemes. Here, the two-sided scheme is a combination of two symmetric one-sided schemes which both start at . Therefore, we get a very simple formula for the ARL of the two-sided scheme and the ARLs and of the upper and lower one-sided CUSUM scheme

 (11.11)

Eventually, we consider the distribution function of the run length itself. By using the Markov chain approach and denoting with the approximated probability of for a SPC scheme started in , such that , we obtain

 (11.12)

The vector is initialized with for the starting point and otherwise. For large we can replace the above equation by

 (11.13)

The constant is defined as

where denotes the right eigenvector of , i.e. . Based on (11.12) and (11.13) the probability mass and the cumulative distribution function of the run length can be approximated. (11.12) is used up to a certain . If the difference between (11.12) and (11.13) is smaller than , then exclusively (11.13) is exploited. Remark, that the same is valid as for the AD. For the two-sided CUSUM scheme (cusum2) the parameter has to be small ().

## 11.2.1 Average Run Length and Critical Values

The spc quantlib provides the quantlets spcewma1arl ,..., spccusumCarl for computing the ARL of the corresponding SPC scheme. All routines need the actual value of as a scalar or as a vector of several , two scheme parameters, and the integer (see the beginning of the section). The XploRe example XFGarl.xpl demonstrates all ...arl routines for , , zreflect, , , in-control and out-of-control means and , respectively. The next table summarizes the ARL results

 chart ewma1 ewma2 cusum1 cusum2 cusumC 1694.0 838.30 117.56 58.780 76.748 11.386 11.386 6.4044 6.4036 6.4716
<>

Remember that the ARL of the two-sided CUSUM (cusum2) scheme is based on the one-sided one, i.e. and with .

For the setup of the SPC scheme it is usual to give the design parameter and for EWMA and CUSUM, respectively, and a value for the in-control ARL. Then, the critical value ( or ) is the solution of the equation . Here, the regula falsi is used with an accuracy of . The quantlet XFGc.xpl demonstrates the computation of the critical values for SPC schemes with in-control ARLs of , reference value (CUSUM), smoothing parameter (EWMA), zreflect, and the Markov chain parameter .

 chart ewma1 ewma2 cusum1 cusum2 cusumC 2.3081 2.6203 3.8929 4.5695 4.288
<>

The parameter guarantees fast computation and suitable accuracy. Depending on the power of the computer one can try values of up to 1000 or larger (see XFGrarl.xpl in the beginning of the section).

## 11.2.2 Average Delay

The usage of the routines for computing the Average Delay (AD) is similar to the ARL routines. Replace only the code arl by ad. Be aware that the computing time is larger than in case of the ARL, because of the computation of the dominant eigenvalue. It would be better to choose smaller , especially in the case of the two-sided CUSUM. Unfortunately, there is no relation between the one- and two-sided schemes as for the ARL in (11.11). Therefore, the library computes the AD for the two-sided CUSUM based on a twodimensional Markov chain with dimension . Thus with values of larger than 30, the computing time becomes quite large. Here the results follow for the above quantlet XFGrarl.xpl with ad instead of arl and for spccusum2ad :

 chart ewma1 ewma2 cusum1 cusum2 cusumC 1685.8 829.83 114.92 56.047 74.495 11.204 11.168 5.8533 5.8346 6.2858
<>

## 11.2.3 Probability Mass and Cumulative Distribution Function

The computation of the probability mass function (PMF) and of the cumulative distribution function (CDF) is implemented in two different types of routines. The first one with the syntax spcchartpmf returns the values of the PMF and CDF at given single points of , where chart has to be replaced by ewma1, ..., cusumC. The second one written as spcchartpmfm computes the whole vectors of the PMF and of the CDF up to a given point , i.e. and the similar one of the CDF.

Note, that the same is valid as for the Average Delay (AD). In case of the two-sided CUSUM scheme the computations are based on a twodimensional Markov chain. A value of parameter less than 30 would be computing time friendly.

With the quantlet XFGpmf1.xpl the 5 different schemes (, for cusum2 ) are compared according their in-control PMF and CDF ( ) at the positions in . Remark, that the in-control ARL of all schemes is chosen as 300.

 chart ewma1 ewma2 cusum1 cusum2 cusumC 0.00318 0.00272 0.00321 0.00307 0.00320 0.00332 0.00324 0.00321 0.00325 0.00322 0.00315 0.00316 0.00310 0.00314 0.00311 0.00292 0.00296 0.00290 0.00294 0.00290 0.00246 0.00249 0.00245 0.00248 0.00245 0.00175 0.00177 0.00175 0.00176 0.00175 0.00125 0.00126 0.00124 0.00125 0.00125 0.01663 0.01233 0.02012 0.01675 0.01958 0.05005 0.04372 0.05254 0.04916 0.05202 0.08228 0.07576 0.08407 0.08109 0.08358 0.14269 0.13683 0.14402 0.14179 0.14360 0.27642 0.27242 0.27728 0.27658 0.27700 0.48452 0.48306 0.48480 0.48597 0.48470 0.63277 0.63272 0.63272 0.63476 0.63273
<>

A more appropriate, graphical representation provides the quantlet XFGpmf2.xpl . Figure 11.4 shows the corresponding graphs.