Jeff-Lewis / open-covid-19-forecasting

Forecasting analysis of expected COVID-19 positive cases

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Open COVID-19 Forecasting

This repository contains forecasting data of the next 3 days for all countries and regions which contain at least 10 days of data since reporting 10 confirmed COVID-19 positive cases or more. It also implements a very simple page to view the forecasting data.

Data

The dataset used to perform the forecasting is the Open COVID-19 Dataset, which contains total confirmed positive cases and total fatal cases for all reporting countries as well as subregions of USA and China.

The output of the forecasting model are the following datasets:

  • World:

    • ForecastDate: ISO 8601 date (YYYY-MM-DD) of the last known datapoint at the time of forecast
    • Date: ISO 8601 date (YYYY-MM-DD) of the datapoint
    • CountryCode: 2-letter ISO 3166-1 code of the country
    • CountryName: American English name of the country
    • Confirmed: total number of cases confirmed after positive test
    • Estimated: total number of cases estimated from forecasting model
    • ForecastChart: relative path to an SVG file containing a chart of the estimates
  • USA:

    • ForecastDate: ISO 8601 date (YYYY-MM-DD) of the last known datapoint at the time of forecast
    • Region: 2-letter state code (e.g. CA, FL, NY)
    • Date: ISO 8601 date (YYYY-MM-DD) of the datapoint
    • CountryCode: 2-letter ISO 3166-1 code of the country
    • CountryName: American English name of the country
    • Confirmed: total number of cases confirmed after positive test
    • Estimated: total number of cases estimated from forecasting model
    • ForecastChart: relative path to an SVG file containing a chart of the estimates

Only the latest version of the datasets is kept, but the charts are prefixed by forecast date and never deleted.

Forecasting Model

The forecasting is done by fitting the data to a specialized logistic curve, called Gompertz function. For a walkthrough of why this was chosen over other potential models, see the relevant analysis.

Updating the data

To update the forecast with the latest data, run the following commands:

# Install dependencies
pip install -r requirements.txt
# Update world forecast
python input/forecast_world.py
# Update USA forecast
python input/forecast_usa.py
# Build map of all charts
python input/build_json.py

Building the website

To build the website, run the following commands after the data is updated:

# Install dependencies
npm install
# Build webpage components
npm run build
# Serve website at port 8080
npm run start

About

Forecasting analysis of expected COVID-19 positive cases


Languages

Language:Python 40.7%Language:JavaScript 25.9%Language:CSS 20.7%Language:HTML 12.7%