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"),
dispersion = Normal(mean = 0, sd = 0.25),
weight = 1,
week_effect = TRUE,
week_length = 7,
scale = Fixed(1),
na = c("missing", "accumulate"),
likelihood = TRUE,
return_likelihood = FALSE,
phi
)
An <obs_opts>
object of observation model settings.
Character string defining the observation model. Options are Negative binomial ("negbin"), the default, and Poisson.
A <dist_spec>
specifying a prior on the dispersion
parameter of the reporting process, used only if familiy
is "negbin".
Internally parameterised such that this parameter is one over the square
root of the phi
parameter for overdispersion of the
negative binomial distribution. # nolint
Defaults to a half-normal distribution with mean of 0 and
standard deviation of 0.25: Normal(mean = 0, sd = 0.25)
. A lower limit of
zero will be enforced automatically.
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.
A <dist_spec>
specifying a prior on the scaling factor to be
applied to map latent infections (convolved to date of report). Defaults
to a fixed value of 1, i.e. no scaling: Fixed(1)
. A lower limit of zero
will be enforced automatically. If setting to a prior distribution and no
overreporting is expected, it might be sensible to set a maximum of 1 via
the max
option when declaring the distribution.
Deprecated; use the fill_missing()
function instead
Logical, defaults to TRUE
. Should the likelihood be
included in the model.
Logical, defaults to FALSE
. Should the likelihood
be returned by the model.
deprecated; use dispersion
instead
# default settings
obs_opts()
# Turn off day of the week effect
obs_opts(week_effect = TRUE)
# Scale reported data
obs_opts(scale = Normal(mean = 0.2, sd = 0.02))
Run the code above in your browser using DataLab