estimate_R_ww {ern}R Documentation

Estimate the effective reproduction from wastewater concentration data.

Description

Estimate the effective reproduction from wastewater concentration data.

Usage

estimate_R_ww(
  ww.conc,
  dist.fec,
  dist.gi,
  scaling.factor = 1,
  prm.smooth = list(window = 14, align = "center", method = "loess", span = 0.2),
  prm.R = list(iter = 10, CI = 0.95, window = 7, config.EpiEstim = NULL),
  silent = FALSE,
  RL.max.iter = 9
)

Arguments

ww.conc

Data frame. Must have variables:

  • date: calendar date of wastewater collection

  • value: pathogen concentration

dist.fec

List. Parameters for the fecal shedding distribution in the same format as returned by def_dist().

dist.gi

List. Parameters for the generation interval distribution in the same format as returned by def_dist().

scaling.factor

Numeric. Scaling from wastewater concentration to prevalence. This value may be assumed or independently calibrated to data.

prm.smooth

List. list of smoothing parameters. Parameters should be specified as followed:

  • method: smoothing method, either 'rollmean' (rolling mean) or 'loess' (LOESS smoothing via stats::loess())

  • window: for ⁠method = 'rollmean⁠ only; width of smoothing window in days

  • align: for ⁠method = 'rollmean⁠ only; smoothing alignment, either 'center', 'left', 'right'

  • span: for method = 'loess' only; smoothing span (see the documentation for stats::loess() for details)

  • floor: optional call for wastewater concentration smoothing with method = 'loess' only; user defined minimum smoothing concentration

Set this entire list to NULL to turn off smoothing

prm.R

List. Settings for the ensemble when calculating Rt. Elements include:

  • iter: Integer. Number of iterations for the Rt ensemble

  • CI: Numeric between 0 and 1. Confidence interval width for Rt estimates after sampling uncertain distributions.

  • window: Integer. Number of days defining the window of data used by EpiEstim to estimate Rt. If NULL, will default to 7.

  • config.EpiEstim: (optional) configuration for EpiEstim defined via EpiEstim::make_config(). If NULL, will use default config from EpiEstim.

silent

Logical. Flag to suppress all output messages, warnings, and progress bars.

RL.max.iter

Integer. Maximum of iterations for the Richardson-Lucy deconvolution algorithm.

Value

List. Elements include:

See Also

plot_diagnostic_ww() estimate_R_cl()

Examples


 # Load data of viral concentration in wastewater
data("ww.data")

# Run the estimation of Rt based on the wastewater data
x = estimate_R_ww(
  ww.conc  = ww.data,
  dist.fec = ern::def_dist(
    dist = "gamma",
    mean = 12.90215,
    mean_sd = 1.136829,
    shape = 1.759937,
    shape_sd = 0.2665988,
    max = 33
    ),
  dist.gi  = ern::def_dist(
    dist     = "gamma",
    mean     = 6.84,
    mean_sd  = 0.7486,
    shape    = 2.39,
    shape_sd = 0.3573,
    max      = 15
    ), 
  silent   = TRUE
)

# Rt estimates
head(x$R)

# inferred daily incidence
head(x$inc)



[Package ern version 2.0.0 Index]