codecogs equations

måndag 9 mars 2020

COVID19: what is the growth rate?

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:

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