sample_cases_history: Draws a possible history (or histories) of cases

View source: R/sampling.R

sample_cases_historyR Documentation

Draws a possible history (or histories) of cases

Description

The distribution being drawn from at each onset time t is given by:

p(cases_true_t|data, Rt, reporting_params, serial_params) \propto p(data|cases_true, reporting_params) p(cases_true_t|cases_true_t_1, cases_true_t_2, ..., Rt, serial_params)

Usage

sample_cases_history(
  observation_onset_df,
  max_cases,
  Rt_function,
  serial_parameters,
  reporting_parameters,
  p_gamma_cutoff = 0.99,
  maximise = FALSE,
  kappa = NULL,
  is_negative_binomial = FALSE
)

Arguments

observation_onset_df

a tibble with four columns: time_onset, time_reported, cases_reported, reporting_piece_index

max_cases

maximum possible cases thought to arise on a given day

Rt_function

takes day as an input and outputs an Rt value

serial_parameters

named list of 'mean' and 'sd' of gamma distribution characterising the serial interval distribution

reporting_parameters

a tibble with three columns: reporting_piece_index, mean, sd.

p_gamma_cutoff

a p value (0 <= p <= 1) indicating the threshold above which we deem certainty

maximise

rather than sample a case count give the case count with the maximum probability (by default is FALSE)

kappa

overdispersion parameter

is_negative_binomial

if negative-binomial renewal model specified (defaults to FALSE)

Value

a tibble with an extra cases_estimated column


ben18785/incidenceinflation documentation built on Feb. 8, 2024, 2:36 a.m.