Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
bmtgoncalves committed Apr 12, 2024
1 parent ea5618f commit 0dd0219
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<center>
<img src="https://raw.githubusercontent.com/DataForScience/epidemik/main/images/epidemik.png" /></center>

# epidemik

Compartmental Epidemic Models in Python
Expand Down Expand Up @@ -33,8 +36,9 @@ Here's a brief high-level overview of the tech stack the `epidemik` package uses

- The model is implemented as a directed multigraph using [networkx](https://networkx.org/)
- Ordinary Differential Equations are numerically integrated using [scipy](https://scipy.org/)
- Random numbers are generated by[numpy](https://numpy.org/)
- Model structure visualizations rely on [matplotlib](https://matplotlib.org/)
- Random numbers are generated by [numpy](https://numpy.org/)
- Model structure visualizations rely on [matplotlib](https://matplotlib.org/)
- Progress bars generated by [tqdm](https://tqdm.github.io/)


<div align="right">[ <a href="#table-of-contents">↑ Back to top ↑</a> ]</div>
Expand All @@ -44,13 +48,17 @@ Here's a brief high-level overview of the tech stack the `epidemik` package uses

## Usage[![](https://raw.githubusercontent.com/DataForScience/epidemik/main/images/pin.svg)](#usage)

`epidemik` provides three main modules, `EpiModel`, `NetworkEpiModel` and `MetaEpiModel`, usually imported directly from the `epidemik` package using
`epidemik` provides three main modules, `EpiModel`, `NetworkEpiModel` and `MetaEpiModel`, usually imported directly from the `epidemik` package using the module name

```python
from epidemik import EpiModel
```

To instanciate a new compartmental model we just need to create a `EpiModel` object and add the relevant transitions:
- __EpiModel__ -e Simple compartmental model in a homogeneously mixed population.
- __NetworkEpiModel__ - Compartmental model on a network where nodes interact only along edges connecting them.
- __MetaEpiModel__ - Meta population model where populations interact with one another along the edges of a network. Each sub-population has it's own internal __EpiModel__ instance.

To instantiate a new compartmental model we just need to create a `EpiModel` object and add the relevant transitions:

```python
beta = 0.2
Expand All @@ -75,7 +83,7 @@ resulting in a simple description of hte model structure.

R0=2.00

or a graphical representation by calling `draw_model`:
or a graphical representation by calling `draw_model()`:

```python
SIR.draw_model()
Expand All @@ -89,7 +97,9 @@ The models value of the Basic Reproductive Number (R~0~) can be determined using
SIR.R0()
```

There are two ways to explore the dynamics of the model, each with it's corresponding method.

To integrate numerically the Ordinary Differential Equations that describe the model dynamics, we can call the `integrate()` method. The first argument is the number of time steps to integrate over and the remaining arguments are the initial populations of each compartment.

```python
N = 10_000
Expand Down Expand Up @@ -145,7 +155,7 @@ Thank you so much for your interest in growing our community!

## License[![](https://raw.githubusercontent.com/DataForScience/epidemik/main/images/pin.svg)](#license)

`epidemik` is free and open-source software licensed under the [MIT License](https://choosealicense.com/licenses/mit/) [2024] - Bruno Gonçalves. Please have a look at the [LICENSE.md](LICENSE) for more details.
`epidemik` is free and open-source software licensed under the [MIT License](https://choosealicense.com/licenses/mit/) [2024] - Bruno Gonçalves, Data For Science, Inc. Please have a look at the [LICENSE.md](LICENSE) for more details.

<div align="right">[ <a href="#table-of-contents">↑ Back to top ↑</a> ]</div>

Binary file modified images/SIR_results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0dd0219

Please sign in to comment.