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:
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, spread_r=2, sigma_r=.25, move_R=4, sigma_R=.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.
Metadata
Release files for Eir 0.1.21
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| Eir-0.1.21.tar.gz | 56.5 kB | Without provenance | Details for Eir-0.1.21.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| Eir-0.1.21-py3-none-any.whl | Python 3 | none | any | Details for Eir-0.1.21-py3-none-any.whl |
Total release size: 242.7 kB
Release files / Eir-0.1.21.tar.gz
| Download URL | Eir-0.1.21.tar.gz |
|---|---|
| Size | 56.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c7848883faa39038763ede985a6cb8b9f5baab802d1cf1421394209b71a8d1ae
|
|
BLAKE2b-256 checksum How to use checksums |
6a38469c94b2dd37439e65c85ce14ad6aa4d76eee5f8df11fde94cf633bd9f0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.5.0.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6
|
Release files / Eir-0.1.21-py3-none-any.whl
| Download URL | Eir-0.1.21-py3-none-any.whl |
|---|---|
| Size | 186.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c9d39b2bcfbb661af915ce9abdabdd48ca8dc77d360897cf9171838bab944137
|
|
BLAKE2b-256 checksum How to use checksums |
f7f9c01b90b65bf4259e91ea68ab1c879b8b5204a6eb0810f1ba2f46f81ad969
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.5.0.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6
|
Security for Eir 0.1.21
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.