CDCgov / multisignal-epi-inference

Python package for statistical inference and forecast of epi models using multiple signals
https://cdcgov.github.io/multisignal-epi-inference/
10 stars 1 forks source link

Class for `RandomVariable`s based on `numpyro.distributions` #126

Closed damonbayer closed 1 month ago

damonbayer commented 1 month ago

Goal

We should be able to conveniently create new RandomVariables based on numpyro.distributions.

Context

Right now, there are several places where we have repeated code to create RandomVariables based on numpyro.distributions.

For example, the Infections0 class and the InfectHospRate class are nearly identical and contain duplicative code.

Instead, we should be able to create any RandomVariable based on a numpyro.distributions via something like DistributionalRV(name: str, dist: dist.Distribution).