Learn R Programming

epidemia

The epidemia package allows researchers to flexibly specify and fit Bayesian epidemiological models in the style of Flaxman et al. (2020). The package leverages R’s formula interface to parameterize the time-varying reproduction rate as a function of covariates. Multiple populations can be modeled simultaneously with hierarchical models. The design of the package has been inspired by, and has borrowed from, rstanarm (Goodrich et al. 2020). epidemia uses rstan (Stan Development Team 2020) as the backend for fitting models.

Disclaimer

This is an early beta release of the package. As a beta release, there will be regular updates with additional features and more extensive testing. Any feedback is greatly appreciated

  • in particular if you find bugs, find the documentation unclear, or

have feature requests, please report them here.

Package Website

To get started, please see the package website, where you can find installation instructions, function documentation, and vignettes.

Copy Link

Version

Install

install.packages('epidemia')

Monthly Downloads

11

Version

1.0.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

James Scott

Last Published

October 25th, 2021

Functions in epidemia (1.0.0)

epim

Fit a Bayesian epidemiological model with epidemia
epidemia-package

Flexible Epidemic Modeling with epidemia
EuropeCovid

Covid-19 data for European countries
epiinf

Model Latent Infections
as.matrix.epimodel

Extract posterior samples
all_obs_types

Get a list of all observation types used in a model
epimodel-objects

Fitted Epidemiological Model Objects
epiobs

Define Observational Models
EuropeCovid2

Covid-19 data for European countries
EnglandNewCases

Covid-19 Case Counts for England
model.frame.epimodel

hexp

A hierarchical model for seeded infections
get_x

Extract X or Z from an epimodel object
plot_rt

Plot time-varying reproduction rates
posterior_coverage

Coverage of posterior credible intervals
ngrps.mixed

Returns the levels for each grouping factor in the fitted object
evaluate_forecast

Posterior model evaluations
plot_obs

Plot posterior predictive distributions
epirt

Model Reproduction Rates
plot_metrics

Plot CRPS, Median/Mean Absolute Error
posterior_infections

Generic function for getting posterior draws of daily infections over time
plot.epimodel

Plot method for epimodel objects
pairs.epimodel

Pairs method for epimodel objects
print.prior_summary_reg.epimodel

Print method for prior_summary_reg.epimodel objects
prior_summary.epimodel

Returns a summary of the prior distributions used
posterior_rt

Generic function for getting posterior draws of the time-varying reproduction rates
plot_infectious

Plot total infectiousness over time.
summary.epimodel

Summary method for epimodel objects
formula.epimodel

Formula method for epimodel objects
posterior_linpred

Gives the posterior linear predictor for the reproduction numbers Will be extended for observations in future versions
posterior_infectious

Generic function for getting posterior draws of total infectiousness over time
posterior_latent

Generic function for getting posterior draws of a specified latent sequence
reexports

Objects exported from other packages
print.epimodel

Print fitted model details
rw

Adds random walks with independent Gaussian steps to the parameterization of the time-varying reproduction number.
terms.epimodel

Terms method for epimodel objects
posterior_sample_size.epimodel

Plotting the posterior linear predictor for R or ascertainment rates
get_samps

Retrieve final states from sampled Markov chains
posterior_sample_size

Get posterior sample size from a fitted model
print.prior_summary.epimodel

Print method for prior_summary.epimodel objects
terms_rw

Finds random walk terms in a formula object
plot_infections

Plot latent infections
posterior_metrics

CRPS, Mean Absolute Error, Median Absolute Error
plot_coverage

Plot coverage probability of posterior credible intervals
posterior_predict.epimodel

Draws samples from the posterior predictive distribution of the observations
scaled_logit

Represents a 'scaled' logit link
shifted_gamma

A shifted gamma prior