**5. Real-world example**

In this section, we apply our proposed method to a real-world example. The counting process to monitor is the number of presentations at Gold Coast University Hospital emergency department for a broad definition of influenza. The events

**Figure 1.** *Residual analysis for the fitted model.*

for the early detection of the small outbreaks, smaller values for the smoothing

*Performance of plans when the in-control TBE are Weibull distributed with scale = 0.02 and shape = 0.85.*

**EWMA counts (***α***), shape = 0.95 Threshold 41.35 41.9028 42.4899 42.9932 43.5669 44.1448 44.7079 45.1527**

0.025 302.19 301.69 302.03 301.51 302.29 301.85 301.29 301.83 0.024 **51.937** 56.110 59.550 65.442 63.928 66.311 78.925 74.448 0.023 23.359 **20.844** 22.686 22.031 22.855 23.860 25.744 26.173 0.022 12.681 11.357 11.807 **11.345** 11.412 11.493 12.104 12.056 0.021 8.784 8.253 7.723 7.394 **7.150** 7.326 7.196 7.231 0.0205 7.474 6.866 6.855 6.410 5.997 **5.962** 6.113 5.977 0.020 6.788 5.962 5.416 5.368 5.075 5.038 5.136 **4.976** 0.019 4.840 4.707 4.415 4.032 3.942 3.844 3.805 **3.757**

*Performance of plans when the in-control TBEs are Weibull distributed with scale = 0.025 and shape = 0.95.*

**EWMA counts (***α***), shape = 0.85 Threshold 48.7256 49.5976 50.3141 50.9389 51.6532 52.35 53.0104 53.5827**

0.02 401.92 401.28 399.92 400.89 399.89 401.09 401.08 399.93 0.0195 **113.23** 121.88 123.74 135.49 144.80 145.77 145.82 156.46 0.019 51.948 **48.144** 51.531 57.694 57.722 63.461 66.637 69.652 0.018 19.344 18.374 17.494 **17.316** 17.663 18.892 19.627 19.487 0.0175 12.846 12.711 12.370 12.263 **12.260** 12.272 12.651 12.765 0.017 10.966 10.696 9.583 9.032 9.052 **8.752** 9.179 9.074 0.0165 8.261 8.510 7.599 7.301 6.946 6.948 **6.868** 6.954 0.016 7.191 6.386 6.198 5.803 5.666 5.429 5.456 **5.277** 0.015 5.474 4.868 4.354 4.119 4.031 4.047 3.862 **3.589**

**0.04 0.06 0.08 0.10 0.125 0.15 0.175 0.20**

**0.04 0.06 0.08 0.10 0.125 0.15 0.175 0.20**

**Scale** *α*

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

**Scale** *α*

**Table 2** shows the performance results of the plans when the shape and the scale parameters of the Weibull distribution are equal to 1.15 and 0.03, respectively. The *ATS*<sup>0</sup> for the plans employed to monitor this counting process is set to be approximately 200. In the results indicated in **Table 1**, plans with smaller smoothing parameter work better in early detection of small outbreaks than those with larger smoothing parameter. For the larger outbreaks, the detection power of the plans

**Table 3** shows the performance results of the plans when the shape and the scale parameters of the Weibull distribution are equal to 0.95 and 0.025, respectively. The *ATS*<sup>0</sup> for the plans employed to monitor this counting process is set to be

parameter are preferred.

**Table 4.**

**190**

**Table 3.**

increases as the smoothing parameters increases.

are presentations at Gold Coast University Hospital with flu symptoms. Data is gathered for four consecutive years starting from January 2015. We first check if the TBEs are Weibull distributed. We fitted a Weibull regression model to data, and all the parameters of the conditional distribution of the response variable are modeled using explanatory variables as the hour of the day harmonics, seasonal harmonics, and day of the week. To do so, we employ "gamlss" [13] R package for statistical modeling. This package includes functions for fitting the generalized additive models for location, scale, and shape introduced by Rigby and Stasinopoulos [14]. The R procedure for the model fitting is as follows:

gamlss(formula = TBE � wd + wd=="Monday") + (wd=="Thursday"))∗ (cos(2 ∗ pi ∗ hr/24) + sin(2 ∗ pi ∗ hr/24)) + cos (2 ∗ pi ∗ nday/365.25) + sin (2 ∗ pi ∗ nday/365.25)sigma.formula = �(cos2 ∗ pi ∗ hr/24)+ sin (2∗pi∗hr/24))+cos(2∗pi∗nday/365.25)+sin(2∗pi∗day/365.25) family=WEI()data=data)

where wd, nday, and hr. are week day, number of the day in a year, and the time of day (0–24), respectively. **Figure 1** summarizes the analysis of the residuals for the fitted model. As shown in **Figure 1**, since residuals do not represent any particular pattern in data, and the model describes the response variables quite well, then we conclude that TBEs are Weibull distributed. Details for the analyzing the model adequacy is presented in Appendix B.

As mentioned earlier, the threshold, *hc*, is determined according to parameters of the underlying Weibull distribution for the TBEs. For any timestamp during the monitoring period, the fitted model is used to predict the parameters of the Weibull distribution. Then these parameters along with the smoothing parameter, *α*, and the in-control ARL are substituted in models in Appendix A to establish the *hc* for Weibull-distributed counts. The parameter for the day of the count is taken as the average of the estimated parameters for the day of events. Considering *α* ¼ 0*:*1 and

*ARL*<sup>0</sup> for the plan to be 400, the estimated parameters are used to establish the AEWMA plan for monitoring the daily counts of flu presentations at the Gold Coast University Hospital. **Figure 2** shows the time series of the monitoring statistic over the study period, and **Figure 3** is the time series of the daily flu counts. The

*Exponentially Weighted Moving Averages of Counting Processes When the Time between Events…*

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

proposed plan indicates six potential flu outbreaks during 4 years as the monitoring statistic falls beyond 1. Note that influenza counts in 2015 were bigger than usual, but not unusual in 2016 (apart from early in that year). However, in 2017 this was flagged as a very unusual influenza outbreak and this seems to persist into early

In this chapter, we proposed an adaptive EWMA surveillance plan to monitor a counting process of which the time between its events is Weibull distributed. The proposed method can be applied to both homogeneous and nonhomogeneous processes. To implement the proposed surveillance plan, the scale and shape parameters for the underlying distribution of the TBEs are estimated using a distributional regression approach [15]. Then the threshold for the counts is established using the estimated parameters and the desired ARL. The proposed plan is applied to both simulated and real data. Simulation results indicate that the proposed method is applicable for detecting outbreaks of any magnitude and also signals them in a reasonable time after their incidence. In addition, simulations revealed that for the detection of the large outbreak, plans with larger smoothing parameter are superior. However, for the early detection of small outbreaks, we need to employ smaller smoothing weights. Applying the proposed surveillance method to real data, we

conclude that the proposed method is capable of detecting outbreaks in

2018.

**193**

**Figure 3.**

*Event counts vs. time.*

**6. Concluding remarks**

nonhomogeneous counting processes.

**Figure 2.** *AEWMA chart using α* ¼ *0:1 for influenza presentations at Gold Coast University Hospital.*

*Exponentially Weighted Moving Averages of Counting Processes When the Time between Events… DOI: http://dx.doi.org/10.5772/intechopen.90873*

**Figure 3.** *Event counts vs. time.*

are presentations at Gold Coast University Hospital with flu symptoms. Data is gathered for four consecutive years starting from January 2015. We first check if the TBEs are Weibull distributed. We fitted a Weibull regression model to data, and all the parameters of the conditional distribution of the response variable are modeled using explanatory variables as the hour of the day harmonics, seasonal harmonics, and day of the week. To do so, we employ "gamlss" [13] R package for statistical modeling. This package includes functions for fitting the generalized additive models for location, scale, and shape introduced by Rigby and Stasinopoulos [14].

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

gamlss(formula = TBE � wd + wd=="Monday") + (wd=="Thursday"))∗ (cos(2 ∗ pi ∗ hr/24) + sin(2 ∗ pi ∗ hr/24)) + cos (2 ∗ pi ∗ nday/365.25) + sin (2 ∗ pi ∗ nday/365.25)sigma.formula = �(cos2 ∗ pi ∗ hr/24)+ sin (2∗pi∗hr/24))+cos(2∗pi∗nday/365.25)+sin(2∗pi∗day/365.25)

where wd, nday, and hr. are week day, number of the day in a year, and the time of day (0–24), respectively. **Figure 1** summarizes the analysis of the residuals for the fitted model. As shown in **Figure 1**, since residuals do not represent any particular pattern in data, and the model describes the response variables quite well, then we conclude that TBEs are Weibull distributed. Details for the analyzing the model

As mentioned earlier, the threshold, *hc*, is determined according to parameters of the underlying Weibull distribution for the TBEs. For any timestamp during the monitoring period, the fitted model is used to predict the parameters of the Weibull distribution. Then these parameters along with the smoothing parameter, *α*, and the in-control ARL are substituted in models in Appendix A to establish the *hc* for Weibull-distributed counts. The parameter for the day of the count is taken as the average of the estimated parameters for the day of events. Considering *α* ¼ 0*:*1 and

*AEWMA chart using α* ¼ *0:1 for influenza presentations at Gold Coast University Hospital.*

The R procedure for the model fitting is as follows:

family=WEI()data=data)

**Figure 2.**

**192**

adequacy is presented in Appendix B.

*ARL*<sup>0</sup> for the plan to be 400, the estimated parameters are used to establish the AEWMA plan for monitoring the daily counts of flu presentations at the Gold Coast University Hospital. **Figure 2** shows the time series of the monitoring statistic over the study period, and **Figure 3** is the time series of the daily flu counts. The proposed plan indicates six potential flu outbreaks during 4 years as the monitoring statistic falls beyond 1. Note that influenza counts in 2015 were bigger than usual, but not unusual in 2016 (apart from early in that year). However, in 2017 this was flagged as a very unusual influenza outbreak and this seems to persist into early 2018.
