Check our preprint here.
The purpose of this repository is to generate the state of the epidemic in Finland at any given day and then use the generated state to run simulations with different vaccination strategies and obtain some metrics/observables considerating different scenarios.
Organization of the repository:
fetch_data.py
: API calls and parsing of the data to construct the state of the epidemic.initial_states.py
: Uses the functions infetch_data.py
to generate CSV files with the epidemic state.forward_integration.py
: Code to calculate the parameters of the model and run the forward simulations with a vaccination strategy.experiments.py
: Runs experiments using different basic reproduction numbers (R_0
), mobility values (tau) and vaccination strategies. The experiments run in parallel calling the functions defined inforward_integration.py
.compare_vaccination_strategies.ipynb
: Plots the results of the experiments per time, age and ERVA.env_var.py
: This file stores several static parameters to run the experiments, parameters of the epidemic and as some other parameters to construct the initial states.data_for_paper.ipynb
: Reads the information stored in the CSV files generated byinitial_states.py
and gets the data that is included in the paper.optimized_vaccination.py
: Use Sequential Least Squares Programming (SLSQP) to obtain an optimized vaccination strategy.
Data:
out/*.npy
: Optimal vaccination strategies per basic reproduction number (R_0
). Outputs from the scriptoptimized_vaccination.py
.out/epidemic_finaland_*.csv
: CSV files with the state of the epidemic.stats/erva_population_age_2020.csv
: The population by ERVA and age group in 2020. In this file the age groups are of 5 years, it is aggregated to get the final counts for each specific number of age groups (in this case 9).
Developed and tested under
Python 3.7.4
- (Optional) It is recommended to create a virtual environment.
- Install the packages dependencies.
pip install -r requirements.txt
To generate the initial state of epidemic for 9 age groups
python initial_states.py
The result of this script will be the CSV files out/epidemic_finaland_*.csv
.
To get the optimal vaccination strategies using SLSQP, different R
and tau
values.
python optimized_vaccination.py
The results of the optimized vaccination strategy as well as the comparison of it with with different vaccination strategies can be found in the notebook
compare_vaccination_strategies.ipynb
In the notebook several experiments are ran and plotted. The notebook uses the file experiments.py
to produce the results.