Skip to main content

lag time and case fatality rate (CFR)

Project description

covidlag

Data science is useful to investigate the progression of the pandemic.

covidlag is an open-source program which is available in public and can be installed by the PyPI package command (pip). covidlag can calculate the lag time between infection peaks and death peaks. covidlag can also compute death rate per infection or case fatality ratio (CFR). CFR is the proportion of individuals diagnosed with a disease who die from that disease and is therefore a measure of severity among detected cases.

CFR is a dynamic value which is continuously changing. In the conventional methods, CFR is used for retrospective observational studies and are not suitable for continuous time series data.

According to CDC: https://www.cdc.gov/foodnet/reports/data/case-fatality.html

the CFR is calculated by: CFR=(number of cases in which patient died/number of cases).

The CDC method for CFR is appropriate for annual statistics, but not for time series data analysis.

In the current CFR calculation, we need to determine two indicators: the number of sampled days and its range of start and ending dates.

Two indicators significantly influence CFR.

COVID-19 variants and vaccinations can significantly change the lag time and the CFR so that the convetional distribution approaches are not suitable for ongoing time series data.

There is no algorithm to select two appropriate indicators.

The proposed algorithm is based on a robust correlation between infection and death.

The extreme values such as maxima and minima can be used for computing the accurate lag time and the CFR.

The detailed method is under review.

How to install covidlag

Covidlag is available in public and can be installed by the following PyPI packaging command:

$ pip install covidlag

How to run covidlag

covidlag needs at least three parameters (country name, sampled days, regression polinomial degree).

Run the following command composed of the country name, sampled days, the degree of polynomial curve-fitting, and options (L: left, R: right, C: center):

$ covidlag 'United States' 600 13 L

This example shows that r-squared of infections:0.803 and r-squared of deaths:0.733

The death peaks are [ 66, 182, 332, 464, 574]. The case peaks are [ 47, 150, 309, 441, 562].

maxima information
death peak: 2020-04-23
death peak: 2020-08-17
death peak: 2021-01-14
death peak: 2021-05-26
death peak: 2021-09-13
case peak: 2020-04-04
case peak: 2020-07-16
case peak: 2020-12-22
case peak: 2021-05-03
case peak: 2021-09-01
maxiddeath (array([ 66, 182, 332, 464, 574]),)
maxidcase (array([ 47, 150, 309, 441, 562]),)
ydeath[maxiddeath] [1963 1010 3105  627 1915]
ycase[maxidcase] [ 32699  59662 207017  43332 177464]
==================================
minima information
death minima: 2020-03-02
death minima: 2020-06-26
death minima: 2020-10-07
death minima: 2021-04-26
death minima: 2021-07-17
death minima: 2021-09-28
case minima: 2020-02-28
case minima: 2020-05-11
case minima: 2020-09-09
case minima: 2021-04-12
case minima: 2021-06-28
case minima: 2021-09-29
miniddeath (array([ 14, 130, 233, 434, 516, 589]),)
minidcase (array([ 11,  84, 205, 420, 497, 590]),)
ydeath[miniddeath] [-284  594  682  540  113 1735]
ycase[minidcase] [-16493  13753  31474  41737  12714  88203]

The lag time between infections and deaths using maxima is 66-47=19 days, 182-150=32 days, 332-309=23 days, 464-441=23 days, 574-562=12 days.

The number of every death peak is [1963 1010 3105 627 1915].

The number of every case peak is [ 32699 59662 207017 43332 177464].

The death rate per infection is 1963/32699=0.060,1010/59662=0.017, 3105/207017=0.015,627/43332=0.014,1915/177464=0.011

CFR in the US is slowly decreasing. But, it is still high compared with that of Japan.

$ covidlag Japan 400 13 L

This example is for "Japan" with the "13th" degree polynomial curve-fitting using "400" sampled days. The result shows the polynomial curve-fitting that r-squared of infections is 0.923 and r-squared of deaths is 0.706.

The death peaks are [152 267 374].
death peak: 2021-01-29 <-
death peak: 2021-05-24 <-
death peak: 2021-09-08 <-

The case peaks are [27 133 252 258].
case peak: 2020-09-26
case peak: 2021-01-10 <-
case peak: 2021-05-09 <-
case peak: 2021-08-23 <-

The lag time between infections and deaths is 152-133=19 days, 267-252=15 days, 
and 374-258=16 days respectively.

The number of every death peak is [88 92 54].

The number of every case peak is [526 4421 5902 20029]

Therefore, death rate of peaks or CFR is 88/4421=0.019, 92/5902=0.015, and 54/20029=0.0026 respectively.

The CFR is significantly decreasing.

$ covidlag Canada 400 13 L

death peak: 2020-09-07
death peak: 2021-01-06
death peak: 2021-05-08
death peak: 2021-09-25
case peak: 2020-09-07
case peak: 2020-12-26
case peak: 2021-04-21
case peak: 2021-09-19
The lag time is 11 days, 17 days,...

The death rate per infection is 0.018,0.006,...

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

covidlag-0.0.7.tar.gz (4.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

covidlag-0.0.7-py3.8.egg (7.0 kB view details)

Uploaded Egg

covidlag-0.0.7-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file covidlag-0.0.7.tar.gz.

File metadata

  • Download URL: covidlag-0.0.7.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.3

File hashes

Hashes for covidlag-0.0.7.tar.gz
Algorithm Hash digest
SHA256 bda25cc9f6d6c238bbf489d1768c9be5ba1f2406d840acbc256d48cc2a89f795
MD5 46f721f7b0641fc981a841dcbe240520
BLAKE2b-256 63728dcc492343d9ebfabb90524a1feb94c62a355dbd8c7bb7a4223de0a0cd1c

See more details on using hashes here.

File details

Details for the file covidlag-0.0.7-py3.8.egg.

File metadata

  • Download URL: covidlag-0.0.7-py3.8.egg
  • Upload date:
  • Size: 7.0 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.3

File hashes

Hashes for covidlag-0.0.7-py3.8.egg
Algorithm Hash digest
SHA256 caa45108fb568382f6584188ec096db43a061ba8975059ca54a985acfeba0281
MD5 e4f68cbb77bfaf3f81c176f46094da8a
BLAKE2b-256 443d21183c23a63ffcd23a04e2ee5bb8fc06d3d40a649b04d98d7c9626020137

See more details on using hashes here.

File details

Details for the file covidlag-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: covidlag-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.3

File hashes

Hashes for covidlag-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 90b793f2c7b5fdcf617bc9751b14298890e68f815c51f83675e9c908abefe62b
MD5 29b15a6ab2ad90a81e3a55ca3c68fbdc
BLAKE2b-256 c5b002c1ef33e4d778cc4b6df874bbcfee1dc1307acdbcc0eca573e88a8eedb8

See more details on using hashes here.

Supported by

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