Poisson model for incidence data
Usage
poisson_gam_model.incidence(
d = i_incidence_input,
model_fn = gam_poisson_model_fn(...),
...,
frequency = "1 day",
predict = list(),
ip = i_discrete_ip,
quick = FALSE,
.progress = interactive()
)
Arguments
- model_fn
a function that takes data relating to one time series (e.g. the input data
d
on a group by group basis) and returns a fitted GAM. The default creates a simple poisson model based on count alone (gam_poisson_model_fn()
).- ...
Named arguments passed on to
gam_poisson_model_fn
window
controls the knot spacing in the GAM (if the default)
knots_fn
a function that takes the data as an input and returns a set of integers as time points for GAM knots, for
s(time)
term. The default here provides a roughly equally spaced grid determined bywindow
, by a user supplied function could do anything. The input this function is the raw dataframe of data that will be considered for one model fit. It is guaranteed to have at least atime
andcount
column. It is possible to
- predict
if the GAM model in
model_fn
introduces other variables we need to know what their values should be fixed at for prediction. This is a named list of defaults for variables in the model supplied bymodel_fn
. These defaults will be used in prediction. This may be supplied as part of the model function generator ( e.g.gam_delayed_reporting(...)$predict
). If this is set to exactlyFALSE
no prediction is performed and a list column of fitted GAM models returned instead.