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 hashes)
Built Distribution
Reff-0.0.2-py3-none-any.whl
(3.5 kB
view hashes)