Ebola implementation in PyGOM

PyGOM — A Python Package for Simplifying Modelling with Systems of Ordinary Differential Equations https://arxiv.org/pdf/1803.06934.pdf

This model is taken from the Legrand paper (ref) for modelling Ebola.


In [1]:
import numpy
from pygom import common_models

In [2]:
# initial conditions and parameters

x0 = [1.0, 3.0/200000.0, 0.0, 0.0, 0.0, 0.0, 0.0]

t = numpy.linspace(1, 25, 100)

ode = common_models.Legrand_Ebola_SEIHFR([
                                    ('beta_I',0.588),     # transmission 
                                    ('beta_H',0.794),     # transmission within hospital 
                                    ('beta_F',7.653),     # transmission at funeral
                                    ('omega_I',10.0/7.0), # duration from exposure to symptoms (inv)
                                    ('omega_D',9.6/7.0),  # duration from hospitalization to death (inv)
                                    ('omega_H',5.0/7.0),  # duration from symptoms to hospitalization (inv)
                                    ('omega_F',2.0/7.0),  # duration from hospitalization to death (inv)
                                    ('alphaInv',7.0/7.0), # incubation period
                                    ('delta',0.81),       # fatality rate
                                    ('theta',0.80),       # hospitalization rate
                                    ('kappa',300.0),  
                                    ('interventionTime',7.0) # delay before introducing intervention
                                    ])
ode.initial_values = (x0, t[0])

In [3]:
solution = ode.integrate(t)

ode.plot()



In [ ]:
def LegEb(betaI=0.588, betaH=0.794, betaF=7.653,
          omegaI=10.0/7.0, omegaD=9.6/7.0, omegaH=5./7.0, omegaF=2.0/7.0,
          alphaInv=7.0/7.0, delta=0.81, theta=0.8, kappa=300.0, intT=7.0,
          time=numpy.linspace(1, 50, 100),
          x0=[1.0, 3.0/200000.0, 0.0, 0.0, 0.0, 0.0, 0.0]):
    
    ode = common_models.Legrand_Ebola_SEIHFR([
                                    ('beta_I',betaI),     # transmission 
                                    ('beta_H',betaH),     # transmission within hospital 
                                    ('beta_F',betaF),     # transmission at funeral
                                    ('omega_I',omegaI), # duration from exposure to symptoms (inv)
                                    ('omega_D',omegaD),  # duration from hospitalization to death (inv)
                                    ('omega_H',omegaH),  # duration from symptoms to hospitalization (inv)
                                    ('omega_F',omegaF),  # duration from hospitalization to death (inv)
                                    ('alphaInv',alphaInv), # incubation period
                                    ('delta',delta),       # fatality rate
                                    ('theta',theta),       # hospitalization rate
                                    ('kappa',kappa),  
                                    ('interventionTime',intT) # delay before introducing intervention
                                    ])
    ode.initial_values = (x0, t[0])
    solution = ode.integrate(t)
    ode.plot()

If we change the time to intervention, assuming that intervention regarding funteral introduced earlier


In [ ]:
LegEb(intT=4.0)

In [ ]: