Documentation | Installation | Quickest usage | API reference | GitHub | Qiita (Japanese)
CovsirPhy is a Python library for COVID-19 (Coronavirus disease 2019) data analysis with phase-dependent SIR-derived ODE models. We can download datasets and analyse them easily. Scenario analysis with CovsirPhy enables us to make data-informed decisions.
- Data preparation and data visualization
- Phase setting with S-R Trend analysis
- Numerical simulation of ODE models: SIR, SIR-D and SIR-F model
- Phase-dependent parameter estimation of ODE models
- Scenario analysis: Simulate the number of cases with user-defined parameter values
- Find the relationship of government response and parameter values
- Monitor the spread of COVID-19
- Keep track parameter values/reproduction number in each country/province
- Find the relationship of reproductive number and measures taken by each country
If you have ideas or need new functionalities, please join this project. Any suggestions with Github Issues are always welcomed. Questions are also great. Please read Guideline of contribution in advance.
The latest stable version of CovsirPhy is available at PyPI (The Python Package Index): covsirphy and supports Python 3.7 or newer versions. Details are explained in Documentation: Installation.
pip install --upgrade covsirphy
Quickest tour of CovsirPhy is here. The following codes analyze the records in Japan, but we can change the country name when creating Scenario
class instance for your own analysis.
import covsirphy as cs
# Download and update datasets
data_loader = cs.DataLoader("input")
jhu_data = data_loader.jhu()
population_data = data_loader.population()
# Check records
snl = cs.Scenario(country="Japan")
snl.register(jhu_data, population_data)
snl.records()
# S-R trend analysis
snl.trend().summary()
# Parameter estimation of SIR-F model
snl.estimate(cs.SIRF)
# History of reproduction number
_ = snl.history(target="Rt")
# History of parameters
_ = snl.history_rate()
_ = snl.history(target="rho")
# Simulation for 30 days
snl.add(days=30)
_ = snl.simulate()
Further information:
Release notes are here. Titles & links of issues are listed with acknowledgement.
We can see the release plan for the next stable version in milestone page of the GitHub repository. If you find a highly urgent matter, please let us know via issue page.
Please support this project as a developer (or a backer).
CovsirPhy library is developed by a community of volunteers. Please see the full list here.
This project started in Kaggle platform. Lisphilar published Kaggle Notebook: COVID-19 data with SIR model on 12Feb2020 and developed it, discussing with Kaggle community. On 07May2020, "covid19-sir" repository was created. On 10May2020, covsirphy
version 1.0.0 was published in GitHub. First release in PyPI (version 2.3.0) was on 28Jun2020.
Please refer to LICENSE file.
We have no original papers the author and contributors wrote, but please cite this library as follows with version number (import covsirphy as cs; cs.__version__
).
CovsirPhy Development Team (2020-2021), CovsirPhy version [version number]: Python library for COVID-19 analysis with phase-dependent SIR-derived ODE models, https://github.com/lisphilar/covid19-sir
If you want to use SIR-F model, S-R trend analysis, phase-dependent approach to SIR-derived models, and other scientific method performed with CovsirPhy, please cite the next Kaggle notebook.
Hirokazu Takaya (2020-2021), Kaggle Notebook, COVID-19 data with SIR model, https://www.kaggle.com/lisphilar/covid-19-data-with-sir-model
We can check the citation with the following script (version >= 2.18.0).
import covsirphy as cs
cs.__citation__