Code Monkey home page Code Monkey logo

dbstan's Introduction

covidestim

Real-time estimates of the true size and trajectory of local COVID-19 epidemics are key metrics to guide policy responses. covidestim is a Bayesian nowcasting approach that explicitly accounts for reporting delays and secular changes in case ascertainment to generate real-time estimates of COVID-19 epidemiology on the basis of reported cases and hospitalizations. Using this approach, we can estimate time trends for a number of important outcomes:

  • Infections (including infections that were never diagnosed)
  • Symptomatic cases
  • Deaths
  • Effective reproduction number (Rt)
  • ...and more

The covidestim package contains all you need to reproduce our work, but it's really targeted at users who want to try running our model on their own data. As the package allows for different kinds of input data, custom priors, and two different fitting algorithms, covidestim is appropriate for:

  • Efficient real-time estimation of key timeseries at the U.S. state- and county-level (these results are available on covidestim.org)

  • Retrospective modeling of a specific geographic area for which you have special insight. For example, covidestim can help you model a county where you happen to have line-list case and death data by date of occurrence, as well as clinical data informing your belief about the rates at which patients transition from symptomatic to severe (hospitalizable), and from severe to dead.

  • Exploratory modeling of non-U.S. geographies. covidestim's extensive customizability allows you to leverage beliefs about delay structures, case ascertainment, and more in order to set up a model tailored to your epidemiologic setting.

covidestim provides a well-documented interface for all phases of the modeling process: adding input data, specifying priors, running the model, producing summary timeseries and graphs.

Installation

# Currently, Covidestim is not available on CRAN
# install.packages("covidestim")

# Install the development version from GitHub. This requires that the
# 'devtools' package be installed.
if (!require("devtools")) {
  install.packages("devtools")
}
devtools::install_github("covidestim/covidestim")

rstan, covidestim's key dependency, has a dependency on Google's V8 JS library. V8 often proves troublesome to install. If you experience problems, see this GitHub issue for solutions. Or, just use our Docker container, linked below.

Usage

library(covidestim)

# Set up a model on 31 weeks of Connecticut data, starting December 2, 2021.
cfg <- covidestim(nweeks = 31, region = 'Connecticut', pop_size = get_pop('Connecticut')) +
  input_cases(example_ct_data('cases')) +
  input_deaths(example_ct_data('deaths')) + 
  input_boost(example_ct_data('boost')) +
  input_hosp(example_ct_data('hospi')) 

result <- run(cfg)
resOptimizer <- runOptimizer(cfg)

# Get a data.frame of all timeseries outcomes, and some overview plots
resultSummary <- summary(result)
resultGraphs  <- viz(result)

Changelog

covidestim has been under active development since March 2020. In that time, we have made large structural changes to the core model, added and removed data sources, tweaked priors, added a new fitting method, and more. We are constantly working to provide an implementation that is consistent with the best available evidence on the epidemiology of COVID-19. To that end, the master branch generally sees a merge every 1-3 months. While we do not currently use a versioning system to catalogue these changes, we maintain a detailed history of major changes here.

Resources

dbstan's People

Contributors

marcusrussi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.