Defines a list specifying the structure of the observation
model. Custom settings can be supplied which override the defaults.
obs_opts(
family = c("negbin", "poisson"),
phi = list(mean = 0, sd = 0.25),
weight = 1,
week_effect = TRUE,
week_length = 7,
scale = 1,
na = c("missing", "accumulate"),
likelihood = TRUE,
return_likelihood = FALSE
)
An <obs_opts>
object of observation model settings.
Character string defining the observation model. Options are Negative binomial ("negbin"), the default, and Poisson.
Overdispersion parameter of the reporting process, used only if
familiy
is "negbin". Can be supplied either as a single numeric value
(fixed overdispersion) or a list with numeric elements mean (mean
) and
standard deviation (sd
) defining a normally distributed prior.
Internally parameterised such that the overdispersion is one over the
square of this prior overdispersion. Defaults to a list with elements
mean = 0
and sd = 0.25
.
Numeric, defaults to 1. Weight to give the observed data in the log density.
Logical defaulting to TRUE
. Should a day of the week
effect be used in the observation model.
Numeric assumed length of the week in days, defaulting to 7 days. This can be modified if data aggregated over a period other than a week or if data has a non-weekly periodicity.
Scaling factor to be applied to map latent infections (convolved
to date of report). Can be supplied either as a single numeric value (fixed
scale) or a list with numeric elements mean (mean
) and standard deviation
(sd
) defining a normally distributed scaling factor. Defaults to 1, i.e.
no scaling.
Character. Options are "missing" (the default) and "accumulate". This determines how NA values in the data are interpreted. If set to "missing", any NA values in the observation data set will be interpreted as missing and skipped in the likelihood. If set to "accumulate", modelled observations will be accumulated and added to the next non-NA data point. This can be used to model incidence data that is reported at less than daily intervals. If set to "accumulate", the first data point is not included in the likelihood but used only to reset modelled observations to zero.
Logical, defaults to TRUE
. Should the likelihood be
included in the model.
Logical, defaults to FALSE
. Should the likelihood
be returned by the model.
# default settings
obs_opts()
# Turn off day of the week effect
obs_opts(week_effect = TRUE)
# Scale reported data
obs_opts(scale = list(mean = 0.2, sd = 0.02))
Run the code above in your browser using DataLab