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
Release history Release notifications | RSS feed
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)
Built Distribution
Reff-0.0.2-py3-none-any.whl
(3.5 kB
view details)
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8eb5bc10a75c430d0d1f62b13a28356e1af5bc814b03eb0c7c5c8daf29000f7 |
|
MD5 | cbecb28763aaf2b0e5ba2f8edab254ae |
|
BLAKE2b-256 | bb0ed2ed6f63dcd65ffdbd0e1191967f52c85eb10c19a04de2e910999ba855d9 |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74e3cd84e23f4901f660e8763513128d271b7e17d20682cc8d361e95852daf22 |
|
MD5 | 495ae4338d06408367b4fb710aef9772 |
|
BLAKE2b-256 | 3bc095238b96c806a1ef25c6648622a5292dfb9979596d9fd3a1334edea076e3 |