SEIR model

[36]:
import epistochmodels
[37]:
pop = 1000
beta = 0.7
gamma = 0.2
e = 0.3
model = epistochmodels.SEIR(pop, beta, gamma, e)
[38]:
inits = 990,10,0,0
model.initialize(*inits)
[39]:
%%time
res = model.run(0,1000)
CPU times: user 221 ms, sys: 75.3 ms, total: 296 ms
Wall time: 299 ms
[40]:
%pylab inline
Populating the interactive namespace from numpy and matplotlib
[41]:
plot(res[0],res[1])
legend(['S','E','I','R']);
../_images/notebooks_SEIR_6_0.svg
[17]:
res[0][-1]
[17]:
inf
[ ]: