# YYG / covid19-projections.com SEIR Simulator
We present the underlying SEIR model simulator behind the YYG / [covid19-projections.com](https://covid19-projections.com) model, as well a summarized set of parameters that helped generate the projections.
If your system supports Python, you can generate your own simulations in under 5 minutes. No prior Python experience is needed to run this tool. [Get started here](#setup).
![SEIR Model Diagram](https://upload.wikimedia.org/wikipedia/commons/3/3d/SEIR.PNG)
## Table of Contents
* [Introduction](#introduction)
* [Dependencies](#dependencies)
* [Setup](#setup)
* [Usage](#usage)
* [Basic Usage](#basic-usage)
* [Advanced Usage](#advanced-usage)
* [Setting Parameters](#setting-parameters)
* [Changing Parameters](#changing-parameters)
* [Using Your Own Parameters](#using-your-own-parameters)
* [Parameters](#parameters)
* [Updates](#updates)
* [Question?](#question-bug-feedback-suggestion)
* [Other Repositories](#other-repositories)
## Introduction
To begin, we want to be clear that this is **not** the full model used by [covid19-projections.com](https://covid19-projections.com). This is the underlying SEIR model without the machine learning layer to learn the parameters. In fact, **this simulator does not use any published data**: it only simulates infections, hospitalizations, and deaths given a single set of parameters. As a result, **this tool is meant to generate simulations, not projections**.
Unlike traditional SEIR models, our simulator does not use differential equations - we use an abstracted state machine that tracks the probability transitions between the 4 states of SEIR: **S**usceptible-**E**xposed-**I**nfectious-**R**ecovered/deceased. Learn more about how our SEIR model works on [our website](https://covid19-projections.com/model-details/).
Because this simulator has very little [dependencies](#dependencies) and does not rely on published data, it is fast to run, works right out of the box, and is easily modifiable. We've purposefully designed our simulator to be as lean and simple as possible.
The simulations produced by this program will not necessarily match the full model, but it is often be a close approximation. The full model for *covid19-projections.com* generates thousands of parameter sets for each region and weighs the parameters based on how the resulting simulations match the observed data. With that said, this is the full, unabridged SEIR model used to generate the simulations - no modifications have been made for this release.
In addition to the SEIR simulator, we provide the "best" set of parameters that our machine learning layer has learned to best fit the real-world observed data. This is done by taking a weighted mean (or median) of the individual parameters used in our full model. Because parameters are not independent, using only a single set of parameters may skew the simulation results when compared to the full model projections.
While this simulator may not be best suited to make projections (since it is not tuned on any published data), we believe this simulator is particular helpful for mapping out relative scenarios. For example, how much can we reduce infections/deaths if [people started social distancing 7 days earlier](#decrease-inflection-date-by-7-days). Or what if [20% of individuals self-quarantine after symptom onset](#simulate-effect-of-quarantine). Or if there was [no reopening](#assume-no-reopening).
## Dependencies
You need [Python 3](https://www.python.org/downloads/) and [NumPy](https://numpy.org/install/). That's it.
*Note: This was built and tested on Python 3.8.0 and NumPy 1.19.2. It's possible that an older/newer versions may not be compatible.*
## Setup
1. Make sure you have [Python 3](https://www.python.org/downloads/) and [NumPy](https://numpy.org/install/) installed.
2. Clone our repository: ```git clone https://github.com/youyanggu/yyg-seir-simulator.git```
3. You are now ready to run our simulator! See sample usage below.
## Usage
To view a list of supported countries, states, and subregions, check [covid19-projections.com](https://covid19-projections.com/#view-projections).
#### List all command line flags/features:
```
python run_simulation.py --help
```
### Basic Usage
Note: `-v` means verbose mode. Remove the flag and you will get fewer print statements.
#### US simulation:
```
python run_simulation.py -v --best_params_dir best_params/latest --country US
```
#### US state simulations:
```
python run_simulation.py -v --best_params_dir best_params/latest --country US --region NY
python run_simulation.py -v --best_params_dir best_params/latest --country US --region AZ
python run_simulation.py -v --best_params_dir best_params/latest --country US --region TX
```
#### US county simulations:
```
python run_simulation.py -v --best_params_dir best_params/latest --country US --region CA --subregion "Los Angeles"
python run_simulation.py -v --best_params_dir best_params/latest --country US --region NY --subregion "New York City"
python run_simulation.py -v --best_params_dir best_params/latest --country US --region FL --subregion Miami-Dade
```
#### Global country simulations:
```
python run_simulation.py -v --best_params_dir best_params/latest --country Brazil
python run_simulation.py -v --best_params_dir best_params/latest --country Sweden
python run_simulation.py -v --best_params_dir best_params/latest --country "United Kingdom"
```
#### Canadian province simulation:
```
python run_simulation.py -v --best_params_dir best_params/latest --country Canada --subregion Quebec
python run_simulation.py -v --best_params_dir best_params/latest --country Canada --subregion Ontario
python run_simulation.py -v --best_params_dir best_params/latest --country Canada --subregion "British Columbia"
```
### Advanced Usage
#### Save outputs to CSV file
```
python run_simulation.py -v --best_params_dir best_params/latest --country US --save_csv_fname us_simulation.csv
```
#### Use a custom end date
```
python run_simulation.py -v --best_params_dir best_params/latest --country US --simulation_end_date 2020-11-01
```
#### Use a custom start date
```
python run_simulation.py -v --best_params_dir best_params/latest --country US --simulation_start_date 2020-02-01
```
#### Simulate effect of quarantine
In this scenario, we show how the course of the epidemic would be different if just 20% of infected individuals immediately self-quarantine after showing symptoms, reducing their own transmission by 25%. For the remaining 80% of infected individuals, we assume normal transmission. You can see a graph of this scenario [here](https://covid19-projections.com/us-self-quarantine).
This can also be used as a proxy to simulate the effect of mask-wearing: if 20% of individuals wear masks, thereby reducing the overall transmission rate by 25%.
```
python run_simulation.py -v --best_params_dir best_params/latest --country US --quarantine_perc 0.2 --quarantine_effectiveness 0.25
```
#### Use an older set of best parameters
By default, we use the latest set of best parameters in `best_params/latest`, but you can also specify a different directory.
```
python run_simulation.py -v --best_params_dir best_params/2020-06-21 --country US
```
#### Use the top 10 best parameters rather than the mean
The four choices are: mean (default), median, top, top10
```
python run_simulation.py -v --best_params_dir best_params/latest --country US --best_params_type top10
```
### Setting Parameters
We also provide support to customize your own parameters using the `--set_param` flag. The flag takes a pair of values: the name of the parameter to be changed and its value. You can use the flag multiple times.
See the available parameter options in the [next section](#parameters).
#### Set initial R_0 to 2.0
```
python run_simulation.py -v --best_params_dir best_params/latest --country US --set_param INITIAL_R_0 2.0
```
#### Set initial R_0 to 2.0 and lockdown
没有合适的资源?快使用搜索试试~ 我知道了~
yyg-seir-simulator:YYG covid19-projections.com模型的基础SEIR模拟器
共2000个文件
json:17548个
py:5个
gitignore:1个
需积分: 10 3 下载量 4 浏览量
2021-04-14
00:40:24
上传
评论 1
收藏 28.12MB ZIP 举报
温馨提示
YYG / covid19-projections.com SEIR模拟器 我们介绍了YYG / 模型背后的基础SEIR模型模拟器,以及有助于生成预测的一组摘要参数。 如果您的系统支持Python,则可以在5分钟内生成自己的仿真。 无需先有Python经验即可运行该工具。 。 目录 问题? 其他资料库 介绍 首先,我们要清楚一点,这不是covid19-projections.com使用的完整模型。 这是没有机器学习层即可学习参数的基本SEIR模型。 实际上,此模拟器不使用任何已发布的数据:仅给定一组参数,它仅模拟感染,住院和死亡。 结果,该工具旨在生成模拟,而不是投影。 不同于传统的SEIR模型,我们的模拟器不使用微分方程-我们用一个抽象状态机,轨道SEIR的4种状态间的转换概率:S usceptible-éxposed-我nfectious- [R ecovered /死亡。 在
资源详情
资源评论
资源推荐
收起资源包目录
yyg-seir-simulator:YYG covid19-projections.com模型的基础SEIR模拟器 (2000个子文件)
2020-08-05_US_IL_Cook.json 9KB
2020-08-05_Serbia_ALL.json 9KB
2020-08-02_Russia_ALL.json 9KB
2020-08-04_Pakistan_ALL.json 9KB
2020-08-05_US_VA.json 9KB
2020-08-02_US_VA.json 9KB
2020-08-04_US_MA_Middlesex.json 9KB
2020-08-04_US_WA_King.json 9KB
2020-08-03_US_WA_King.json 9KB
2020-08-02_US_IN.json 9KB
2020-08-02_US_AR.json 9KB
2020-08-03_US_OH.json 9KB
2020-08-04_Canada_Alberta.json 9KB
2020-08-05_US_IN.json 9KB
2020-08-02_US_IL_Cook.json 9KB
2020-08-04_US_WA.json 9KB
2020-08-02_US_MA_Middlesex.json 9KB
2020-08-05_Japan_ALL.json 9KB
2020-08-03_Slovenia_ALL.json 9KB
2020-08-02_Pakistan_ALL.json 9KB
2020-08-04_Bangladesh_ALL.json 9KB
2020-08-05_US_CA.json 9KB
2020-08-02_US_CA.json 9KB
2020-08-03_Canada_Alberta.json 9KB
2020-08-04_US_NV_Washoe.json 9KB
2020-08-04_US_CA.json 9KB
2020-08-05_US_NJ_Essex.json 9KB
2020-08-02_US_CT.json 9KB
2020-08-04_US_CT.json 9KB
2020-08-04_US_TX_Tarrant.json 9KB
2020-08-04_US_VA.json 9KB
2020-08-05_Canada_ALL.json 9KB
2020-08-02_US_NV_Washoe.json 9KB
2020-08-03_US_CT.json 9KB
2020-08-03_Pakistan_ALL.json 9KB
2020-08-04_US_OH.json 9KB
2020-08-05_US_NV_Washoe.json 9KB
2020-09-25_Bangladesh_ALL.json 9KB
2020-08-05_Belgium_ALL.json 9KB
2020-08-02_US_TX_Tarrant.json 9KB
2020-08-02_Italy_ALL.json 9KB
2020-08-05_US_TX_Tarrant.json 9KB
2020-08-03_US_IN.json 9KB
2020-08-03_US_NV_Washoe.json 9KB
2020-07-30_US_CA.json 9KB
2020-08-04_Italy_ALL.json 9KB
2020-08-05_US_UT.json 9KB
2020-08-05_US_WA.json 9KB
2020-08-05_US_FL_Broward.json 9KB
2020-08-05_Italy_ALL.json 9KB
2020-08-03_Serbia_ALL.json 9KB
2020-08-04_Slovenia_ALL.json 9KB
2020-09-27_US_CA.json 9KB
2020-08-05_US_OH.json 9KB
2020-08-02_Bangladesh_ALL.json 9KB
2020-08-04_US_MA_Suffolk.json 9KB
2020-08-02_US_ID.json 9KB
2020-10-01_US_NJ.json 9KB
2020-08-03_US_CA.json 9KB
2020-08-03_US_MA_Middlesex.json 9KB
2020-08-03_US_IL_Cook.json 9KB
2020-08-04_US_CA_Riverside.json 9KB
2020-08-05_Bangladesh_ALL.json 9KB
2020-07-31_US_LA.json 9KB
2020-07-31_Pakistan_ALL.json 9KB
2020-08-02_Canada_Alberta.json 9KB
2020-08-02_US_NV_Clark.json 9KB
2020-08-02_Canada_Ontario.json 9KB
2020-08-02_US_WA.json 9KB
2020-08-04_Canada_Ontario.json 9KB
2020-08-05_Russia_ALL.json 9KB
2020-08-01_US_CT.json 9KB
2020-08-03_US_NV_Clark.json 9KB
2020-08-03_US_NJ_Bergen.json 9KB
2020-08-04_US_NV_Clark.json 9KB
2020-08-02_Canada_ALL.json 9KB
2020-08-03_Japan_ALL.json 9KB
2020-08-03_Bangladesh_ALL.json 9KB
2020-08-03_Canada_ALL.json 9KB
2020-08-04_US_NJ_Bergen.json 9KB
2020-08-04_Egypt_ALL.json 9KB
2020-08-02_US_SC.json 9KB
2020-08-03_US_NJ_Essex.json 9KB
2020-08-03_Morocco_ALL.json 9KB
2020-08-03_Belgium_ALL.json 9KB
2020-08-05_US_IL.json 9KB
2020-08-05_US_PR.json 9KB
2020-08-05_US_NV_Clark.json 9KB
2020-08-01_US_OH.json 9KB
2020-07-30_US_LA.json 9KB
2020-08-04_Belarus_ALL.json 9KB
2020-08-05_Pakistan_ALL.json 9KB
2020-08-05_US_NC.json 9KB
2020-09-26_US_CA_Riverside.json 9KB
2020-07-30_US_OH.json 9KB
2020-10-04_United-Kingdom_ALL.json 9KB
2020-07-31_US_OH.json 9KB
United-Kingdom_ALL.json 9KB
2020-08-02_US_FL.json 9KB
2020-08-02_Japan_ALL.json 9KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
易洪艳
- 粉丝: 40
- 资源: 4503
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0