obs_opts | R Documentation |
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
)
family |
Character string defining the observation model. Options are Negative binomial ("negbin"), the default, and Poisson. |
phi |
Overdispersion parameter of the reporting process, used only if
|
weight |
Numeric, defaults to 1. Weight to give the observed data in the log density. |
week_effect |
Logical defaulting to |
week_length |
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. |
scale |
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 ( |
na |
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. |
likelihood |
Logical, defaults to |
return_likelihood |
Logical, defaults to |
An <obs_opts>
object of observation model settings.
# 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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.