Code Monkey home page Code Monkey logo

covid19-sir's Introduction

CovsirPhy: COVID-19 analysis with phase-dependent SIRs

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

CovsirPhy introduction

Documentation | Installation | Quickest usage | API reference | Qiita (Japanese)

CovsirPhy is a Python package for COVID-19 (Coronavirus disease 2019) data analysis with phase-dependent SIR-derived ODE models. We can download datasets and analyse it easily. This will be a helpful tool for data-informed decision making. Please refer to "Method" part of Kaggle Notebook: COVID-19 data with SIR model to understand the methods.

Functionalities

  • Data preparation and data visualization
  • Phase setting with S-R Trend analysis
  • Numerical simulation of ODE models
    • Stable: SIR, SIR-D and SIR-F model
    • Development: SIR-FV and SEWIR-F model
  • Phase-dependent parameter estimation of ODE models
  • Scenario analysis: Simulate the number of cases with user-defined parameter values
  • (In development): Find the relationship of government response and parameter values

Inspiration

  • 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. Please read Guideline of contribution in advance.

Installation and dataset preparation

We have the following options to start analysis with CovsirPhy. Datasets are not included in this package, but we can prepare them with DataLoader class.

Installation Dataset preparation
Standard users pip/pipenv Automated with DataLoader class
Developers git-cloning Automated with DataLoader class
Kagglers (local environment) git-cloning Kaggle API and Python script and DataLoader
Kagglers (Kaggle platform) pip Kaggle Datasets and DataLoader

Installation and dataset preparation explains how to install and prepare datasets for all users.

Stable versions of Covsirphy are available at PyPI (The Python Package Index): covsirphy and support Python 3.6 or newer versions.

pip install covsirphy --upgrade

Development versions are in GitHub repository: CovsirPhy.

pip install "git+https://github.com/lisphilar/covid19-sir.git#egg=covsirphy"

Main datasets will be retrieved via COVID-19 Data Hub and the citation is
Guidotti, E., Ardia, D., (2020), "COVID-19 Data Hub", Journal of Open Source Software 5(51):2376, doi: 10.21105/joss.02376.

Usage

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 datasets
data_loader = cs.DataLoader("input")
jhu_data = data_loader.jhu()
population_data = data_loader.population()
# Check records
snl = cs.Scenario(jhu_data, population_data, country="Japan")
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:

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 package as follows.

CovsirPhy Development Team (2020), CovsirPhy, Python package for COVID-19 analysis with SIR-derived ODE models, https://github.com/lisphilar/covid19-sir

If you want to use SIR-F/SIR-FV/SEWIR-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.

Lisphilar (2020), Kaggle notebook, COVID-19 data with SIR model, https://www.kaggle.com/lisphilar/covid-19-data-with-sir-model

Related work

Reproduction number evolution in each country:
Ilyass Tabiai and Houda Kaddioui (2020), GitHub pages, COVID19 R0 tracker, https://ilylabs.github.io/projects/COVID-trackers/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.