Implementing a SIR Disease Model in Python [1/2]

  Рет қаралды 19,625

Greg Winther

Greg Winther

Күн бұрын

This video is part one of two (part two: • Simulating the Zombie ... ) on how one constructs simple compartmental models in epidemiology. I construct a set of ordinary differential equations (ODE) to solve the progression of an infectious disease in a given population. The set of ODEs are solved using the simplest of integrators, the Forward Euler method, in Python. This project is inspired by problems from Hans Petter Langtangen's book (amzn.to/31IWLCd) on Scientific Programming in Python. This is probably the best introductory text on scientific programming (even though it is written for Python 2).
UPDATE Sep 2020
I have created a tutorial series on the ODESolver library that I start implementing in this video. Check it out here: • ODESolver python library
Code for written in this video is here: github.com/gregwinther/youtube
#SIRmodel #python #biomathematics
Music: Lazy Days by Vanilla

Пікірлер: 27
@GregWintherArtist
@GregWintherArtist 5 жыл бұрын
Overview of the SIR equations (0:43), implementation of ODESolver (6:05), implementation of forward Euler integrator (14:18), implementation of SIR problem class (16:20), analysis and results (24:25).
@raptorrogue4227
@raptorrogue4227 4 жыл бұрын
Damn this is all so advanced for me 😂 but couldn't stop watching anyway. I will get back here when I can finally understand everything 😂
@happyfish3961
@happyfish3961 29 күн бұрын
Thank you for the tutorial
@jacopopasqualini2551
@jacopopasqualini2551 4 жыл бұрын
Thank you man, very useful tutorial... appreciated the OOP shape
@dongli7157
@dongli7157 4 жыл бұрын
excellent work!
@stephenduncanson6154
@stephenduncanson6154 4 жыл бұрын
Really good stuff
@felipechoy2156
@felipechoy2156 4 жыл бұрын
Wow, now on COVID-19 this is really useful. Thanks a lot!
@jamelehasaadasaad2797
@jamelehasaadasaad2797 2 ай бұрын
Thanks !
@BrazilianDev
@BrazilianDev 4 жыл бұрын
Very nice approach. But I confess this problem itself is a bit confuse.
@LivierRenteria
@LivierRenteria 4 жыл бұрын
Thank you!!!!!!!
@Mnikouei
@Mnikouei 4 жыл бұрын
Hi, It was very very nice and useful video , would you please teach me how to do fit the data with this model too ? fit curve ...
@ankujasriva6085
@ankujasriva6085 4 жыл бұрын
Amazing video!! Really helpful!! Though I wanted to know/suggest... Can you do a video of fitting SIR model to covid19 dataset!!?? Pretty please!
@mujahid8936
@mujahid8936 Жыл бұрын
hi ankuja...i saw you posted this 2 years ago im also doing my project on SIR model and i need to fit it to a covid dataset...if you got anything for me please help
@juliusbuch2387
@juliusbuch2387 4 жыл бұрын
When referring to the ODEsolver module to get the ForwardEuler I get an import error, how do I solve this? Thanks for the amazing video!
@GregWintherArtist
@GregWintherArtist 4 жыл бұрын
Hi. You can install ODESolver from my github with pip. Type the following in your terminal: pip install git+github.com/gregwinther/youtube Alternatively you can import sys to your script and append the path with where you keep ODESolver: import sys; sys.path.append([path to folder with ODESolver])
@juliusbuch2387
@juliusbuch2387 4 жыл бұрын
@@GregWintherArtist Alright so now the code is working fine and running without errors. However when I run it, my pyplot does not show? What can I do about this?
@p.t.g.b.8785
@p.t.g.b.8785 4 жыл бұрын
At 28:30 I have a problem since for Ebola the beta is 0.5, and the graph look like something outa space If I use your model. Is it possible that you help me out
@GregWintherArtist
@GregWintherArtist 4 жыл бұрын
Hello! Having a beta that high means that everyone gets infected almost instantly. Such a rapid change is difficult for the integrator (ForwardEuler) to handle. You need to increase the number of time steps. Hundred thousand worked fine for me: time_steps = np.linspace(0, 60, 100001). To model ebola more correctly you would probably need to extend this model to include deaths as well.
@p.t.g.b.8785
@p.t.g.b.8785 4 жыл бұрын
@@GregWintherArtist Thank you very much for your quick response! Keep up the great work !!!
@TheDeprant
@TheDeprant 4 жыл бұрын
Greg, in minute 26.26, what terminal do you use? How to make the green arrow? :) I am not understand.
@GregWintherArtist
@GregWintherArtist 4 жыл бұрын
I use "Oh My Zsh" 🤗 Check out ohmyz.sh. I think the green arrow is there because of the git plugin (Not sure, a long time since I switched to z shell).
@TheDeprant
@TheDeprant 4 жыл бұрын
@@GregWintherArtist let me try to.. thanks Greg
@TheDeprant
@TheDeprant 4 жыл бұрын
I wrote all the text like yours in Visual code, but I want to show the graph like your graph but that is my problem, I can not write it in the terminal. ☺️☺️
@haakonvt
@haakonvt 4 жыл бұрын
Jøsses, blitt youtuber nå da?! Kuuult
@GregWintherArtist
@GregWintherArtist 4 жыл бұрын
😎
@fariharaha8100
@fariharaha8100 3 жыл бұрын
Funny watching this in 2020 while the virus is mutating
Simulating the Zombie Apocalypse with Python [2/2]
30:10
Greg Winther
Рет қаралды 5 М.
SIR Model for Epidemiology, Ordinary Differential Equations
26:33
Dr. Bevin Maultsby
Рет қаралды 2 М.
Gym belt !! 😂😂  @kauermtt
00:10
Tibo InShape
Рет қаралды 17 МЛН
Slow motion boy #shorts by Tsuriki Show
00:14
Tsuriki Show
Рет қаралды 9 МЛН
Red❤️+Green💚=
00:38
ISSEI / いっせい
Рет қаралды 85 МЛН
SIR Model For Disease Spread- 1. Introduction
10:10
Brian Sullivan
Рет қаралды 43 М.
This pattern breaks, but for a good reason | Moser's circle problem
16:13
Why Does Diffusion Work Better than Auto-Regression?
20:18
Algorithmic Simplicity
Рет қаралды 253 М.
Unlocking your CPU cores in Python (multiprocessing)
12:16
mCoding
Рет қаралды 299 М.
SIR Model with Python (Stochastic Version)
27:37
Mike Saint-Antoine
Рет қаралды 2,3 М.
The MATH of Pandemics | Intro to the SIR Model
15:35
Dr. Trefor Bazett
Рет қаралды 301 М.
Water powered timers hidden in public restrooms
13:12
Steve Mould
Рет қаралды 475 М.
How do mathematicians model infectious disease outbreaks?
1:04:19
Oxford Mathematics
Рет қаралды 49 М.
My iPhone 15 pro max 😱🫣😂
0:21
Nadir Show
Рет қаралды 725 М.
Какой ноутбук взять для учёбы? #msi #rtx4090 #laptop #юмор #игровой #apple #shorts
0:18
Better Than Smart Phones☠️🤯 | #trollface
0:11
Not Sanu Moments
Рет қаралды 15 МЛН
Kumanda İle Bilgisayarı Yönetmek #shorts
0:29
Osman Kabadayı
Рет қаралды 2,2 МЛН