Successfully reported this slideshow.                                         Upcoming SlideShare
×

# Generalized SEIR Model on Large Networks

163 views

Published on

SEIR model is a widely used model for simulating the spread of infectious diseases. In its simplest form, the SEIR model assumes that individuals in the population can assume any of the four states: Susceptible, Exposed, Infected and Recovered (or Removed), and the evolution of the system is modeled as a system of ordinary differential equations.

Published in: Data & Analytics
• Full Name
Comment goes here.

Are you sure you want to Yes No • Be the first to comment

• Be the first to like this

### Generalized SEIR Model on Large Networks

1. 1. Generalized SEIR Model Amir Kermany, PhD. Solutions Architect, Health and Life Sciences Databricks
2. 2. Agenda ▪ Introduction to SEIR model for infectious diseases ▪ Deterministic vs Stochastic models ▪ Predicting Spread of Disease using seirplus package ▪ Study the effect of different policies on progress of disease with hyperopt and
3. 3. Modeling infectious disease Models are useful for ▪ Estimation: to estimate fundamental parameters (rate of spread, etc.) ▪ Forecasting: to project the spread of disease ▪ Inform policy: what are the impacts of different measures ? ▪ Behavior change: recommendations to the public (flattening the curve) ”All models are wrong, but some are useful”
4. 4. SIR Model ▪ SIR model is the simplest form of modeling the dynamics of infectious diseases in a closed population ▪ It assumes that individuals in the population can take one of the three states of: Susceptible, Infected or Removed (recover or die) ▪ The first example of such model is found in Kermack-McKendrick theory (1927- 1933) of infectious disease transmission S(usceptible) I(nfected) R(emoved)
5. 5. SEIR Model ▪ SEIR Model is a more general model that adds an extra state of Exposed ▪ This model is appropriate for diseases that have an incubation period (time between exposure and infection) S(usceptible), E(xposed) I(nfected) R(emoved) 𝛾𝜎β 𝛽 = rate of transmission per contact 𝜎= 1/𝜏 (𝜏 = incubation period) 𝛾 = recovery rate = 1/D (D = infectious period)𝜇! 𝜇!: fatality rate 𝜉= rate of re-infection
6. 6. SEIR Model ▪ SEIR Model is a more general model that adds an extra state of Exposed ▪ This model is appropriate for diseases that have an incubation period (time between exposure and infection) S(usceptible), E(xposed) I(nfected) R(emoved) 𝛾𝜎β 𝛽 = rate of transmission per contact 𝜎= 1/𝜏 (𝜏 = incubation period) 𝛾 = recovery rate = 1/D (D = infectious period)𝜇! 𝜇!: fatality rate
7. 7. Deterministic Model ▪ ̇𝑆 = −𝑆 !" # ▪ ̇𝐸 = 𝑆 !" # − 𝜎𝐸 ▪ ̇𝐼 = 𝜎𝐸 − 𝛾𝐼 − 𝜇" 𝐼 ▪ ̇𝑅 = 𝛾𝐼 ▪ ̇𝐹 = 𝜇" 𝐼 Assumptions: • Population size is large and it is constant • Susceptibility, recovery is independent of individual’s characteristics (age, ethnicity, comorbidities etc.) • Rate of spread is independent of population structure (homogenous population 𝜎β 𝜇! 𝛾 𝑁 = 𝑆 + 𝐸 + 𝐼 + 𝑅 https://github.com/ryansmcgee/seirsplus/blob/master/docs/SEIRSplus_Model.pdfSee:
8. 8. Deterministic Model with Testing ▪ ̇𝑆 = −𝑆 !" # − 𝑞𝛽\$ 𝑆 \$! # ▪ ̇𝐸 = 𝑆 !" # + 𝑆𝑞𝛽\$ \$! # − 𝜎𝐸 − 𝜃% 𝜓% 𝐸 ▪ ̇𝐼 = 𝜎𝐸 − 𝛾𝐼 − 𝜇" 𝐼 − 𝜃" 𝜓" 𝐼 ▪ ̇𝑅 = 𝛾𝐼 + 𝛾\$ 𝐷" ▪ ̇𝐹 = 𝜇" 𝐼 + 𝜇\$ 𝐷" ▪ ̇𝐷% = 𝜃% 𝜓% 𝐸 − 𝜎\$ 𝐷% ▪ ̇𝐷" = 𝜃" 𝜓" 𝐼 + 𝜎\$ 𝐷% − 𝛾\$ 𝐷" − 𝜇\$ 𝐷" 𝜎β 𝜇! 𝛾 𝜃" 𝜓" 𝜃! 𝜓! 𝛾# 𝜇# 𝜎# https://github.com/ryansmcgee/seirsplus/blob/master/docs/SEIRSplus_Model.pdfSee:
9. 9. Running Generalized SEIR model in python ▪ We use seriplus : https://github.com/ryansmcgee/seirsplus/ implementation of SEIR with network effects ▪ Using this method you can specify different scenarios. For example quarantine, case tracking and testing, and custom interaction networks ▪ We use hyperopt with spark trials to study the impact of each parameter on fatality ▪ We also use mlflow experiments for tracking and explaining the effect of each parameter
10. 10. Deterministic model Numeric solution to SEIR dynamical system Progress of infections assuming no intervention
11. 11. Deterministic model Adding social distancing (reducing beta) Progress of infections with none-medical interventions
12. 12. Fitting data to model ▪ Using the deterministic model one can fit data to estimate parameters in the system (e.g. 𝛽, 𝜎, 𝛾) ▪ This can be done using approximate solutions to the ODE ▪ In python for example you can use curve fitting tools such as scipy.optimize.curve_fit ▪ A heuristic approach is to minimize distance between the precited curve and data while searching over a grid of parameters Estimation
13. 13. Comparing US data data with SEIR model prediction 𝑁 = 300𝑒6 𝛽 = 0.155 𝜎 = 1 5.2 𝛾 = 1 12.39 𝜇! = 0.004 𝑁\$ = 1000 Overall confirmed infections In US (/databricks-datasets//COVID/USAFacts/)
14. 14. Use Hyperopt to minimize the Euclidean distance between predicted number of deaths and actual deaths
15. 15. What is the impact of different interventions? ▪ Impose social distancing (reduce beta) for a length of time dt, starting at a time t0 ▪ Use hyperopt to minimize the cost loss=F+x*dt, where x is a cost per day of lockdown and F is the total fatalities Inform policy
16. 16. Stochastic vs Deterministic Simulation Determinist model assumptions: ▪ Population size is large and is constant ▪ Susceptibility, recovery is independent of individual’s characteristics (age, ethnicity, comorbidities etc) • Rate of spread is independent of population structure and variation in social interactions
17. 17. Stochastic vs Deterministic Simulation
18. 18. Stochastic vs Deterministic Simulation Determinist model assumptions: ▪ Population size is large and is constant ▪ Susceptibility, recovery is independent of individual’s characteristics (age, ethnicity, comorbidities etc) • Rate of spread is independent of population structure and variation in social interactions
19. 19. Stochastic vs Deterministic Simulation Determinist model assumptions: ▪ Population size is large and is constant ▪ Susceptibility, recovery is independent of individual’s characteristics (age, ethnicity, comorbidities etc) • Rate of spread is independent of population structure and variation in social interactions
20. 20. Stochastic Model with Network Effect
21. 21. Stochastic Model with Network Effect I
22. 22. Stochastic Model with Network Effect E I 𝑝𝛽 Pr 𝑆 → 𝐸 = p𝛽𝐼 𝑁
23. 23. Stochastic Model with Network Effect E I 1 − 𝑝 𝛽 𝑝𝛽 Pr 𝑆 → 𝐸 = p𝛽𝐼 𝑁 + 1 − 𝑝 𝛽 𝑁! 𝑀
24. 24. Stochastic Model with Network Effect I I 𝜎 1 − 𝑝 𝛽 𝑝𝛽 Pr 𝑆 → 𝐸 = p𝛽𝐼 𝑁 + 1 − 𝑝 𝛽 𝑁! 𝑀 Pr 𝐸 → 𝐼 = 𝜎
25. 25. Stochastic Model with Network Effect I E I 𝜎 1 − 𝑝 𝛽 𝑝𝛽 Pr 𝑆 → 𝐸 = p𝛽𝐼 𝑁 + 1 − 𝑝 𝛽 𝑁! 𝑀 Pr 𝐸 → 𝐼 = 𝜎
26. 26. Stochastic Model with Network Effect I I I E 𝜎 1 − 𝑝 𝛽 𝑝𝛽 Pr 𝑆 → 𝐸 = p𝛽𝐼 𝑁 + 1 − 𝑝 𝛽 𝑁! 𝑀 Pr 𝐸 → 𝐼 = 𝜎
27. 27. Stochastic Model with Network Effect I I R E 𝜎 1 − 𝑝 𝛽 𝛾 𝑝𝛽 Pr 𝑆 → 𝐸 = p𝛽𝐼 𝑁 + 1 − 𝑝 𝛽 𝑁! 𝑀 Pr 𝐸 → 𝐼 = 𝜎 Pr 𝐼 → 𝑅 = 𝛾
28. 28. Stochastic Model with Network Effect I I R E 𝜎 1 − 𝑝 𝛽 𝛾 𝑝𝛽 Pr 𝑆 → 𝐸 = p𝛽𝐼 𝑁 + 1 − 𝑝 𝛽 𝑁! 𝑀 Pr 𝐸 → 𝐼 = 𝜎 Pr 𝐼 → 𝑅 = 𝛾
29. 29. Stochastic model with network interactions
30. 30. Parallel simulations with
31. 31. 𝑁 = 1000 𝑝 = 0.5
32. 32. 𝑁 = 1000 𝑝 = 0.5 𝑝 = 0.1
33. 33. 𝑁 = 1000 𝑝 = 0.5 𝑝 = 0.1𝑝 = 0.1 𝑁 = 10000
34. 34. Conclusions ▪ Use Hyperopt+ in databricks ML Runtime to track different experiments and easily visualize the effect of different parameters on the spread of disease ▪ Use to parallelize different runs of the stochastic model ▪ Network structure has a significant impact on the spread of the disease even in large populations
35. 35. Questions