Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestions of some improvements #23

Open
gasilva opened this issue Apr 2, 2020 · 0 comments
Open

Suggestions of some improvements #23

gasilva opened this issue Apr 2, 2020 · 0 comments

Comments

@gasilva
Copy link
Contributor

gasilva commented Apr 2, 2020

Here are some improvements possible:

  • Use scipy.integrate.odeint to solve the ODE system. The results may differ from solve_ivp, which is common for nonlinear equations, but the code is very fast because is FORTRAN compiled. The solver is used by several people to solve Lotka Volterra equations (predator-prey type)
def lossOdeint(point, data, recovered, death, s_0, i_0, r_0, d_0):
    size = len(data)
    beta, a, b = point
    def SIR(y,t):
        return [-beta*y[0]*y[1], beta*y[0]*y[1]-(a+b)*y[1], a*y[1], b*y[1]]
    y0=[s_0,i_0,r_0,d_0]
    tspan=np.arange(0, size, 1)
    res=odeint(SIR,y0,tspan)
    l1 = np.sqrt(np.mean((res[:,1]- data)**2))
    l2 = np.sqrt(np.mean((res[:,2]- recovered)**2))
    l3 = np.sqrt(np.mean((res[:,3] - death)**2))
    #weight for cases
    u = 0.25
    #weight for recovered
    v = 0.02 ##Brazil France 0.04 US 0.02 China 0.01 (it has a lag in recoveries) Others 0.15
    #weight for deaths
    w = 1 - u - v - z
    return u*l1 + v*l2 + w*l3
  • Use different delays/lags in equations of recovered and deaths due to incubation, hospital time. China data shows a very clear delay in recovery for example. The optimizer must find the and in order to start the curves in the right time.

  • Implement an improvement in infected people because Covid19 has a lot of undetectable cases. See that at See paper here! A Time-dependent SIR model for COVID-19 with Undetectable Infected Persons from Cornell University.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant