Coder Social home page Coder Social logo

sempwn / cr0eso Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 2.0 367.35 MB

Bayesian SEIR model fitting to multiple facility outbreaks

Home Page: https://sempwn.github.io/cr0eso/index.html

License: MIT License

R 80.41% C++ 0.10% Stan 19.49%
r0-estimation outbreaks covid-19 bayesian-inference

cr0eso's Issues

str_remove_all not found in method

Error: Problem with `mutate()` input `location`.
x could not find function "str_remove_all"
i Input `location` is `str_remove_all(location, "V")`.

Can't find function n()

`mutate()` input `rincidence`.
x could not find function "n"
i Input `rincidence` is `rpois(n(), incidence)`.

Add covariates to model

For more flexible modeling, would be useful to include a covariate matrix for locations and predictors that can be used to explain variance of R0 for each location.

For example, we may have difference facility types we would want to use to adjust R0 estimates, or type of ventilation, age of building, density etc.

Add data checks

  • Before seir_model_fit runs add in some basic data checks like whether there are missing values (there shouldn't be).
  • If there are a large number of zero cases which should throw a warning that may lead to convergence issues.
  • Add in functionality to plot data before model fitting.

Switch to using tidybayes

Stan code should get updated so that it generates posterior predictive distribution for cases, as well as for the counterfactual where there is no intervention.

With these generated posteriors, can then use the tidybayes package to extract and plot. This can also help to tidy up the hom_plot_incidence_by_location() function.

Counterfactual modelling creation

Create function to use rstan fit object and run a counterfactual scenario for each location where no intervention takes place.

Output should be a class with a print and plot function and provide outputs in tidy format.

Add missing imports

See no visible global function definition warnings on R CMD check.

Also, I wouldn't import the tidyverse, just the specific packages you need.

Don't forget the stats imports: "quantile", "rpois"

create publication table

Create function that has a list of model outputs as a list and returns a table of marginal posterior medians and 95% CrI for R0, zeta, and critical time

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.