run_backnow {WhiteLabRt}R Documentation

Run Back Calculation and Estimate Reproduction Numbers

Description

This function performs a back-calculation based on provided epidemic case count data, estimating the time distribution of infections and reproduction numbers (r(t)). It utilizes extensive input checks and parameter validation to ensure robust model execution.

Usage

run_backnow(
  input,
  sip,
  NB_maxdelay = as.integer(20),
  window_size = as.integer(7),
  ...
)

Arguments

input

A 'lineList' data.frame from create_linelist or convert_to_linelist.

sip

Vector of numeric values specifying the serial interval probabilities.

NB_maxdelay

Integer, the maximum delay for the negative binomial distribution used in modeling.

window_size

Integer, the number of days of the R(t) averaging window.

...

Additional arguments passed to rstan::sampling()

Details

The function ensures input data is of the correct class and processes it accordingly. It handles different input classes by either converting caseCounts to lineList or directly using lineList. The function stops with an error if the input doesn't meet expected standards. It performs simulations to estimate both the back-calculation of initial infections and reproduction numbers over time, while checking and adjusting for potential NA values and ensuring that all conditions for the model parameters are met. Output includes estimates of initial infections and reproduction numbers along with diagnostic statistics.

Value

an object of class backnow

Examples


data("sample_onset_dates")
data("sample_report_dates")
line_list <- create_linelist(sample_report_dates, sample_onset_dates)
sip <- si(14, 4.29, 1.18)
results <- run_backnow(
  line_list,
  sip = sip, chains = 1)


[Package WhiteLabRt version 1.0.1 Index]