Skip to content

PyRenew to Pyro

Jeremy Zucker edited this page Nov 11, 2024 · 4 revisions

This wiki page is about strategies for porting PyRenew from jax/numpyro to PyTorch/Pyro.

The motivation for this is to demonstrate the added value that ChiRho can provide for renewal models.

Causality and renewal models

An example of how interventions and counterfactuals are currently implemented with renewal models is given here:

Bhatt, S., Ferguson, N., Flaxman, S., Gandy, A., Mishra, S., & Scott, J. A. (2023). Semi-Mechanistic Bayesian modeling of COVID-19 with Renewal Processes. Journal of the Royal Statistical Society Series A: Statistics in Society. https://doi.org/10.1093/jrsssa/qnad030

In this paper, section 8 Confounding and causality: estimating the effect of interventions, several different questions are investigated:

  • 8.1 Interventions and mobility
  • 8.2 Controlling for mobility
  • 8.3 Causal mediation

The renewal models were implemented in a software package built on Stan called Epidemia.

We would like to port that model to PyRenew, and then implement the causal analyses using ChiRho.

Equivalence of SEIR models and renewal models

The other key paper is the one that shows an equivalence between erlang-distributed SEIR compartmental models and Renewal models:

Champredon, D., Dushoff, J., & Earn, D. J. D. (2018). Equivalence of the Erlang-Distributed SEIR Epidemic Model and the Renewal Equation. SIAM Journal on Applied Mathematics, 78(6), 3258–3278. https://doi.org/10.1137/18M1186411 Most compartmental epidemic models can be represented using the renewal equation. The value of the renewal equation is not widely appreciated in the epidemiological modelling community, perhaps because its equivalence to standard models has not been presented rigorously in nontrivial cases. Here, we provide analytical expressions for the intrinsic generation-interval distribution that must be used in the renewal equation in order to yield epidemic dynamics that are identical to those of the susceptible-exposed-infectious-recovered (SEIR) compartmental model with Erlang-distributed latent and infectious periods. This class of models includes the standard (exponentially distributed) SIR and SEIR models as special cases

We want to also create a renewal model and its equivalent compartmental model and demonstrate each can be compiled into a probabilistic program from the same Petri net representation and will generate equivalent dynamics when simulated.

Tasks

  1. Port the Bhatt model from Epidemia to PyRenew
  2. Generate a Petri net that compiles to a renewal equation and its equivalent SEIR model.
  3. Port PyRenew from Numpyro to Pyro

Clone this wiki locally