Answer: the growth rate is about 1.3 per day for Europe and US. This means a doubling of the number of cases every 2-3 days. Slower for Japan and Singapore. South Korea also shows signs of slower growth. More in depth about the method below the graphs.
Method
data: john hopkins via kaggle as of 2020-03-07
Cases are reported daily.
The model applied is least squares on the logarithm of number of cases. The code:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def exponential_regression(cases): | |
""" | |
Fitting parameters alpha and beta to | |
cases = beta * t ^ (alpha) | |
where t is number of samples (days) since the start. | |
""" | |
N = len(cases) | |
A = np.ones([N, 2]) | |
A[:, 0] = list(range(N)) | |
b = np.log(cases) | |
res = np.linalg.lstsq(A, b, rcond=None) | |
alpha, beta = res[0] | |
alpha = np.exp(alpha) | |
beta = np.exp(beta) | |
return alpha, beta |
The model is applied from the when there is at least 70 reported cases.
Inga kommentarer:
Skicka en kommentar