Skip to main content

COVID-19 data analysis with phase-dependent SIR-derived ODE models

Project description

CovsirPhy: COVID-19 analysis with phase-dependent SIRs

PyPI version Downloads PyPI - Python Version Build Status GitHub license Maintainability Test Coverage Open Source Helpers

CovsirPhy introduction

Documentation | Installation | Tutorial | 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 analyze them easily. Scenario analysis with CovsirPhy enables us to make data-informed decisions.

Inspiration

  • Monitor the spread of COVID-19 with SIR-derived ODE models
  • Predict the number of cases 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 and Twitter: @lisphilar are always welcomed. Questions are also great. Please refer to Guideline of contribution.

Installation

The latest stable version of CovsirPhy is available at PyPI (The Python Package Index): covsirphy and supports Python 3.7.12 or newer versions. Details are explained in Documentation: Installation.

pip install --upgrade covsirphy

Python 3.10 users may need to install datatable with the following before covsirphy installation per Issue #1159.

pip install git+https://github.com/h2oai/datatable.git

Demo

Quickest tour of CovsirPhy is here. The following codes analyze the records in Japan.

import covsirphy as cs
# Data preparation,time-series segmentation, parameter estimation with SIR-F model
snr = cs.ODEScenario.auto_build(geo="Japan", model=cs.SIRFModel)
# Check actual records
snr.simulate(name=None);
# Show the result of time-series segmentation
snr.to_dynamics(name="Baseline").detect();
# Perform simulation with estimated ODE parameter values
snr.simulate(name="Baseline");
# Predict ODE parameter values (30 days from the last date of actual records)
snr.build_with_template(name="Predicted", template="Baseline");
snr.predict(days=30, name="Predicted");
# Perform simulation with estimated and predicted ODE parameter values
snr.simulate(name="Predicted");
# Add a future phase to the baseline (ODE parameters will not be changed)
snr.append();
# Show created phases and ODE parameter values
snr.summary()
# Compare reproduction number of scenarios (predicted/baseline)
snr.compare_param("Rt");
# Compare simulated number of cases
snr.compare_cases("Confirmed");
# Describe representative values
snr.describe()

Output of snr.simulate(name="Predicted");

Tutorial

Tutorials of functionalities are included in the CovsirPhy documentation.

Release notes

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.

Developers

CovsirPhy library is developed by a community of volunteers. Please see the full list here.

This project started in Kaggle platform. Hirokazu Takaya (@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.

Support

Please support this project as a developer (or a backer). Become a backer

License: Apache License 2.0

Please refer to LICENSE file.

Citation

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-2022), 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 change point analysis, phase-dependent approach to SIR-derived models, and other scientific method performed with CovsirPhy, please cite the next Kaggle notebook.

Hirokazu Takaya (2020-2022), 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.

import covsirphy as cs
cs.__citation__

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

covsirphy-2.26.0.tar.gz (194.3 kB view hashes)

Uploaded Source

Built Distribution

covsirphy-2.26.0-py3-none-any.whl (274.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page