Learn R Programming

ern (version 2.1.2)

Effective Reproduction Number Estimation

Description

Estimate the effective reproduction number from wastewater and clinical data sources.

Copy Link

Version

Install

install.packages('ern')

Monthly Downloads

211

Version

2.1.2

License

MIT + file LICENSE

Maintainer

David Champredon

Last Published

January 16th, 2025

Functions in ern (2.1.2)

check_cl.input_format

Check the format of input clinical data
attach_t_agg

Attach time index (number of days) column. Exclude first day since we don't necessarily know over which period of time that data was aggregated
estimate_R_cl_single

A single realization of the Rt estimate
cl.data

Sample of aggregated clinical reports
estimate_R_cl_rep

Ensemble estimate of Rt
correct_underreporting

Correct underreporting by scaling up
check_df.input_daily

Check if input data is already daily
deconv

Wrapper for deconvolution with a given distribution
draw_from_gamma

Draw from gamma for a parameter specified in a distribution family list.
linear_int_daily

Daily incidence from linear interpolation
inc2R_one_iter

Helper function. Converts wastewater to Rt after sampling one fecal shedding and one generation interval distribution.
estimate_R_cl

Estimate the effective reproduction from clinical report data
incidence_to_R

Estimate Rt using EpiEstim
na_to_0

Replace NAs with 0s in vector
deconv_ww_inc

Deconvoluting Wastewater Data to Incidence
deconvolution_RL

Richardson-Lucy Deconvolution.
fit_jags_aggreg

Fit JAGS model to aggregated data
plot_diagnostic_cl

Diagnostic plot for R estimation from clinical report data
get_discrete_dist

Get a discretized, truncated version of a distribution
reports_to_incidence

Infer incidence from reports via a series of deconvolutions
plot_traces

Plot MCMC traces
def_dist

Define a family of distributions.
sample_from_dist

Sample from a distribution (currently only implemented for a uniform distribution)
check_prm.daily

Check parameters for daily data inference
plot_dist

Plot a distribution
check_prm.daily.check

Check parameters for daily data inference check
sample_post_ee

Helper function - sample from EpiEstim's R posterior distribution
plot_diagnostic_ww

Diagnostic plot for R estimation from wastewater data
summarise_by_date_iters

Summarise observations by date for raw iterations from an ensemble
plot_gelman_rubin

Plot the Gelman Rubin statistic for all parameters.
estimate_R_ww

Estimate the effective reproduction from wastewater concentration data.
check_prm.smooth

Check parameters for smoothing
get_realizations

Retrieve realizations for aggregated to daily inference
get_use_dates

Get dates for which to use (trust) inferred daily reports
summarise_report_counts

Summarise daily inferred reports based on original reporting schedule and calculate error
extract_mcmc_values

Extract MCMC chains from a JAGS object
smooth_cl

Smooth realizations from estimating daily reports
smooth_ww

Smooth wastewater data (using pre-processed wastewater)
reshape_fit_jags

Reshape JAGS fit object
sample_a_dist

Sample parameters for a single distribution from a family of distributions, assuming parameters come from a Gamma distribution.
ww.data

Sample of wastewater concentration
summary_postsamples

Helper function that summarises posterior samples of Rt from EpiEstim
attach_t

Attach internal time index column
check_dist

Check distributions
check_for_deconv

Check that deconvolution inputs are compatible
agg_to_daily

Infer daily counts from aggregates
attach_startdate_agg

Attach start date from first observation for aggregated data from time (day number)
check_prm.R

Check parameters for Rt calculation