<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/is-the-answer-to-everything-gaussian/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://staff.math.su.se/hoehle/blog/2018/10/29/gauss.html"> Theory meets practice...</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<h2>Abstract:</h2>
<p>As an applied statistician you get in touch with many challenging problems in need of a statistical solution. Often, your client/colleague already has a working solution and just wants to clarify a small statistical detail with you. Equally often, your intuition suggests you that the working solution is not statistically adequate, but how to substantiate this? As motivating example we use the statistical process control methodology used in <span data-cites="sarma_etal2018">Sarma et al. (2018)</span> for monitoring a binomial proportion as part of a syndromic surveillance kit.</p>
<p><center><br>
<img src="https://i0.wp.com/staff.math.su.se/hoehle/blog/figure/source/2018-10-29-gauss/fig1a-hilight.png?w=450" data-recalc-dims="1"><br>
</center></p>
<p> <a rel="nofollow" href="http://creativecommons.org/licenses/by-sa/4.0/" target="_blank"><img alt="Creative Commons License" src="https://i1.wp.com/i.creativecommons.org/l/by-sa/4.0/88x31.png?w=456&ssl=1" data-recalc-dims="1"></a> This work is licensed under a <a rel="nofollow" href="http://creativecommons.org/licenses/by-sa/4.0/" target="_blank">Creative Commons Attribution-ShareAlike 4.0 International License</a>. The markdown+Rknitr source code of this blog is available under a <a rel="nofollow" href="https://www.gnu.org/licenses/gpl-3.0.html" target="_blank">GNU General Public License (GPL v3)</a> license from github.</p>
<h2>Introduction</h2>
<p>A few weeks ago I became aware of the publication by <span data-cites="sarma_etal2018">Sarma et al. (2018)</span>, who as part of a syndromic surveillance system monitor the time series of a proportion with the aim of timely detecting changes. What initially caught my intention was their figure 1A:</p>
<p><center><br>
<img src="https://i0.wp.com/staff.math.su.se/hoehle/blog/figure/source/2018-10-29-gauss/fig1a.png?w=450" data-recalc-dims="1"><br>
</center><br>
<font color="bbbbbb">Figure : Figure 1A from <span data-cites="sarma_etal2018">Sarma et al. (2018)</span> showing the time series of proportions that reports of acute respiratory infection make up of all syndrome reports that day. </font></p>
<p><p>Reading the details of the paper reveals that the number of daily counts on 14 syndromes is collected and for each syndrome the proportion of the particular syndrome out of all syndrome reports is calculated. In other words: given that the counts for a particular day <span>\(t\)</span> are <span>\(y_{it}, i=1, \ldots, 14\)</span>, the monitored proportion is <span>\(p_{it} = y_{it}/\sum_{j=1}^{14} y_{jt}\)</span>. It is thus clear that it’s impossible to get beyond 100%. The more surprising was that the upper level in the figure goes beyond it – a sign of an inadequate statistical method. What the authors do is to compute an upper threshold for a particular day <span>\(t_{0}\)</span> as follows:</p>
<p><span>\[<br>
U_{t_0} = \overline{p}_{t_0}(d) + k \cdot s_{t_0}(d), \quad \text{where}\\<br>
\quad \overline{p}_{t_0}(d) = \frac{1}{d}\sum_{t=t_0-d}^{t_0-1} p_{t}<br>
\quad\text{and}\quad<br>
s_{t_0}(d) = \frac{1}{d-1} \sum_{t=t_0-d}^{t_0-1}<br>
(p_{t} – \overline{p}_{t_0}(d))^2<br>
\]</span></p>
<p>is the mean and standard deviation of the <span>\(d\)</span> baseline observations<a rel="nofollow" href="http://staff.math.su.se/hoehle/blog/2018/10/29/gauss.html#fn1" target="_blank"><sup>1</sup></a>, respectively, and <span>\(k\)</span> is a tuning parameter – for 12 out of the 14 syndromes <span>\(k=2\)</span> is used, but for the two syndromes with highest proportions, including acute respiratory infections, <span>\(k=4\)</span> is used. As the method looks like an adaptation of the simple EARS method <span data-cites="fricker_etal2008">(Fricker, Hegler, and Dunfee 2008)</span> to proportions this caused me to tweet the following critical remark (no harm intended besides the scientific criticism of using a somewhat inadequate statistical method):</p>
<p><center><br>
<img src="https://i2.wp.com/staff.math.su.se/hoehle/blog/figure/source/2018-10-29-gauss/tweet1.png?w=450" data-recalc-dims="1"><br>
</center></p>
<p>To which one of the authors, <a rel="nofollow" href="https://twitter.com/evolution_v2" target="_blank">Alexander Ullrich</a>, replied</p>
<p><center><br>
<img src="https://i1.wp.com/staff.math.su.se/hoehle/blog/figure/source/2018-10-29-gauss/tweet2.png?w=450" data-recalc-dims="1"><br>
</center></p>
<p><p>Initially, I replied by twitter, but realized that twitter is not a good format for a well-balanced and thorough scientific discourse. Also, my answers lacked exemplification and supporting numbers, so I deleted the answers and shall instead use this blog post to provide a thorough answer. Please note that my discussion focuses on the paper’s statistical methodology approach – I do think the published application is very important and I’m happy to see that the resulting Excel tool is made available to a greater audience under a creative common license!</p>
<p>As much I can understand the motives, working in applied statistics is always a balance between mathematical exactness and pragmatism. A <a rel="nofollow" href="https://quoteinvestigator.com/2011/05/13/einstein-simple/" target="_blank">famous quote</a> says that things should be as simple as possible, but not simpler. But if mathematical rigour always is second, something is amiss. In this light, I’d like to comment on the four reasons given in Alexander’s reply.</p>
<h3>Reason 1 &amp; 2:</h3>
<p>In principle I agree and taking a non-parametric and distribution free approach is healthy, if you fear your assumptions are more quickly violated than you can formulate them. Using mean plus two times standard deviation of the <span>\(d=15\)</span> baseline counts does, however, imply certain assumptions. It means that you believe the distribution being sufficiently stable that the expectation and standard deviation estimated from the baseline values is indicative for the next observation’s expectation and standard deviation. In other words: no trends, no day of the week effects no previous outbreaks are allowed in the baseline. Looking at the jump of the upper-bound line after the single peak in June 2016 in Fig 1A one might conclude that this might be a problematic assumption. Furthermore, one assumes the distribution is sufficiently symmetric such that its quantiles can be described as a number of times the standard deviations away from the mean. Finally, by using the usual formula to estimate the standard deviation one assumes that the observations are independent. They are likely not and, hence, the estimated standard deviation might be too small. All these limitations need to be mentioned, and probably are the biggest problem with the method, but could be addressed by semi-simple modelling approaches as done, e.g., in <span data-cites="farrington96">Farrington et al. (1996)</span> for counts.</p>
<p>For the remainder of this post, I shall instead focus on using the mean plus two times standard deviation (sd) rule as I have seen it in too many times – also in other surveilance contexts. The problem we are solving <em>is</em> a statistical one, so writing that the k-times-sd-rule is not meant to have a probabilistic interpretation leaves the user alone with the choice of threshold. In particular many users will know from their Statistics 101 class that mean plus/minus two times sd is as a way to get approximately 95% of the mass for anything which has a Gaussian shape. Due to the <strong>central limit theorem</strong> this shape will apply to a certain degree.</p>
<p>So what we do is to compare an out-of-sample observation with a threshold. In this case the <strong>prediction interval</strong> for the observation is the statistical correct object for the comparison. Because the standard deviation is estimated from data, the prediction interval should be based on quantiles of a t-distribution with <span>\(d-1\)</span> degrees of freedom. In this case the appropriate upper limit of a two-sided <span>\((1-\alpha)\cdot 100%\)</span> prediction interval is given as</p>
<p><span>\[<br>
\begin{align} \label{eq:predict-ul-gauss} \<br>
U_{t_0} = \overline{p}_{t_0}(d) +<br>
t_{1-\alpha/2}(d-1) \cdot \sqrt{1+\frac{1}{d}} \cdot s_{t_0}(d),<br>
\end{align}<br>
\]</span> where <span>\(t_{1-\alpha/2}(d-1)\)</span> denotes the <span>\(1-\alpha/2\)</span> quantile of the t-distribution with <span>\(d-1\)</span> degrees of freedom. In our case <span>\(\alpha=0.05\)</span> so we need the 97.5% quantile. See for example Chapter 10 of <span data-cites="young_smith2005">Young and Smith (2005)</span> or the Wikipedia page on <a rel="nofollow" href="https://en.wikipedia.org/wiki/Prediction_interval#Unknown_mean,_unknown_variance" target="_blank">prediction intervals</a> for details.</p>
<p>With <span>\(d=15\)</span><a rel="nofollow" href="http://staff.math.su.se/hoehle/blog/2018/10/29/gauss.html#fn2" target="_blank"><sup>2</sup></a> the upper limit of a one-sided 97.5% prediction interval would have the multiplication factor 2.22 on the estimated standard deviation. Thus using a factor of 2 instead means your procedure is slightly more sensitive than a the possibly anticipated 2.5% false alarm probability. Calculations show that the false alarm probability under the null hypothesis is 3.7% (assuming the Gaussian assumption holds). Altogether, one can say that this in the <span>\(d=15\)</span> case, for the sake of simplicity, the difference appears ignorable. Had <span>\(d\)</span> been smaller the difference becomes more relevant though.</p>
<h3>Reason 3</h3>
<p>I’m not sure I got the point, but one problem is that if your baseline consists of the observations are <span>\(y\)</span>, <span>\(y\)</span>, <span>\(\ldots\)</span>, <span>\(y\)</span> then the upper limit by your method will also be <span>\(y\)</span>, as the estimated standard deviation will be zero. Another problem is if the denominator <span>\(n_t\)</span> is zero, but because this appears to have a regular shape (no reports on weekends), this can just be left out of the modelling?</p>
<h3>Reason 4</h3>
<p>This reason I find particular troublesome, because it is an argument statisticians hear often. A wider audience expects a <strong>valid</strong> statistical method, not more complicated than necessary, but <strong>sound</strong> and available within the tools at hand. I argued above that two times standard deviation for proportions might be working, but you implicitly leave a lot of problems for the user to solve due to insufficient statistical modelling. I agree that too complicated might not work, but if -for the sake of pragmatism- we neither inform or quantify potential problems of a <em>too simplistic</em> solution nor fail to provide something workable which is better, we’ll be out of a job quickly.</p>
<h2>Can we do better?</h2>
<p>Initially it appeared natural to either try a data or parameter transformation in order to ensure that the computed upper limit respects the <span>\([0,1]\)</span> bound. However, all suggestions I tried proved problematic one way or the other, e.g., due to small sample sizes. Instead, a simple Bayesian and a simple non-parametric variant are considered.</p>
<h4>Beta-Binomial</h4>
<p>A simple approach is to use a conjugate prior-posterior Bayesian updating scheme. Letting <span>\(\pi\)</span> be the true underlying proportion, we assume a <span>\(\operatorname{Be}(0.5, 0.5)\)</span> prior for it initially. Observing <span>\(y_{t} \sim \operatorname{Bin}(n_t, \pi)\)</span> for <span>\(t=t_0-d, \ldots, t_0\)</span>, the posterior for <span>\(\pi\)</span> will be <span>\[<br>
\pi | y_{t_0-d},<br>
\ldots, y_{t_0} \sim<br>
\operatorname{Be}\left(0.5 + \sum_{t=t_0-d}^{t_0-1} y_t, 0.5 + \sum_{t=t_0-d}^{t_0-1} (n_t – y_t)\right)<br>
\]</span> One can then show that the posterior predictive distribution for the next observation, i.e. <span>\(y_{t_0}\)</span>, is <span>\[<br>
y_{t_0} | y_{t_0-d}, \ldots, y_{t_0} \sim<br>
\operatorname{BeBin}\left(n_{t_0}, 0.5 + \sum_{t=t_0-d}^{t_0-1} y_t, 0.5 + \sum_{t=t_0-d}^{t_0-1} (n_t – y_t\right),<br>
\]</span> where <span>\(\operatorname{BeBin}(n, a, b)\)</span> denotes the <a rel="nofollow" href="https://en.wikipedia.org/wiki/Beta-binomial_distribution" target="_blank">beta-binomial distribution</a> with size parameter <span>\(n\)</span> and the two shape parameters <span>\(a\)</span> and <span>\(b\)</span> implemented in, e.g., the <a rel="nofollow" href="https://cran.r-project.org/web/packages/VGAM/index.html" target="_blank"><code>VGAM</code> package</a>. We then use the upper 97.5% quantile of this distribution to define the threshold <span>\(U_{t_0}\)</span> for <span>\(p_{t_0}\)</span> and sound an alarm if <span>\(p_{t_0} > U_{t_0}\)</span>.</p>
<p>A simple variant of this procedure is to use a <em>plug-in</em> type prediction interval by obtaining the upper limit as the 97.5% quantile of the binomial with size parameter <span>\(n_{t_0}\)</span> and probability <span>\(p_{t_0}\)</span>. However, this approach ignores all uncertainty originating from the estimation of <span>\(p_{t_0}\)</span> and, hence, is likely to result in somewhat narrower prediction intervals than the Beta-Binomial approach.</p>
<h2>Non-parametric</h2>
<p>A one-sided 97.5% prediction interval <span>\([0, U]\)</span> based on the continuous values <span>\(p_{t_0-39},\ldots, p_{t_0-1}\)</span> without ties is given as (see e.g. <span data-cites="arts_etal2004">Arts, Coolen, and van der Laan (2004)</span> or the Wikipedia entry on <a rel="nofollow" href="https://en.wikipedia.org/wiki/Prediction_interval#Non-parametric_methods" target="_blank">non-parametric prediction intervals</a>): <span>\[<br>
U_{t_0} = \max(p_{t_0-39},\ldots, p_{t_0-1}).<br>
\]</span> Hence, an alarm is flagged if <span>\(p_{t_0}> U_{t_0}\)</span>. This means we simply compare the current value with the maximum of the baseline values. If we only have <span>\(d=19\)</span> values, then the interval from zero to the maximum of these values would constitute a one-sided 95% prediction interval.</p>
<h4>Simulation Study</h4>
<p>We consider the false alarm proportion of the suggested method (2 times and 4 times standard deviation, as well as the prediction interval method and a beta-binomial approach by simulating from a null model, where <span>\(d+1\)</span> observations are iid. from a binomial distribution <span>\(\operatorname{Bin}(25, \pi)\)</span>. The first <span>\(d\)</span> observations are used for estimation and then upper limit computed by the algorithm is compared to the last observations. Note: the non-parametric method requires the simulation of 39+1 values. For all methods: If the last observation exceeds the upper limit an alarm is sounded. We will be interested in the false alarm probability, i.e. the probability that an alarm is sounded even though we know that the last observation originates from the same model as the baseline parameters. For the methods using a 97.5% one-sided prediction interval, we expect this false error probability to be 2.5%.</p>
<p>The function implementing the six algorithms to compare looks as follows:</p>
<div>
<pre><code>algo_sysu_all &lt;-<span> </span><span>function</span>(y, n, t0, d) {
  <span>stopifnot</span>(t0<span>-</span>d <span>></span><span> </span><span>0</span>)
  p &lt;-<span> </span>y<span>/</span>n
  baseline_idx &lt;-<span> </span>(t0<span>-</span><span>1</span>)<span>:</span>(t0<span>-</span>d)
  baseline &lt;-<span> </span>p[baseline_idx]
  m &lt;-<span> </span><span>mean</span>(baseline)
  sd &lt;-<span> </span><span>sd</span>(baseline)
  U_twosd &lt;-<span> </span>m <span>+</span><span> </span><span>2</span><span>*</span>sd
  U_pred &lt;-<span> </span>m <span>+</span><span> </span><span>sqrt</span>(<span>1</span><span>+</span><span>1</span><span>/</span>d)<span>*</span><span>qt</span>(<span>0.975</span>, <span>df=</span>d<span>-</span><span>1</span>)<span>*</span>sd
  U_foursd &lt;-<span> </span>m <span>+</span><span> </span><span>4</span><span>*</span>sd

  ##Beta binomial
  astar &lt;-<span> </span><span>0.5</span> <span>+</span><span> </span><span>sum</span>(y[baseline_idx])
  bstar &lt;-<span> </span><span>0.5</span> <span>+</span><span> </span><span>sum</span>((n[baseline_idx] <span>-</span><span> </span>y[baseline_idx]))
  U_betabinom &lt;-<span> </span><span>qbetabinom.ab</span>(<span>q=</span><span>0.975</span>, <span>size=</span>n[t0], <span>shape1=</span>astar, <span>shape2=</span>bstar) <span>/</span><span> </span>n[t0]

  ##Non-parametric with a 97.5% one-sided PI (needs 39 obs)
  U_nonpar &lt;-<span> </span><span>max</span>( p[(t0<span>-</span><span>1</span>)<span>:</span>(t0<span>-</span><span>39</span>)])

  ##Prediction interval based on Binomal variance based on Fisher info
  U_binom &lt;-<span> </span><span>qbinom</span>(<span>p=</span><span>0.975</span>, <span>size=</span>n[t0], <span>prob=</span>m) <span>/</span><span> </span>n[t0]

  <span>return</span>(<span>data.frame</span>(<span>t=</span>t0, <span>U_twosd=</span>U_twosd, <span>U_foursd=</span>U_foursd, <span>U_pred=</span>U_pred, <span>U_betabinom=</span>U_betabinom, <span>U_nonpar=</span>U_nonpar, <span>U_binom=</span>U_binom))
}</code></pre>
</div>
<p>This can be wrapped into a function performing a single simulation :</p>
<div>
<pre><code>##Simulate one iid binomial time series
simone &lt;-<span> </span><span>function</span>(pi0, <span>d=</span><span>21</span>, <span>n=</span><span>25</span>) {
  length_ts &lt;-<span> </span><span>max</span>(<span>39</span><span>+</span><span>1</span>, d<span>+</span><span>1</span>)
  y &lt;-<span> </span><span>rbinom</span>(length_ts, <span>size=</span>n, <span>prob=</span>pi0)
  n &lt;-<span> </span><span>rep</span>(n, length_ts)
  p &lt;-<span> </span>y<span>/</span>n
  res &lt;-<span> </span><span>algo_sysu_all</span>(<span>y=</span>y, <span>n=</span>n, <span>t0=</span>length_ts, <span>d=</span>d)
  <span>return</span>(<span>c</span>(<span>twosd=</span>res<span>$</span>U_twosd, <span>foursd=</span>res<span>$</span>U_foursd, <span>pred=</span>res<span>$</span>U_pred, <span>betabinom=</span>res<span>$</span>U_betabinom, <span>nonpar=</span>res<span>$</span>U_nonpar, <span>binom=</span>res<span>$</span>U_binom) <span></span><span> </span>p[length_ts])
}</code></pre>
</div>
<p>We then perform the simulation study using several cores using the <code>future</code> and <code>future.apply</code> package:</p>
<p><center><br>
<img src="https://i2.wp.com/staff.math.su.se/hoehle/blog/figure/source/2018-10-29-gauss/PLOTFAP-1.png?w=456" data-recalc-dims="1"><br>
</center><br>
<font color="bbbbbb">Figure 2: False positive probability for different <span>\(\pi\)</span> values each estimated by 10,000 Monte Carlo simulations. </font></p>
<p><p>In the figure we see that both the two and four times standard deviation approach (twosd, foursd) as well as the approach based on the 97.5% predictive distribution in a Gaussian setting (pred) have a varying FAP over the range of true proportions: The smaller <span>\(\pi\)</span> the higher the FAP. The FAP can be as high as 7% instead of the nominal 2.5%. When monitoring 145 time points this means that we will on average see <span>\(145\cdot 0.07\)</span>=10 false alarms, if the process does not change. This is somewhat problematic, because it means that the behaviour of the detection procedure depends on the underlying <span>\(\pi\)</span>: the user will get way more false alarm at low <span>\(\pi\)</span>‘s than possibly expecting. Altogether, it appears better to use a slightly higher threshold than 2. However, <span>\(k=4\)</span> looks awfully conservative!</p>
<p>All considered procedures dip down to a FAP of 0% for <span>\(\pi\)</span> near 100%, which means no alarms are sounded here. This is related to the fact that if <span>\(U_{t_0}=n_{t_0}\)</span> than because <span>\(p_{t_0} > U_{t_0}\)</span> is required before an alarm will be sounded, no alarm is possible. Furthermore, both the beta-binomial, the binomial variant and the non-parametric procedure have FAPs slightly lower than the nominal 2.5%. This is again related to the discreteness of the problem: It might not be possible to find an integer limit <span>\(U\)</span> such that the CDF at <span>\(U\)</span> is exactly 97.5%, i.e. usually <span>\(F(q_{0.975})>0.975\)</span>. Because we only sound alarms if <span>\(y_{t_0} > U\)</span>, i.e. the probability for this to occur is even smaller, namely, <span>\(1-F(q_{0.975}+1)\)</span>.</p>
<p>Note that in the above simulation study the binomial and beta-binomial models are in advantage, because the model used to simulate data is identical and closely identical, respectively, to how data are simulated. In order to make the simulation more comprehensive we investigate an additional scenario where the marginal distribution are binomial <span>\(\operatorname{Bin}(25, 0.215)\)</span>, but are correlated<a rel="nofollow" href="http://staff.math.su.se/hoehle/blog/2018/10/29/gauss.html#fn3" target="_blank"><sup>3</sup></a>. We simulate variables <span>\(y_t^*\)</span> using an <span>\(AR(1)\)</span> process with parameter <span>\(\rho\)</span>, <span>\(|\rho| &lt; 1\)</span>, i.e. <span>\[<br>
y_t^* | y_{t-1}^* \sim \rho \cdot y_{t-1}^* + \epsilon_t, \quad t=2,3,\ldots,<br>
\]</span> where <span>\(y_1^* \sim N(0,1)\)</span> and <span>\(\epsilon_t \stackrel{\text{iid}}{\sim} N(0,1)\)</span>. These latent variables are then marginally back-transformed to standard uniforms <span>\(u_t \sim U(0,1)\)</span> which are then transformed using the quantile function of the <span>\(\operatorname{Bin}(25, 0.215)\)</span> distribution, i.e.</p>
<p><center><br>
<span>\(y_t\)</span> = <code>qbinom(pnorm(ystar[t]))</code><br>
</center></p>
<p><p>Altogether, this corresponds to a <a rel="nofollow" href="https://stackoverflow.com/questions/10535235/generate-correlated-random-numbers-from-binomial-distributions-in-r#10540234" target="_blank">Gaussian copula</a> approach to generate correlated random variables with a given marginal distribution. The correlation between the <span>\(y_t\)</span> will not be exactly be <span>\(\rho\)</span> due to the discrete nature of the binomial, but will approach <span>\(\rho\)</span> as <span>\(n\)</span> in the binomial becomes large. Figure 3 shows the results for the false alarm probability based on 10,000 Monte Carlo simulations for marginal <span>\(\operatorname{Bin}(25, 0.215)\)</span> distribution and latent <span>\(AR(1)\)</span> one-off-the-diagonal correlation parameter <span>\(\rho\)</span>.</p>
<p><img src="https://i0.wp.com/staff.math.su.se/hoehle/blog/figure/source/2018-10-29-gauss/SIMCORRELATED-1.png?w=456" data-recalc-dims="1"><br>
<br>
<font color="bbbbbb">Figure 3: Equivalent of a false alarm probability by 10,000 Monte Carlo simulation for the algorithms when there is a correlation <span>\(\rho\)</span> on the latent scale, but the marginal mean of all observations is <span>\(\pi=0.215\)</span>. </font></p>
<p><p>We see that the binomial and beta binomial approaches sound too many alarms as the correlation increases. Same goes for the two times standard deviation and the predictive approach. The non-parametric approach appears to behave slightly better.</p>
<h2>Application</h2>
<p>We use the <strong>synthetic acute respiratory infection data</strong> made available as part of the paper’s SySu Excel tool available for <a rel="nofollow" href="https://www.rki.de/DE/Content/Gesundheitsmonitoring/Gesundheitsberichterstattung/GesundAZ/Content/A/Asylsuchende/SynSurv/SynSurv_Tab_gesamt.html" target="_blank">download</a> under a creative common license. In what follows we focus on the time series for the symptom <em>acute respiratory infections</em>. Figure shows the daily proportions 2017-01-01 until 2017-07-20 for all weekdays as vertical bars. Also shown is the upper threshold <span>\(U_t\)</span> for six methods discussed above.</p>
<p><center><br>
<img src="https://i0.wp.com/staff.math.su.se/hoehle/blog/figure/source/2018-10-29-gauss/PLOTALLMONITORING-1.png?w=456" data-recalc-dims="1"><br>
</center><br>
<font color="bbbbbb">Figure 4: Upper bound curves for all detection procedures.</font></p>
<p><p>The correlation between <span>\(p_{t}\)</span> and <span>\(p_{t-1}\)</span> in the time series is 0.04, which could be a sign that the synthetic were artificially generated using an independence assumption.</p>
<p>For all algorithms we see the effect on the upper threshold as spikes enter the baseline values. In particular the non-parametric method, which uses <span>\(d=39\)</span> baseline values, will only sound an alarm during 39 days after time 60, if the proportion is larger than the <span>\(p_{60} = 69.6%\)</span> spike .</p>
<h2>Discussion</h2>
<p>This post discussed how to use statistical process control to monitor a proportion in a syndromic surveillance context. The suitability and performance of Gaussian approximations was discussed: It was shown that the false alarm probability for this approach depends on the level of the considered proportion and that auto-correlation also has a substantial impact on the chart. The investigation in this post were done in order to provide the user of such charts with a guidance on how to choose <span>\(k\)</span>.</p>
<p>Altogether, a full scientific analysis would need a more comprehensive simulation study and likely access to the real data, but the point of this post was to substantiate that statistical problems need a statistical investigation. From the simulation results in this post it appears more prudent to use <span>\(k>2\)</span>, e.g., the upper limit of a 97.5% one-sided prediction interval would be <span>\(k\)</span>=2.22 or <span>\(k\)</span>=3.07 for the upper limit of a 99.5% one-sided prediction interval. Choosing <span>\(k>2\)</span> is also supported by the fact that none of the 204 signals generated by the system were interpreted as an outbreak. A simple fix to avoid confusion could be chop the upper threshold at 100% in the graphics, i.e. to report <span>\(U_t^* = \max(1, U_t)\)</span> for the Gaussian based procedures. Better would be to use the predictive approach and let the user choose <span>\(\alpha\)</span> and thus give the parameter choice a probabilistic interpretation. However, binomial and beta-binomial based approaches provide more stable results over the full range of <span>\(\pi\)</span> and are guaranteed to respect the <span>\([0,1]\)</span> support. In particular the <strong>non-parametric method looks promising</strong> despite being even simpler than the proposed k-sd-system. All in all, addressing trends or other type of auto-correlation as well as previous outbreaks in the baseline appears to be important in order to get a more specific syndromic surveillance system – see Sect. 3.4 of <span data-cites="salmon_etal2016a">Salmon, Schumacher, and Höhle (2016)</span> for how this could look. I invite you to read the <span data-cites="sarma_etal2018">Sarma et al. (2018)</span> paper to form your own impressions.</p>
<h4>Acknowledgments</h4>
<p>The contents of this post were discussed as part of the Statistical Consultancy M.Sc. course at the Department of Mathematics, Stockholm University. I thank Jan-Olov Persson, Rolf Sundberg and the students of the course for their comments, remarks and questions.</p>
<h4>Conflicts of Interest</h4>
<p>I have previously worked for the Robert Koch Institute. Some of the co-authors of the <span data-cites="sarma_etal2018">Sarma et al. (2018)</span> paper are previous colleagues, which I have published together with.</p>
<h2>Literature</h2>
<div>
<div>
<p>Arts, G. R. J., F. P. A. Coolen, and P. van der Laan. 2004. “Nonparametric Predictive Inference in Statistical Process Control.” <em>Quality Technology &amp; Quantitative Management</em> 1 (2): 201–16.</p>
</div>
<div>
<p>Farrington, C.P, N.J. Andrews, A.D. Beale, and M.A. Catchpole. 1996. “A Statistical Algorithm for the Early Detection of Outbreaks of Infectious Disease.” <em>Journal of the Royal Statistical Society, Series A</em> 159: 547–63.</p>
</div>
<div>
<p>Fricker, R. D., B. L. Hegler, and D. A. Dunfee. 2008. “Comparing syndromic surveillance detection methods: EARS’ versus a CUSUM-based methodology.” <em>Stat Med</em> 27 (17): 3407–29.</p>
</div>
<div>
<p>Salmon, M., D. Schumacher, and M. Höhle. 2016. “Monitoring Count Time Series in R: Aberration Detection in Public Health Surveillance.” <em>Journal of Statistical Software</em> 70 (10). doi:<a rel="nofollow" href="https://doi.org/10.18637/jss.v070.i10" target="_blank">10.18637/jss.v070.i10</a>.</p>
</div>
<div>
<p>Sarma, N., A. Ullrich, H. Wilking, S. Ghozzi, A. K. Lindner, C. Weber, A. Holzer, A. Jansen, K. Stark, and S. Vygen-Bonnet. 2018. “Surveillance on speed: Being aware of infectious diseases in migrants mass accommodations – an easy and flexible toolkit for field application of syndromic surveillance, Germany, 2016 to 2017.” <em>Euro Surveill.</em> 23 (40).</p>
</div>
<div>
<p>Young, G. A., and R. L. Smith. 2005. <em>Essentials of Statistical Inference</em>. Cambridge University Press.</p>
</div>
</div>
<section>
<hr>
<ol>
<li>
<p>The method contained two additional parameters: one being the minimum number of cases needed on a particular day to sound an alarm (low-count protection) and a fixed threshold for the proportion beyond which a signal was always created. For the sake of statistical investigation we shall disregard these two features in the analysis of this post.<a rel="nofollow" href="http://staff.math.su.se/hoehle/blog/2018/10/29/gauss.html#fnref1" target="_blank"><img alt="↩" src="https://s.w.org/images/core/emoji/2.4/72x72/21a9.png" class="wp-smiley"></a></p>
</li>
<li>
<p>In the paper d=21 was used, but due to many missing values, e.g., due to weekends, the actual number of observations used was on average 15. We therefore use <span>\(d=15\)</span> in the blog post.<a rel="nofollow" href="http://staff.math.su.se/hoehle/blog/2018/10/29/gauss.html#fnref2" target="_blank"><img alt="↩" src="https://s.w.org/images/core/emoji/2.4/72x72/21a9.png" class="wp-smiley"></a></p>
</li>
<li>
<p>The 21.5% is taken from Table 2 of <span data-cites="sarma_etal2018">Sarma et al. (2018)</span> for acute respiratory infections.<a rel="nofollow" href="http://staff.math.su.se/hoehle/blog/2018/10/29/gauss.html#fnref3" target="_blank"><img alt="↩" src="https://s.w.org/images/core/emoji/2.4/72x72/21a9.png" class="wp-smiley"></a></p>
</li>
</ol>
</section>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://staff.math.su.se/hoehle/blog/2018/10/29/gauss.html"> Theory meets practice...</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/OhV1gRGS3dg" height="1"></a></div>