Description Usage Arguments Value
estimate_rt()
applies the approach of Cori et al (2013) to estimate
a gamma-distributed reproduction number. It implements additional
pre-processing to handle outliers and seasonality, and it smooths the data
before computing Rt, rather than during the estimate. By default,
it also corrects the portion of the smooth conditional on future data using
rolling cross-validation and geometrically-weighted bootstraps based on the
residuals for each future-conditional time point. Bootstrap weights are
calculated using a geometric sequence with the first-order autoregressive
coefficient as the discount factor.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | estimate_rt(
.data,
.collection_date = "collection_date",
.report_date = "report_date",
serial_interval_mean = 6,
serial_interval_sd = 4.17,
start_date = "2020-03-12",
trend = "30 days",
period = "7 days",
delay_period = "14 days",
pct_reported = 0.9,
cutoff = 0.05,
plot_anomalies = FALSE,
boost = TRUE
)
|
.data |
A data frame containing one incident observation per row |
.collection_date |
|
.report_date |
|
serial_interval_mean |
The average number of days between infection of a primary case and a secondary case |
serial_interval_sd |
The standard deviation of the number of days between infection of a primary case and a secondary case |
start_date |
The start date of the epidemic;
defaults to |
trend |
The length of time to use in trend decomposition; can be a
time-based definition (e.g. "1 month") or an integer number of days. If
|
period |
The length of time to use in seasonal decomposition; can be a
time-based definition (e.g. "1 week") or an integer number of days. If
|
delay_period |
The length of time to use in calculating reporting
delay; can be a time-based definition (e.g. "2 weeks") or an integer number
of days. If |
pct_reported |
The percent of total cases reported before considering
a collection date to be fully observed. It is not recommended to set this
to |
cutoff |
The cutoff value for anomaly detection; controls both the maximum percentage of data points that may be considered anomalies, as well as the critical value for the Generalized Extreme Studentized Deviate test used to detect the anomalies. Can be interpreted as the desired maximum probability that an individual data point is labeled an anomaly. |
plot_anomalies |
Should anomalies be plotted for visual inspection? If
|
boost |
Should the error in future-conditional estimates be estimated and accounted for? |
A tibble
with columns .t
, .pred
(the median), .pred_lower
(the lower bound of the 95% credible interval), .pred_upper
(the upper bound of the 95% credible interval), .mean
(the average), and
.cv
(the coefficient of variation)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.