Eir
Eir: A Python Package for Epidemic Simulation - Published in JOSS (2021)
Science Score: 93.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 9 DOI reference(s) in README and JOSS metadata -
✓Academic publication links
Links to: joss.theoj.org -
○Committers with academic emails
-
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Repository
Eir is a package that helps researchers simulate the spread of epidemics, mainly focusing on discrete-time Markovian spatial models.
Basic Info
Statistics
- Stars: 35
- Watchers: 4
- Forks: 4
- Open Issues: 0
- Releases: 3
Metadata Files
README.md
Eir: Simulate Epidemics Using Spatial Models in Python

Eir, named after the Norse valkyrie with great medical skill, is an API that allows the user to conduct stochastic simulations of epidemics, primarily using spatial models. With this software, one can simulate not only how epidemics relate to the distances between an infectious and susceptible indivdual, but also how the movement on infectious individuals plays a role in the spread of a disease. Eir also offers a lot of variety to the user, containing many more compartmental models that is present in any of the existing packages similar to Eir, including hospitalizations and vaccinations. Eir's usefulness can clearly be seen in modern day, where simulations and models are constantly used to form policy to combat COVID-19.
Dependencies
Eir depends on numpy, pandas, matplotlib, and multipledispatch.
Installation
One can install Eir via PyPI by running the following command via the command line:
pip install Eir
The dependencies will automatically be installed as well.
Notable Features
Eir offers countless different compartmental models, including: - SIS - SIR - SIRS - SIRD - SIRV - SIRSD - SIRSV - SIRDV - SIRSDV - SEIR - SEIRS - SEIRD - SEIRV - SEIRSD - SEIRSV - SEIRDV - SEIRSDV - ICU models.
Eir also offers these models in different spatial models, some with mobility and some static.
Examples
If one were to model the ICU hospitalizations using the Hub Model, the code could look as follows:
```python from Eir import PeriodicICUV
test = PeriodicICUV(S0=999, E0=0, I0=1, R0=0, V0=0, rho=.3, ioda=.3, gamma=.25, mu=0.007, omega=.14, phi = .42, chi=.15, kappa=.05, eta=.02, spreadr=2, sigmar=.25, moveR=4, sigmaR=.75, side=33, days=31)
test.run()
test.plot()
```
In the above code segment:
S0 : int
The starting number of susceptible individuals in the simulation.
E0: int
The starting number of exposed individuals in the simulation.
I0: int
The starting number of infected individuals in the simulation.
R0: int
The starting number of recovered individuals in the simulation.
V0: int
The starting number of vaccinated individuals in the simulation.
rho: float
The probability of an individual leaving the E compartment.
ioda: float
The probability that, given an individual is leaving the E compartment, he goes to L compartment. The probability of that person going to I compartment is (1-ioda).
gamma: float
The probability of a person in I compartment going to the R compartment
mu: float
The probability of going from I to D, given that the person didn't go from I to R.
phi: float
The probability of going from L compartment to ICU compartment.
chi: float
The probability of going from ICU compartment to R compartment.
omega: float
The probability of going from ICU compartment to D compartment, given that individual didn't go from ICU compartment to R compartment.
kappa: float
The probability of going from R compartment to S compartment.
eta: float
The probability of going from S compartment to V compartment, given that the individual didn't go from S compartment to E compartment.
timeDelay: float
The number of days that vaccine rollout is delayed. If negative or 0, then there is no delay in vaccine rollout. Default value is -1.
spread_r: the mean of the normal distribution of spreading radii that is use to generate spreading radii for each individual in the simulation.
sigma_r: the standard deviation of the normal distribution of spreading radii that is used to generate spreading raddi for each individual in the simulation.
move_R: the mean of the normal distribution of spreading radii that is use to generate movement radii for each individual's periodic movement in the simulation.
sigma_R: the standard deviation of the normal distribution of spreading radii that is use to generate movement radii for each individual's periodic movement in the simulation.
side: the length of the side of the square plane that individuals are confined to during the simulation.
days: the number of days being simulated.
To understand the variables and their meaning for different models, the documentation can be found in the docs folder in this repository, or looking at the docstrings in python. Additionally, if more detailed information about transmission chains and state histories was required, the methods from the Simul_Details class would allow the user to get a more in-depth look at the dynamics of the simulation.
Contributors
The author welcomes and encourages new contributors to help test Eir and add new functionality. If one wishes to contact the author, they may do so by emailing mjacob1002@gmail.com. Response times may vary.
How to Cite
BibTex:
@article{Jacob2021,
doi = {10.21105/joss.03247},
url = {https://doi.org/10.21105/joss.03247},
year = {2021},
publisher = {The Open Journal},
volume = {6},
number = {62},
pages = {3247},
author = {Mathew Jacob},
title = {Eir: A Python Package for Epidemic Simulation},
journal = {Journal of Open Source Software}
}
Citation String:
Jacob, M., (2021). Eir: A Python Package for Epidemic Simulation. Journal of Open Source Software, 6(62), 3247, https://doi.org/10.21105/joss.03247
Owner
- Name: Mathew Jacob
- Login: mjacob1002
- Kind: user
- Repositories: 24
- Profile: https://github.com/mjacob1002
UIUC Computer Science
JOSS Publication
Eir: A Python Package for Epidemic Simulation
Tags
epidemiology super spreaders spatial models stochasticGitHub Events
Total
- Watch event: 3
- Push event: 1
- Pull request event: 2
- Create event: 1
Last Year
- Watch event: 3
- Push event: 1
- Pull request event: 2
- Create event: 1
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Mathew Jacob | m****2@g****m | 350 |
| AidanCooper | a****n@a****k | 9 |
| Eva Xueyao Guo | 5****o | 2 |
| Mathew Jacob | m****2@p****n | 2 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 2
- Total pull requests: 12
- Average time to close issues: 15 days
- Average time to close pull requests: about 1 hour
- Total issue authors: 1
- Total pull request authors: 2
- Average comments per issue: 3.0
- Average comments per pull request: 0.0
- Merged pull requests: 12
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 2
- Average time to close issues: N/A
- Average time to close pull requests: less than a minute
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- joeweaver (2)
Pull Request Authors
- mjacob1002 (11)
- AidanCooper (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 28 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 2
- Total maintainers: 1
pypi.org: eir
Helps model epidemics using spatial models
- Homepage: https://github.com/mjacob1002/Eir
- Documentation: https://eir.readthedocs.io/
- License: MIT
-
Latest release: 0.1.21
published over 4 years ago
Rankings
Maintainers (1)
Dependencies
- matplotlib *
- multipledispatch *
- numpy *
- pandas *
