https://github.com/adrienc21/covid-discrete-stochastic-model
Implementation of a new discrete stochastic model based on Falconet and Jego 2015's article.
https://github.com/adrienc21/covid-discrete-stochastic-model
Science Score: 13.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
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.9%) to scientific vocabulary
Repository
Implementation of a new discrete stochastic model based on Falconet and Jego 2015's article.
Basic Info
- Host: GitHub
- Owner: AdrienC21
- License: mit
- Language: Python
- Default Branch: main
- Size: 630 KB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
COVID19 - A Discrete Stochastic Model
The aim of this project is to implement a new discrete stochastic model in order to make predictions and to estimate some metrics such as R0.
The data have been extracted from the database coronavirus.politologue. It contains information from January 24th 2020 to April 9th 2020.
Model description
Introduction
The model is a modified version of an already existing model first introduced in a paper written by Hugo Falconet and Antoine Jego.
Using a model based on Markov chains has several advantages. For example, such a model is not deterministic which allows us to take into account fluctuations regarding contamination, propagation, incubation time, etc ...
Model
Installation
Clone this repository :
bash
git clone https://github.com/AdrienC21/covid-discrete-stochastic-model.git
Usage
Run a simulation knowing the parameters (alpha, beta, gamma) :
Edit the file simulation_parameters.py with the following information :
python
N = 700 # total population
delta_t = 10 # time step in seconds
alpha = 8.867883874357922e-07 # death rate
beta = 2.9340382291178016e-07 # virus spread speed
gamma = 2.6457998446967257e-07 # cure rate
Run run_simulation.py to obtain the predicted number of infected individuals.
Fit our model to obtain alpha, beta, gamma :
Edit the file optimizer_parameters.py with the following information :
```python N = 70 # total population delta_t = 3600 # in seconds
boundaries for 1 / 1000 * alpha, same for beta & gamma
bounds = tuple([(1., 5000.), (1., 5000.), (1., 5000.)]) maxiter = 50 # maximum number of iterations
multiply our number of infected (more accurate predictions)
scalefactor = 500 country = "France" normalizepop = 1000000 # recommanded : real population number / N ```
Run run_optimizer.py to obtain alpha, beta and gamma using optimization methods.
Documentation
utils.py
extract_data
python
country = "France"
L = extract_data(country)
Extract the data corresponding to one country (number of infected individuals, dead people and cured ones). Sort by date.
calculatetransitionmatrix
python
N = 700 # total population
delta_t = 10 # time step in seconds
alpha = 8.867883874357922e-07 # death rate
beta = 2.9340382291178016e-07 # virus spread speed
gamma = 2.6457998446967257e-07 # cure rate
M = calculate_transition_matrix(alpha, beta, gamma, delta_t, N)
Return the transition matrix of the model.
predict
python
x = np.array([alpha, beta, gamma])
prediction_array = predict(x)
Predict the number of infected people at each timestamp.
f
python
x = np.array([alpha, beta, gamma])
MSE = f(x)
Calculate the MSE (Mean Squared Error) between our predictions and the reality (Y). This is the function we want to minimize in order to obtain the best estimation for our parameters alpha, beta and gamma.
License
Owner
- Name: Adrien Carrel
- Login: AdrienC21
- Kind: user
- Location: London
- Website: https://adriencarrel.com/
- Twitter: adriencarrel_
- Repositories: 3
- Profile: https://github.com/AdrienC21
Quantitative Researcher MSc Imperial College London (Advanced Computing) MEng CentraleSupélec (Applied Mathematics, Diplôme d'ingénieur)
GitHub Events
Total
Last Year
Issues and Pull Requests
Last synced: about 1 year ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0