algo.farrington.fitGLM {surveillance} | R Documentation |
The function fits a Poisson regression model (GLM) with mean predictor
log mu_t = alpha + beta * w
as specified by the Farrington procedure. That way we are able to predict the value c0. If requested Anscombe residuals are computed based on an initial fit and a 2nd fit is made using weights, where base counts suspected to be caused by earlier outbreaks are downweighted.
algo.farrington.fitGLM(response, wtime, timeTrend = TRUE, reweight = TRUE)
response |
The vector of observed base counts |
wtime |
Vector of week numbers corresponding to response |
timeTrend |
Boolean whether to fit the beta*t or not |
reweight |
Fit twice – 2nd time with Anscombe residuals |
Compute weights from an initial fit and rescale using
Anscombe based residuals as described in the
anscombe.residuals
function.
An object of class GLM with additional fields wtime
,
response
and phi
. If the glm
returns without
convergence NULL
is returned.