Skip to main content

effective reproduction number

Project description

Reff: effective reproduction number

Reff(data, si_mean, si_sd, tau=7, conf=0.95, mu=5):
input:
  data = daily number of incidence
  si_mean = mean of serial interval
  si_sd = standard deviation of serial interval
  tau = length of time window (integer in days)
  conf = confidence level of estimated Reff
  mu = mean of prior ditribution of Reff
return:
  R = daily Reff of shape (3,len(data))
  R[0:3] = median, min, max
reference:
  A. Cori et al
    American Journal of Epidemiology 178 (2013) 1505
      Web Appendix 1

example code:

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from Reff import Reff

# data from:
# https://github.com/nychealth/coronavirus-data
data = pd.read_csv('case-hosp-death.csv')
t = np.array(pd.to_datetime(data['DATE_OF_INTEREST']))
c = np.array(data['CASE_COUNT'])
R = Reff(c, 6.3, 4.2)
plt.semilogy(t, R.T)
plt.show()

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

Reff-0.0.2.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

Reff-0.0.2-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file Reff-0.0.2.tar.gz.

File metadata

  • Download URL: Reff-0.0.2.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.3

File hashes

Hashes for Reff-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f8eb5bc10a75c430d0d1f62b13a28356e1af5bc814b03eb0c7c5c8daf29000f7
MD5 cbecb28763aaf2b0e5ba2f8edab254ae
BLAKE2b-256 bb0ed2ed6f63dcd65ffdbd0e1191967f52c85eb10c19a04de2e910999ba855d9

See more details on using hashes here.

File details

Details for the file Reff-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: Reff-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.3

File hashes

Hashes for Reff-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 74e3cd84e23f4901f660e8763513128d271b7e17d20682cc8d361e95852daf22
MD5 495ae4338d06408367b4fb710aef9772
BLAKE2b-256 3bc095238b96c806a1ef25c6648622a5292dfb9979596d9fd3a1334edea076e3

See more details on using hashes here.

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