estimate_R_cl {ern} | R Documentation |
Estimate the effective reproduction from clinical report data
Description
Estimate the effective reproduction from clinical report data
Usage
estimate_R_cl(
cl.data,
dist.repdelay,
dist.repfrac,
dist.incub,
dist.gi,
prm.daily = list(method = "linear", popsize = NULL, burn = 500, iter = 2000, chains =
3, prior_R0_shape = 2, prior_R0_rate = 0.6, prior_alpha_shape = 1, prior_alpha_rate =
1, first.agg.period = NULL),
prm.daily.check = list(agg.reldiff.tol = 10),
prm.smooth = list(method = "rollmean", align = "right", window = 7),
prm.R = list(iter = 10, CI = 0.95, window = 7, config.EpiEstim = NULL),
RL.max.iter = 10,
silent = FALSE
)
Arguments
cl.data |
Data frame. Must have variables:
|
dist.repdelay |
List. Parameters for the reporting delay distribution in the same format as returned by |
dist.repfrac |
List. Parameters for the reporting fraction distribution in the same format as returned by |
dist.incub |
List. Parameters for the incubation period distribution in the same format as returned by |
dist.gi |
List. Parameters for the generation interval distribution in the same format as returned by |
prm.daily |
List. Parameters for daily report inference via MCMC. Elements include:
|
prm.daily.check |
List. Parameters for checking aggregated to daily report inference. Elements include:
Set this entire argument to |
prm.smooth |
List. list of smoothing parameters. Parameters should be specified as followed:
Set this entire list to |
prm.R |
List. Settings for the ensemble when calculating Rt. Elements include:
|
RL.max.iter |
Integer. Maximum of iterations for the Richardson-Lucy deconvolution algorithm. |
silent |
Logical. Flag to suppress all output messages, warnings, and progress bars. |
Value
List. Elements include:
-
cl.data
: original aggregated reports signal -
cl.daily
: reports as input for Rt calculation (inferred daily counts, smoothed) -
inferred.agg
: inferred daily reports aggregated on the reporting schedule as input incl.data
-
R
: the effective R estimate (summary from ensemble)
See Also
plot_diagnostic_cl()
estimate_R_ww()
Examples
# -- THIS EXAMPLE TAKES ABOUT 30 SECONDS TO RUN --
# Estimate Rt
## Not run:
# Load SARS-CoV-2 reported cases in Quebec
# during the Summer 2021
dat <- (ern::cl.data
|> dplyr::filter(
pt == "qc",
dplyr::between(date, as.Date("2021-06-01"), as.Date("2021-09-01"))
)
)
# distributions
dist.repdelay = ern::def_dist(
dist = 'gamma',
mean = 5,
mean_sd = 1,
sd = 1,
sd_sd = 0.1,
max = 10
)
dist.repfrac = ern::def_dist(
dist = "unif",
min = 0.1,
max = 0.3
)
dist.incub = ern::def_dist(
dist = "gamma",
mean = 3.49,
mean_sd = 0.1477,
shape = 8.5,
shape_sd = 1.8945,
max = 8
)
dist.gi = ern::def_dist(
dist = "gamma",
mean = 6,
mean_sd = 0.75,
shape = 2.4,
shape_sd = 0.3,
max = 10
)
# settings
prm.daily <- list(
method = "renewal",
popsize = 8.5e6, # Q3 (July 1) 2022 estimate for Quebec
burn = 500,
iter = 500,
chains = 2,
prior_R0_shape = 1.1, prior_R0_rate = 0.6,
prior_alpha_shape = 1, prior_alpha_rate = 1
)
prm.daily.check <- list(
agg.reldiff.tol = 10
)
prm.smooth <- list(
method = "rollmean",
align = "center",
window = 7
)
prm.R <- list(
iter = 20,
CI = 0.95,
window = 7,
config.EpiEstim = NULL
)
x <- estimate_R_cl(
dat,
dist.repdelay,
dist.repfrac,
dist.incub,
dist.gi,
prm.daily,
prm.daily.check,
prm.smooth,
prm.R
)
# Rt estimates
print(x$R)
## End(Not run)