algo.rogerson: Modified CUSUM method as proposed by Rogerson and Yamada...

View source: R/algo_rogerson.R

algo.rogersonR Documentation

Modified CUSUM method as proposed by Rogerson and Yamada (2004)

Description

Modified Poisson CUSUM method that allows for a time-varying in-control parameter \theta_{0,t} as proposed by Rogerson and Yamada (2004). The same approach can be applied to binomial data if distribution="binomial" is specified.

Usage

algo.rogerson(disProgObj, control = list(range = range,
   theta0t = NULL, ARL0 = NULL, s = NULL, hValues = NULL,
   distribution = c("poisson","binomial"), nt = NULL, FIR=FALSE, 
   limit = NULL, digits = 1))

Arguments

disProgObj

object of class disProg that includes a matrix with the observed number of counts

control

list with elements

range

vector of indices in the observed matrix of disProgObj to monitor

theta0t

matrix with in-control parameter, must be specified

ARL0

desired average run length \gamma

s

change to detect, see findH for further details

hValues

matrix with decision intervals h for a sequence of values \theta_{0,t} (in the range of theta0t)

distribution

"poisson" or "binomial"

nt

optional matrix with varying sample sizes for the binomial CUSUM

FIR

a FIR CUSUM with head start h/2 is applied to the data if TRUE, otherwise no head start is used; see details

limit

numeric that determines the procedure after an alarm is given, see details

digits

the reference value and decision interval are rounded to digits decimal places. Defaults to 1 and should correspond to the number of digits used to compute hValues

Details

The CUSUM for a sequence of Poisson or binomial variates x_t is computed as

S_t = \max \{0, S_{t-1} + c_t (x_t- k_t)\} , \, t=1,2,\ldots ,

where S_0=0 and c_t=h/h_t; k_t and h_t are time-varying reference values and decision intervals. An alarm is given at time t if S_t \geq h.

If FIR=TRUE, the CUSUM starts with a head start value S_0=h/2 at time t=0. After an alarm is given, the FIR CUSUM starts again at this head start value.

The procedure after the CUSUM gives an alarm can be determined by limit. Suppose that the CUSUM signals at time t, i.e. S_t \geq h. For numeric values of limit, the CUSUM is bounded above after an alarm is given, i.e. S_t is set to \min\{\code{limit} \cdot h, S_t\} . Using limit=0 corresponds to resetting S_t to zero after an alarm as proposed in the original formulation of the CUSUM. If FIR=TRUE, S_t is reset to h/2 (i.e. limit=h/2 ). If limit=NULL, no resetting occurs after an alarm is given.

Value

Returns an object of class survRes with elements

alarm

indicates whether the CUSUM signaled at time t or not (1 = alarm, 0 = no alarm)

upperbound

CUSUM values S_t

disProgObj

disProg object

control

list with the alarm threshold h and the specified control object

Note

algo.rogerson is a univariate CUSUM method. If the data are available in several regions (i.e. observed is a matrix), multiple univariate CUSUMs are applied to each region.

References

Rogerson, P. A. and Yamada, I. Approaches to Syndromic Surveillance When Data Consist of Small Regional Counts. Morbidity and Mortality Weekly Report, 2004, 53/Supplement, 79-85

See Also

hValues

Examples

# simulate data (seasonal Poisson)
set.seed(123)
t <- 1:300
lambda <- exp(-0.5 + 0.4 * sin(2*pi*t/52) + 0.6 * cos(2*pi*t/52))
data <- sts(observed = rpois(length(lambda), lambda))

# determine a matrix with h values
hVals <- hValues(theta0 = 10:150/100, ARL0=500, s = 1, distr = "poisson")

# convert to legacy "disProg" class and apply modified Poisson CUSUM
disProgObj <- sts2disProg(data)
res <- algo.rogerson(disProgObj, control=c(hVals, list(theta0t=lambda, range=1:300)))
plot(res, xaxis.years = FALSE)

surveillance documentation built on Nov. 4, 2024, 3 a.m.