Skip to content

epiforecasts/epinow2cast

epinow2cast: EpiNow2 powered by epinowcast

This is an experimental rewrite of EpiNow2 that replaces all internal Stan models with calls to the epinowcast package. It is not yet released and is under active development. See the feature status below.

What is this?

{epinow2cast} provides the familiar EpiNow2 interface (estimate_infections(), epinow(), regional_epinow()) but delegates all Bayesian inference to {epinowcast}. This eliminates ~9,000 lines of Stan code from EpiNow2 and unifies the two packages under a single computational backend.

Feature status

Feature Status Notes
estimate_infections() Working Renewal equation via epinowcast
estimate_truncation() Working Requires epinowcast PR #756
simulate_infections() Working Pure R implementation
epinow() Working
regional_epinow() Working
get_samples() Working R, infections, growth_rate, reported_cases
get_predictions() Working summary, sample, quantile formats
get_parameters() Working Returns generation time and delays
summary() / plot() Working
Random walk on Rt Working rt_opts(rw = 7) for weekly
Day-of-week effects Working obs_opts(week_effect = TRUE)
Forecasting Working forecast_opts(horizon = N)
Poisson / NegBin Working obs_opts(family = ...)
Reporting delays Working Via latent_reporting_delay
Gaussian process Removed Use rt_opts(rw = ...) instead
Back-calculation Removed
Population depletion Removed
estimate_secondary() Removed Use epinowcast directly
forecast_infections() Removed Use forecast_opts() in estimate_infections()
rstan backend Removed cmdstanr only (via epinowcast)

Installation

This package is not on CRAN. Install from this repository:

# install.packages("pak")
pak::pkg_install("sbfnk/epinow2cast@epinowcast-backend")

Requires cmdstanr and a working CmdStan installation. See the cmdstanr documentation for setup instructions.

Resources

Getting Started

The Getting Started vignette (see vignette("EpiNow2")) is your quickest entry point to the package. It provides a quick run through of the two main functions in the package and how to set up them up. It also discusses how to summarise and visualise the results after running the models.

More broadly, users can also learn the details of estimating delay distributions, nowcasting, and forecasting in a structured way through the free and open short-course, “Nowcasting and forecasting infectious disease dynamics”, developed by some authors of this package.

Package website

The package has two websites: one for the stable release version on CRAN, and another for the version in development. These two provide various resources for learning about the package, including the function reference, details about each model (model definition), workflows for each model (usage), and case studies or literature of applications of the package. However, the development website may contain experimental features and information not yet available in the stable release.

End-to-end workflows

The workflow vignette (see vignette("estimate_infections_workflow")) provides guidance on the end-to-end process of estimating reproduction numbers and performing short-term forecasts for a disease spreading in a

Model definitions

In different vignettes we provide the mathematical definition of each model. For example, the model definition vignette for estimate_infections() can be found in vignette("estimate_infections").

Example implementations

A simple example of using the package to estimate a national Rt for Covid-19 can be found here.

Contributing

We welcome all contributions. If you have identified an issue with the package, you can file an issue here. We also welcome additions and extensions to the underlying model either in the form of options or improvements. If you wish to contribute in any form, please follow the package contributing guide.

Contributors

All contributions to this project are gratefully acknowledged using the allcontributors package following the allcontributors specification. Contributions of any kind are welcome!

Code

seabbs, sbfnk, jamesmbaazam, joeHickson, hsbadr, pitmonticone, actions-user, ellisp, kaitejohnson, jdmunday, pearsonca, Bisaloo, JAllen42, adamkucharski, adrian-lison, avehtari, andrjohns, claude, jcken95, LloydChapman, medewitt, nikosbosse, sophiemeakin, zsusswein

Issue Authors

raulfernandezn, pcarbo, johnaponte, sophie-schiller, munozedg, kathsherratt, yungwai, kgostic, fkrauer, philturk, krageth, tony352, username-rp, HAKGH, AndrewRiceMGW, brynhayder, RichardMN, andrybicio, rhamoonga, furqan915, MFZaini1984, fabsig, affans, GauriSaran, davidvilanova, jrcpulliam, dajmcdon, joshwlambert, avallecam, athowes, lorenzwalthert, nlinton, martinamcm, jonathonmellor, TimTaylor, ciaramccarthy1, SamuelBrand1, damonbayer, valentinedwv, coderabbitai, HenrikBengtsson, bob-carpenter

Issue Contributors

jhellewell14, thlytras, LizaHadley, ntorresd, micahwiesner67, paigemiller, WardBrian

About

No description, website, or topics provided.

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors