Report case counts by date of report

report_cases(
  nowcast,
  case_forecast = NULL,
  delay_defs,
  incubation_defs,
  type = "median",
  reporting_effect
)

Arguments

nowcast

A dataframe as produced by nowcast_pipeline

case_forecast

A data.table of case forecasts as produced by epi_measures_pipeline If not supplied the default is not incoperate forecasts.

delay_defs

A data.table that defines the delay distributions (model, parameters and maximum delay for each model). See get_delay_dist for an example of the structure.

incubation_defs

A data.table that defines the incubation distributions (model, parameters and maximum delay for each model). See get_delay_dist for an example of the structure.

type

Character string indicating the method to use to transfrom counts. Supports either "sample" which approximates sampling or "median" would shift by the median of the distribution.

reporting_effect

A data.table giving the weekly reporting effect with the following variables: sample (must be the same as in nowcast), effect (numeric scaling factor for each weekday), day (numeric 1 - 7 (1 = Monday and 7 = Sunday)). If not supplied then no weekly reporting effect is assumed.

Value

A data.table containing the following variables sample, date and cases

Examples

## Define example cases cases <- data.table::as.data.table(EpiSoon::example_obs_cases) cases <- cases[, `:=`(confirm = as.integer(cases), import_status = "local")] ## Define a single report delay distribution delay_defs <- EpiNow::lognorm_dist_def(mean = 5, mean_sd = 1, sd = 3, sd_sd = 1, max_value = 30, samples = 2) ## Define a single incubation period incubation_defs <- EpiNow::lognorm_dist_def(mean = EpiNow::covid_incubation_period[1, ]$mean, mean_sd = EpiNow::covid_incubation_period[1, ]$mean_sd, sd = EpiNow::covid_incubation_period[1, ]$sd, sd_sd = EpiNow::covid_incubation_period[1, ]$sd_sd, max_value = 30, samples = 2) ## Perform a nowcast nowcast <- nowcast_pipeline(reported_cases = cases, target_date = max(cases$date), delay_defs = delay_defs, incubation_defs = incubation_defs) reported_cases <- report_cases(nowcast, delay_defs = delay_defs, incubation_defs = incubation_defs) print(reported_cases)
#> sample sample date cases #> 1: 1 1 2020-01-10 1 #> 2: 1 1 2020-01-11 0 #> 3: 1 1 2020-01-12 0 #> 4: 1 1 2020-01-13 0 #> 5: 1 1 2020-01-14 0 #> --- #> 150: 2 2 2020-03-19 320 #> 151: 2 2 2020-03-20 312 #> 152: 2 2 2020-03-21 328 #> 153: 2 2 2020-03-22 350 #> 154: 2 2 2020-03-23 404