backimpute_I: Impute unobserved generations of infection

View source: R/backimputation.R

backimpute_IR Documentation

Impute unobserved generations of infection

Description

This function imputes incidence prior the first date of reported cases to address early bias in R_t estimates. A simple linear model is fitted on shifted, logged-incidence cases, based on an initial observation window. Log-incidence is computed as log(local + 0.5) to avoid -infinite logs. Currently, no cases are assumed to be imported.

Usage

backimpute_I(incid, window_b)

Arguments

incid

the raw, reported incidence cases.

window_b

length of the observation window to fit the exponential growth model for back-imputation

Value

an incidence data.frame, combining back-imputed cases for a maximum of 100 time points (with rows indexed by a negative integer rowname) and cases (with rows #' indexed by a non-negative integer)

Examples

incid_all <- ceiling(exp(.3 * 0:20))
incid_trunc <- tail(incid_all, 10)
x <- backimpute_I(incid=incid_trunc, window_b=6)
idx <- as.integer(rownames(x)) > -10
x[idx, ]$local
incid_all


annecori/EpiEstim documentation built on Sept. 7, 2024, 7:34 p.m.