1 00:00:00,660 --> 00:00:02,370 In the last video we saw to go 2 00:00:02,370 --> 00:00:07,050 from a discrete SIS model to a continuous model. 3 00:00:07,050 --> 00:00:07,883 And here what I'd like 4 00:00:07,883 --> 00:00:11,730 to show is the power of the continuous formulation. 5 00:00:11,730 --> 00:00:14,940 Just because once we write it 6 00:00:14,940 --> 00:00:19,940 as differential equation, models are way easier to solve 7 00:00:20,430 --> 00:00:23,640 in a way because we unlock the power of calculus 8 00:00:23,640 --> 00:00:25,653 and of a lot of mathematics. 9 00:00:26,940 --> 00:00:28,980 The SIS model is also interesting 10 00:00:28,980 --> 00:00:31,500 because it's the simplest model we've seen so far. 11 00:00:31,500 --> 00:00:33,600 We've discussed some more complicated ones 12 00:00:33,600 --> 00:00:36,030 without conserved population 13 00:00:36,030 --> 00:00:38,250 and with a lot more than two states. 14 00:00:38,250 --> 00:00:43,250 But this one is interesting because we took the complexity 15 00:00:43,260 --> 00:00:46,710 of disease spread and reduced it to two boxes. 16 00:00:46,710 --> 00:00:48,750 Meaning we have a human population that we put 17 00:00:48,750 --> 00:00:51,720 into two boxes that we call S and I, 18 00:00:51,720 --> 00:00:54,240 depending on whether individuals are susceptible 19 00:00:54,240 --> 00:00:56,160 or we put them in the S box or infectious 20 00:00:56,160 --> 00:00:57,723 we put them in the I box. 21 00:00:58,590 --> 00:01:01,200 Then we had two arrows for two mechanisms. 22 00:01:01,200 --> 00:01:03,630 There's a mechanism for infection. 23 00:01:03,630 --> 00:01:05,700 So as individuals go to "I" 24 00:01:05,700 --> 00:01:07,533 and mechanisms for recovery. 25 00:01:10,920 --> 00:01:12,150 To write down the equations, 26 00:01:12,150 --> 00:01:14,730 we did a lot of approximations and idealizations. 27 00:01:14,730 --> 00:01:17,640 We assume, you know a fully connected population, 28 00:01:17,640 --> 00:01:19,653 a mean field approximation. 29 00:01:20,550 --> 00:01:23,470 We saw how the time derivative 30 00:01:26,280 --> 00:01:29,820 of S which I'm often gonna write S dot, 31 00:01:29,820 --> 00:01:31,350 this is a notation from Newton, 32 00:01:31,350 --> 00:01:33,090 which I like 'cause it's just a little simpler. 33 00:01:33,090 --> 00:01:36,153 The dot just means time derivative of S. 34 00:01:37,530 --> 00:01:39,820 Could be simply written as minus beta SI 35 00:01:40,680 --> 00:01:44,010 by assuming very small time steps, 36 00:01:44,010 --> 00:01:46,980 gamma of I, here it's just an average. 37 00:01:46,980 --> 00:01:48,900 We're tracking the average state of the system. 38 00:01:48,900 --> 00:01:51,483 That's what this differential equation is doing. 39 00:01:53,400 --> 00:01:54,662 If you look at different places, 40 00:01:54,662 --> 00:01:56,130 we're gonna be some reading, 41 00:01:56,130 --> 00:01:58,320 doing some readings about some of these models. 42 00:01:58,320 --> 00:02:00,160 You might also see stuff like 43 00:02:01,860 --> 00:02:06,067 minus beta SI over N plus gamma I. 44 00:02:09,120 --> 00:02:10,800 This is just a different formulation, 45 00:02:10,800 --> 00:02:15,270 really it is beta over N is just using different units. 46 00:02:15,270 --> 00:02:18,720 Beta over N is a like shifted transmission rate. 47 00:02:18,720 --> 00:02:21,360 And the question is whether your beta is formulated 48 00:02:21,360 --> 00:02:24,330 as a per contact, in which case you don't need the over N 49 00:02:24,330 --> 00:02:27,783 or as an overall transmission rate in which case you you do. 50 00:02:28,740 --> 00:02:29,760 So there's different ways 51 00:02:29,760 --> 00:02:31,290 and again, I'm showing this just 52 00:02:31,290 --> 00:02:35,747 because I wanna stress that there's no one way 53 00:02:37,260 --> 00:02:40,200 to write an equation for some of these models. 54 00:02:40,200 --> 00:02:41,910 It depends on what units you're using, 55 00:02:41,910 --> 00:02:43,680 what approximations you're doing. 56 00:02:43,680 --> 00:02:47,553 But they're not more valid one than another really. 57 00:02:49,950 --> 00:02:53,400 We also saw, once you go through the process 58 00:02:53,400 --> 00:02:56,460 of writing those equations what's useful is to think 59 00:02:56,460 --> 00:02:58,920 of it as writing one equation 60 00:02:58,920 --> 00:03:01,203 per compartment per state in the system. 61 00:03:02,130 --> 00:03:03,840 And then you have some negative terms 62 00:03:03,840 --> 00:03:05,970 for every mechanisms that leaves. 63 00:03:05,970 --> 00:03:10,260 So every arrow that leaves your box needs a negative terms 64 00:03:10,260 --> 00:03:13,140 and that's this minus beta SI here. 65 00:03:13,140 --> 00:03:15,300 And every mechanism that enters your box, 66 00:03:15,300 --> 00:03:17,470 anything that flows in the system 67 00:03:18,900 --> 00:03:21,603 needs a positive term in your equation. 68 00:03:22,500 --> 00:03:26,250 And so we could also write the "I" dot equation very quickly 69 00:03:26,250 --> 00:03:30,900 by realizing that everything that leaves S has to enter I. 70 00:03:30,900 --> 00:03:33,250 So I need a plus beta SI term 71 00:03:34,530 --> 00:03:39,090 and everything that leaves "I" was entering S. 72 00:03:39,090 --> 00:03:43,863 So my gamma "I" is now negative 'cause it's leaving. 73 00:03:46,860 --> 00:03:49,661 There's another way to realize 74 00:03:49,661 --> 00:03:53,610 how easily you can write this equation 75 00:03:53,610 --> 00:03:58,230 for "I" dot given S dot, which is the fact 76 00:03:58,230 --> 00:04:00,570 that we here have a conserved population. 77 00:04:00,570 --> 00:04:04,890 We assumed a closed system, 78 00:04:04,890 --> 00:04:07,230 meaning that there's no arrows flowing in 79 00:04:07,230 --> 00:04:12,230 or out of our boxes into the rest of the universe. 80 00:04:12,540 --> 00:04:13,910 So it's a closed system. 81 00:04:13,910 --> 00:04:18,910 So I have S plus I equal to N for all times. 82 00:04:23,520 --> 00:04:26,433 And if I take the time derivative of this. 83 00:04:32,610 --> 00:04:35,070 Well I get S dot plus I dot, 84 00:04:35,070 --> 00:04:36,990 the derivative is the linear operator. 85 00:04:36,990 --> 00:04:39,330 I can just sum my derivatives. 86 00:04:39,330 --> 00:04:42,060 I get N dot which really is the derivative 87 00:04:42,060 --> 00:04:43,560 of a constant with zero. 88 00:04:43,560 --> 00:04:44,700 The number of people 89 00:04:44,700 --> 00:04:46,410 in the system is not changing in time. 90 00:04:46,410 --> 00:04:49,320 Again, there's nothing flowing in or out. 91 00:04:49,320 --> 00:04:51,960 So this gives me that S dot 92 00:04:51,960 --> 00:04:54,090 has to be equal to minus "I" dot. 93 00:04:54,090 --> 00:04:56,220 So I know I can just flip all terms. 94 00:04:56,220 --> 00:04:58,590 The reason why I'm highlighting this different perspective 95 00:04:58,590 --> 00:05:03,590 on it is because whenever you have a conserved population 96 00:05:03,720 --> 00:05:05,730 even if you have like 20 different states, 97 00:05:05,730 --> 00:05:08,910 you know that the sum of all your differential equations 98 00:05:08,910 --> 00:05:10,080 should be equal to zero 99 00:05:10,080 --> 00:05:12,960 'cause nothing's leaving the system or entering it. 100 00:05:12,960 --> 00:05:16,230 And so that's a very useful sanity check 101 00:05:16,230 --> 00:05:18,330 to make sure that you wrote your equation 102 00:05:18,330 --> 00:05:20,220 in a correct way is 103 00:05:20,220 --> 00:05:22,650 whether do they respect your conserved population 104 00:05:22,650 --> 00:05:23,883 do they sum to zero? 105 00:05:24,900 --> 00:05:25,863 So that's useful. 106 00:05:29,010 --> 00:05:30,390 The formulation in terms 107 00:05:30,390 --> 00:05:32,730 of differential equation is great to do things 108 00:05:32,730 --> 00:05:36,123 like flow diagrams, which we did for discrete models. 109 00:05:38,880 --> 00:05:41,730 Really those differential equations were 110 00:05:41,730 --> 00:05:44,550 in calculus were often just like given equations 111 00:05:44,550 --> 00:05:46,000 and we're told to solve them. 112 00:05:47,760 --> 00:05:49,950 What they mean is, you know 113 00:05:49,950 --> 00:05:52,950 what is the speed of the system at any given point. 114 00:05:52,950 --> 00:05:56,400 So these S dot and "I" dot are plotting this flow diagram, 115 00:05:56,400 --> 00:05:59,310 give me what S is, I'm gonna know what "I" is, 116 00:05:59,310 --> 00:06:00,870 it's gonna be N minus S 117 00:06:00,870 --> 00:06:04,530 and I'm gonna know what my speed is in the S space 118 00:06:04,530 --> 00:06:07,410 and the I space and it's very easy to plug those diagrams. 119 00:06:07,410 --> 00:06:09,903 They're giving me the direction of the system. 120 00:06:10,740 --> 00:06:13,620 And often what we're gonna care about are is 121 00:06:13,620 --> 00:06:16,110 where is this system gonna end up? 122 00:06:16,110 --> 00:06:17,460 And what does that mean is 123 00:06:17,460 --> 00:06:20,610 when are S and I gonna stop moving? 124 00:06:20,610 --> 00:06:22,830 So that's what we call a fixed point 125 00:06:22,830 --> 00:06:24,603 or an equilibrium point. 126 00:06:26,370 --> 00:06:28,500 The term equilibrium makes a little more sense 127 00:06:28,500 --> 00:06:29,670 in classic physics model. 128 00:06:29,670 --> 00:06:31,070 If you think of the pendulum 129 00:06:32,190 --> 00:06:34,230 which is damped and eventually stops moving 130 00:06:34,230 --> 00:06:36,783 now it's at equilibrium, it's fixed. 131 00:06:37,770 --> 00:06:40,650 Here it's sort of a what we call a dynamical equilibrium. 132 00:06:40,650 --> 00:06:43,470 So the quantities S and I are gonna stop moving 133 00:06:43,470 --> 00:06:46,230 eventually they're gonna become fixed in time. 134 00:06:46,230 --> 00:06:48,330 But underlying this there are still people 135 00:06:48,330 --> 00:06:50,010 getting infected and recovering. 136 00:06:50,010 --> 00:06:51,090 It's just that the number 137 00:06:51,090 --> 00:06:53,700 of expected infection is gonna manage the number 138 00:06:53,700 --> 00:06:57,423 of expected recovery so that S and I are fixed. 139 00:06:59,190 --> 00:07:03,033 So how do we find those fixed points? 140 00:07:03,930 --> 00:07:08,930 Well, it's the coordinates S and I such that our derivative 141 00:07:10,680 --> 00:07:13,833 in time is equal to zero, things are not moving. 142 00:07:16,140 --> 00:07:20,163 So I'm looking to solve this equation. 143 00:07:22,380 --> 00:07:23,790 Well, and if I go really quickly, 144 00:07:23,790 --> 00:07:26,070 I can cancel out my "I", 145 00:07:26,070 --> 00:07:29,340 I just have minus beta S plus gamma equals zero. 146 00:07:29,340 --> 00:07:33,510 So that gives me S star. 147 00:07:33,510 --> 00:07:37,030 I'm often gonna use star to denote dynamical equilibrium 148 00:07:38,880 --> 00:07:40,740 and equal to gamma over beta. 149 00:07:44,460 --> 00:07:46,980 So I can do a little thought experiment. 150 00:07:46,980 --> 00:07:48,510 Where does my system end up? 151 00:07:48,510 --> 00:07:51,240 This S star for different diseases 152 00:07:51,240 --> 00:07:54,633 with a whole range of different beta from zero to infinity. 153 00:07:55,860 --> 00:07:58,980 Well, at infinity I'm gonna start very close to zero, right? 154 00:07:58,980 --> 00:08:02,190 Gamma over beta goes to zero and beta goes to infinity. 155 00:08:02,190 --> 00:08:03,023 And that makes sense. 156 00:08:03,023 --> 00:08:05,310 People are always gonna recover 157 00:08:05,310 --> 00:08:08,340 but if they get infected infinity fast, 158 00:08:08,340 --> 00:08:10,770 they're not gonna stay in the state for very long. 159 00:08:10,770 --> 00:08:13,470 So the larger beta is the closer I am 160 00:08:13,470 --> 00:08:16,210 to this S star equal zero 161 00:08:17,790 --> 00:08:19,440 and then it's gonna do something like this 162 00:08:19,440 --> 00:08:22,263 and blow up as better approaches zero. 163 00:08:23,400 --> 00:08:28,400 Well that's the problem because I know that S 164 00:08:28,800 --> 00:08:31,173 has to stay between zero and N. 165 00:08:34,650 --> 00:08:38,847 So there's a point here where my solution is crossing N 166 00:08:40,410 --> 00:08:41,660 and that's a big problem. 167 00:09:12,473 --> 00:09:16,320 So really the problem is that I went too quickly 168 00:09:16,320 --> 00:09:18,900 when I canceled out my "I" terms. 169 00:09:18,900 --> 00:09:20,640 I is not a constant here, 170 00:09:20,640 --> 00:09:22,140 it's another variable in the system. 171 00:09:22,140 --> 00:09:25,563 It's just that I know its value, it's N minus S. 172 00:09:26,460 --> 00:09:30,093 So if I rewrite my equation like this, 173 00:09:32,460 --> 00:09:36,090 I'm highlighting the fact that I expect a quadratic term. 174 00:09:36,090 --> 00:09:39,240 I have a plus beta times S squared. 175 00:09:39,240 --> 00:09:40,620 So it's a quadratic equation. 176 00:09:40,620 --> 00:09:44,310 So I know that I have two solutions to this state 177 00:09:44,310 --> 00:09:48,600 and the other solution is actually really easy to see. 178 00:09:48,600 --> 00:09:50,730 So I'm gonna write this as S1 star 179 00:09:50,730 --> 00:09:55,090 with my gamma over beta, but I have another solution 180 00:09:56,700 --> 00:10:00,933 which is S2 star, which is equal to N. 181 00:10:07,080 --> 00:10:10,540 And this is matched with I2 star solution 182 00:10:12,540 --> 00:10:14,489 equal to M minus S equal to zero. 183 00:10:14,489 --> 00:10:17,220 So that's my disease free state 184 00:10:17,220 --> 00:10:19,230 and of course that's a solution. 185 00:10:19,230 --> 00:10:22,800 Of course, if I don't have anyone infectious in the system, 186 00:10:22,800 --> 00:10:24,120 I know that I'm a steady state. 187 00:10:24,120 --> 00:10:27,390 There cannot be infections without infectious individual 188 00:10:27,390 --> 00:10:30,420 and there cannot be recovery without infectious individuals. 189 00:10:30,420 --> 00:10:33,870 Okay, so now I have this interesting point 190 00:10:33,870 --> 00:10:35,620 where my two solutions cross 191 00:10:36,589 --> 00:10:38,880 and what I wanna know is really what's going on, 192 00:10:38,880 --> 00:10:43,470 which state is my system going to go to 193 00:10:43,470 --> 00:10:44,910 if I run a simulation of it 194 00:10:44,910 --> 00:10:48,330 or if I integrate my differential equation? 195 00:10:48,330 --> 00:10:51,300 Both of these approaches we're gonna see in the next videos. 196 00:10:51,300 --> 00:10:52,950 But here I wanna try and make a prediction. 197 00:10:52,950 --> 00:10:56,790 What's state, the red state which is bad or the blue state 198 00:10:56,790 --> 00:11:00,573 which is good without disease, is my system going to go to? 199 00:11:04,260 --> 00:11:09,260 So let me just take a picture of this here 200 00:11:16,080 --> 00:11:21,080 and we're gonna do what we call a stability analysis. 201 00:11:21,210 --> 00:11:23,160 I don't know why my picture didn't work 202 00:11:24,120 --> 00:11:28,410 Just, I'm looking at S star, oops, 203 00:11:28,410 --> 00:11:30,130 as a function of different betas 204 00:11:30,990 --> 00:11:34,870 and I have a S1 star equal to gamma over beta 205 00:11:34,870 --> 00:11:37,360 and a S2 star in blue 206 00:11:40,110 --> 00:11:41,613 equal to N. 207 00:11:46,170 --> 00:11:51,060 Okay, well what's stability analysis means is I want 208 00:11:51,060 --> 00:11:53,790 to put myself in one of those fixed points 209 00:11:53,790 --> 00:11:56,490 and asked if I move away from it, 210 00:11:56,490 --> 00:11:58,260 which direction am I gonna move in. 211 00:11:58,260 --> 00:12:01,470 And so if I'm at S equal N which is a fixed point 212 00:12:01,470 --> 00:12:04,380 and I introduce a little bit of infectious individual, 213 00:12:04,380 --> 00:12:06,240 is my derivative gonna be positive? 214 00:12:06,240 --> 00:12:08,910 Meaning that I go like down from the blue state, 215 00:12:08,910 --> 00:12:11,580 do I go back up to the good disease free state 216 00:12:11,580 --> 00:12:15,270 or do I go back further down to the red line. 217 00:12:15,270 --> 00:12:18,390 Stability is gonna help us understand 218 00:12:18,390 --> 00:12:22,530 what the impact of introducing a disease is gonna be. 219 00:12:22,530 --> 00:12:25,080 So what I like to do in this case is to go back 220 00:12:25,080 --> 00:12:26,793 to our differential equation. 221 00:12:35,160 --> 00:12:38,080 And I am gonna ask if I introduce the disease 222 00:12:39,840 --> 00:12:42,750 for every infectious individual that I introduce 223 00:12:42,750 --> 00:12:46,170 what is gonna be the rate of change of S dot? 224 00:12:46,170 --> 00:12:48,210 So really I'm looking at S dot over I. 225 00:12:48,210 --> 00:12:50,310 So this is a useful perspective to take 226 00:12:50,310 --> 00:12:52,970 and this is minus beta S plus gamma. 227 00:13:00,840 --> 00:13:01,673 Okay. 228 00:13:03,240 --> 00:13:08,240 So if I'm at the fixed point S2 star, 229 00:13:09,150 --> 00:13:12,003 this is minus beta N plus gamma. 230 00:13:12,960 --> 00:13:17,730 And that thing can be greater or smaller than zero. 231 00:13:17,730 --> 00:13:20,523 And I want to know which is it for a given disease. 232 00:13:22,410 --> 00:13:25,230 So often people are gonna summarize this equation, 233 00:13:25,230 --> 00:13:30,230 this question really as the basic reproduction number. 234 00:13:32,040 --> 00:13:33,960 And if you've followed some of the meatus 235 00:13:33,960 --> 00:13:35,940 especially early on in the COVID outbreak, 236 00:13:35,940 --> 00:13:38,223 you've probably heard this phrase before. 237 00:13:39,750 --> 00:13:44,130 So my question here becomes is this number R0 which 238 00:13:46,530 --> 00:13:49,413 in this case is equal to beta N over gamma, 239 00:13:50,250 --> 00:13:52,143 is it greater than one? 240 00:13:53,850 --> 00:13:55,890 So if it's smaller than one, 241 00:13:55,890 --> 00:13:58,803 so if beta N over gamma is smaller than one, 242 00:13:59,940 --> 00:14:04,593 that means that this equation here is positive. 243 00:14:05,760 --> 00:14:08,760 So that happens, let's say if gamma's too big, 244 00:14:08,760 --> 00:14:11,110 beta N over gamma is gonna be smaller than one. 245 00:14:11,970 --> 00:14:13,530 Or if beta is too small. 246 00:14:13,530 --> 00:14:15,780 So if beta is too small, what do we have? 247 00:14:15,780 --> 00:14:17,670 We start at the blue state here, 248 00:14:17,670 --> 00:14:19,230 we move a little bit away from it, 249 00:14:19,230 --> 00:14:22,380 we go back up 'cause that's beta is too small. 250 00:14:22,380 --> 00:14:24,360 This our equation is gonna be positive. 251 00:14:24,360 --> 00:14:26,463 Our S dot over I is gonna be positive. 252 00:14:27,780 --> 00:14:32,490 If beta is greater and is big enough 253 00:14:32,490 --> 00:14:35,490 such that beta N over gamma gonna be greater than one, 254 00:14:35,490 --> 00:14:38,460 then our S dot over I is gonna be negative. 255 00:14:38,460 --> 00:14:41,910 And as we move away from the disease free state, 256 00:14:41,910 --> 00:14:43,623 we collapse down to the red curve. 257 00:14:46,440 --> 00:14:49,650 So this line here is where our R0 is equal to one. 258 00:14:49,650 --> 00:14:51,750 That's where our two solution meet. 259 00:14:51,750 --> 00:14:54,303 And that's often called the epidemic threshold. 260 00:14:55,860 --> 00:15:00,750 Meaning that we can use this little model to try 261 00:15:00,750 --> 00:15:02,610 and determine whether our disease is gonna take 262 00:15:02,610 --> 00:15:05,250 over the system or not. 263 00:15:05,250 --> 00:15:06,960 And that's a simple analysis. 264 00:15:06,960 --> 00:15:09,963 We look for fixed point, we look for their stability. 265 00:15:11,130 --> 00:15:12,810 It's nothing too complicated. 266 00:15:12,810 --> 00:15:14,220 But if you can go through it, 267 00:15:14,220 --> 00:15:16,500 really this is at the core, 268 00:15:16,500 --> 00:15:18,270 this is state-of-the-art disease modeling. 269 00:15:18,270 --> 00:15:20,850 It's at the core of our understanding of diseases. 270 00:15:20,850 --> 00:15:23,010 That's why early on people were so focused 271 00:15:23,010 --> 00:15:26,310 on measuring this basic reproduction number, R0, 272 00:15:26,310 --> 00:15:27,870 there are movies about it. 273 00:15:27,870 --> 00:15:30,150 So really we're already, 274 00:15:30,150 --> 00:15:31,770 in tools that are super useful 275 00:15:31,770 --> 00:15:35,910 in helping us understand the complexity of the real world. 276 00:15:35,910 --> 00:15:38,370 If we care about the time evolution, like, okay 277 00:15:38,370 --> 00:15:41,280 I know I'm gonna go to the red state, I wanna know how fast, 278 00:15:41,280 --> 00:15:44,340 what is my evolution, my time series gonna look like? 279 00:15:44,340 --> 00:15:46,890 Then we might turn to different tools, then analysis. 280 00:15:46,890 --> 00:15:48,870 We might look at numerical integration 281 00:15:48,870 --> 00:15:50,283 which we're gonna see next. 282 00:15:51,750 --> 00:15:55,080 If we want to look at the impact of randomness 283 00:15:55,080 --> 00:15:57,450 then we might look at numerical simulations. 284 00:15:57,450 --> 00:15:59,040 And we're gonna see that too. 285 00:15:59,040 --> 00:16:04,040 But we really can't underestimate how important it is 286 00:16:04,320 --> 00:16:07,020 to just look at the differential equation 287 00:16:07,020 --> 00:16:09,600 and try to get some mathematical insights 288 00:16:09,600 --> 00:16:11,250 from their basic structure. 289 00:16:11,250 --> 00:16:12,480 So that's a full story. 290 00:16:12,480 --> 00:16:15,540 That's how we understand disease spread to this day. 291 00:16:15,540 --> 00:16:19,380 And I hope it's useful in illustrating the power 292 00:16:19,380 --> 00:16:23,760 of modeling even when we use simple toy models. 293 00:16:23,760 --> 00:16:25,320 So I'll see you on the next ones 294 00:16:25,320 --> 00:16:27,063 for some more numerical tools.