enw_reference: Reference date logit hazard reporting model module

View source: R/model-modules.R

enw_referenceR Documentation

Reference date logit hazard reporting model module

Description

Reference date logit hazard reporting model module

Usage

enw_reference(
  parametric = ~1,
  distribution = c("lognormal", "none", "exponential", "gamma", "loglogistic"),
  non_parametric = ~0,
  data
)

Arguments

parametric

A formula (as implemented in enw_formula()) describing the parametric reference date delay model. This can use features defined by report date as defined in metareference as produced by enw_preprocess_data(). Note that this formula will be applied to all summary statistics of the chosen parametric distribution but each summary parameter will have separate effects. Use ~ 0 to not use a parametric model.

distribution

A character vector describing the parametric delay distribution to use. Current options are: "none", "lognormal", "gamma", "exponential", and "loglogistic", with the default being "lognormal".

non_parametric

A formula (as implemented in enw_formula()) describing the non-parametric logit hazard model. This can use features defined by reference date and by delay. It draws on a linked data.frame using metareference and metadelay as produced by enw_preprocess_data(). When an effect per delay is specified this approximates the cox proportional hazard model in discrete time with a single strata. When used in conjunction with a parametric model it likely makes sense to disable the intercept in order to make the joint model identifiable (i.e. ~ 0 + (1 | delay)).

data

Output from enw_preprocess_data().

Value

A list containing the supplied formulas, data passed into a list describing the models, a data.frame describing the priors used, and a function that takes the output data and priors and returns a function that can be used to sample from a tightened version of the prior distribution.

See Also

Model modules enw_expectation(), enw_fit_opts(), enw_missing(), enw_obs(), enw_report()

Examples

# Parametric model with a lognormal distribution
enw_reference(
 parametric = ~1, distribution = "lognormal",
 data = enw_example("preprocessed")
)

# Non-parametric model with a random effect per delay
enw_reference(
 parametric = ~ 0, non_parametric = ~ 1 + (1 | delay),
 data = enw_example("preprocessed")
)

# Combined parametric and non-parametric model
enw_reference(
 parametric = ~ 1, non_parametric = ~ 0 + (1 | delay_cat),
 data = enw_example("preprocessed")
)

seabbs/epinowcast documentation built on Aug. 28, 2024, 12:31 p.m.