sample_true_cases_single_onset: Samples a case count arising on a given onset day

View source: R/sampling.R

sample_true_cases_single_onsetR Documentation

Samples a case count arising on a given onset day

Description

The distribution being drawn from 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_true_cases_single_onset(
  observation_df,
  cases_history,
  max_cases,
  Rt,
  day_onset,
  serial_parameters,
  reporting_parameters,
  ndraws = 1,
  maximise = FALSE,
  kappa = NULL,
  is_negative_binomial = FALSE
)

Arguments

observation_df

a two-column data frame with columns 'time_reported' and 'cases_reported'

cases_history

a vector containing history of cases arranged from recent to past

max_cases

maximum possible cases thought to arise on a given day

Rt

effective reproduction number

day_onset

day when case originates

serial_parameters

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

reporting_parameters

named list of 'mean' and 'sd' of gamma distribution characterising the reporting delay distribution

ndraws

number of draws of cases

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 sampled case count arising on a given onset day


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