Biology Reference
In-Depth Information
Monte Carlo
Markov chain
0.8
0.4
0.1
0.0
1
2
3
4
5
6
7
8
g
Figure 12.7
P(T
A
≤
6 5|τ = ∞) as a function of the threshold g computed using both Monte Carlo simulation
and a Markov chain approximation. A dotted line shows the desired value 0.10.
surveillance
is a generalization of the work in Bissell (1984) to time vary-
ing count data CUSUMs.
R> dY <- function(y, mu, log = FALSE, alpha, ...)
dnbinom(y, mu = mu, size = 1/alpha, log = log)
R> pMarkovChain <- sapply(g.grid, function(g){
TA <-LRCUSUM.runlength(mu = t(mu0), mu0 = t(mu0), mu1 = kappa*
t(mu0), c.ARL = g, dfun = dY, n = rep(600, length(mu0)),
alpha = 1/mtheta)
return(tail(TAcdf, n = 1))
})
Here,
dY
is a function specifying the one-parameter PMF used in the likeli-
hood ratio detector; in our case, this is the negative binomial PMF
f(y
t
;μ
t
,α). The
above invocation of the function
LRCUSUM.runlength
derives the distribu-
tion of T
A
when the value of
μ
t
is equal to
μ
0
,t
(that is, in-control) for given specifi-
cations of in-control mean, out-of-control mean, and dispersion parameter. The
function computes the loglikelihood ratio between all possible realizations of
yt
. However, to make computations feasible, an upper limit n is used at each
time point, after which for
y
t
>
n
the probability of
y
t
to occur under
μ
t
is negligi-
ble. Figure 12.7 shows the result and the close agreement with the Monte Carlo
estimation. The Markov chain approximation is considerably faster though.
Returning to the monitoring of the <1 age group from Section 12.4, we would
like to compare the Farrington algorithm with the negative binomial CUSUM.
To do so, we use the in-control model
NegBin
(
μ
0,
t
,
α) for the CUSUM, with
μ
0,
t
as in Figure 12.3 and α estimated by a similar GLM as in Section 5. The out-of-
control mean is again given as
μ
1,
t
=
1.2,
μ
0,
t
. The threshold
g
should be chosen
such that the two algorithms are as comparable as possible with respect to. for
example,
P
(
T
A
≤ 6 5|τ = ∞). A Monte Carlo estimation as just described is per-
formed to determine this probability for the Farrington algorithm. The model
used for this simulation is the above in-control negative binomial model.