1 00:00:01,590 --> 00:00:04,410 Okay, we're going to start week four, 2 00:00:04,410 --> 00:00:07,110 and with our first look at continuous model 3 00:00:07,110 --> 00:00:08,280 with a very short video. 4 00:00:08,280 --> 00:00:10,570 This would be, you know, super simple 5 00:00:12,360 --> 00:00:14,460 but there are a lot of key steps. 6 00:00:14,460 --> 00:00:16,050 So simple isn't quite the right word. 7 00:00:16,050 --> 00:00:20,400 I think the idea is that we want to do something 8 00:00:20,400 --> 00:00:22,740 that is straightforward in theory. 9 00:00:22,740 --> 00:00:24,960 We just want to take discrete models 10 00:00:24,960 --> 00:00:28,293 where we evolve a system, one step at a time, 11 00:00:29,460 --> 00:00:32,430 using a given set of rules and mechanisms. 12 00:00:32,430 --> 00:00:34,830 And then we want to say that those steps occur 13 00:00:34,830 --> 00:00:39,330 over progressively smaller timescales, right? 14 00:00:39,330 --> 00:00:41,760 So we could have models, we've discussed models, 15 00:00:41,760 --> 00:00:45,030 where we have changes of the order of each day. 16 00:00:45,030 --> 00:00:46,320 All right, so we update the rules. 17 00:00:46,320 --> 00:00:48,390 What happens on campus today 18 00:00:48,390 --> 00:00:51,660 determines what's going to be on campus tomorrow. 19 00:00:51,660 --> 00:00:54,120 Now let's say that our rules are over one hour. 20 00:00:54,120 --> 00:00:57,000 So what happens on campus this hour 21 00:00:57,000 --> 00:01:01,080 is determining the state of campus in one hour. 22 00:01:01,080 --> 00:01:04,140 We could say that our time steps are of the order of minutes 23 00:01:04,140 --> 00:01:07,230 or seconds, and as we shrink those time steps, 24 00:01:07,230 --> 00:01:08,640 we want to ask, "What is the limit 25 00:01:08,640 --> 00:01:11,460 of our model in continuous time?" 26 00:01:11,460 --> 00:01:12,690 The idea of continuous time 27 00:01:12,690 --> 00:01:14,850 is that continuous dynamical systems, 28 00:01:14,850 --> 00:01:16,890 calculus and differential equations, 29 00:01:16,890 --> 00:01:21,060 are going to be a incredibly useful toolbox to unlock. 30 00:01:21,060 --> 00:01:22,830 So that's what we want to do in those video 31 00:01:22,830 --> 00:01:25,530 is take the limit of very short timescale. 32 00:01:25,530 --> 00:01:28,590 So I'll be repeating a lot of what we saw. 33 00:01:28,590 --> 00:01:32,433 I'll use the SIS model as an example, 34 00:01:33,900 --> 00:01:37,173 so from discrete to continuous. 35 00:01:42,120 --> 00:01:45,060 I like using the SIS model as an example 36 00:01:45,060 --> 00:01:46,440 because we've discussed, you know, 37 00:01:46,440 --> 00:01:48,900 what approximations are made to go from the reality 38 00:01:48,900 --> 00:01:52,500 of disease spread to a model like this. 39 00:01:52,500 --> 00:01:54,600 It's also a single variable model. 40 00:01:54,600 --> 00:01:56,280 So even though we have two different states, 41 00:01:56,280 --> 00:01:59,730 two boxes, as we saw, the fact that our population 42 00:01:59,730 --> 00:02:01,590 is conserved in the classic case 43 00:02:01,590 --> 00:02:03,930 means that we really only have one degree of freedom. 44 00:02:03,930 --> 00:02:06,450 Give me S, I know how many N people. 45 00:02:06,450 --> 00:02:09,090 I know how many I people there are. 46 00:02:09,090 --> 00:02:12,420 So it's N minus S, right, for all times. 47 00:02:12,420 --> 00:02:14,550 So the fact that it's only one key variable 48 00:02:14,550 --> 00:02:16,623 makes it a little easier to play with. 49 00:02:18,060 --> 00:02:20,130 Now there's two steps we're going to take. 50 00:02:20,130 --> 00:02:24,030 So in the discrete form we add S of t plus 1 51 00:02:24,030 --> 00:02:26,343 or S of t plus delta t. 52 00:02:27,630 --> 00:02:29,070 I know I haven't been clear with that. 53 00:02:29,070 --> 00:02:30,960 Depends on whether we're counting our time 54 00:02:30,960 --> 00:02:34,140 in sort of units or in time steps. 55 00:02:34,140 --> 00:02:36,690 That doesn't matter too much, so that's equivalent. 56 00:02:39,870 --> 00:02:42,453 And I wrote, in a previous video, 57 00:02:43,440 --> 00:02:46,140 that it's proportional to everyone 58 00:02:46,140 --> 00:02:48,840 that's currently susceptible, 59 00:02:48,840 --> 00:02:52,263 are going to stay susceptible if they don't get infected, 60 00:02:53,190 --> 00:02:57,120 and we add 1 minus beta times delta t 61 00:02:57,120 --> 00:02:58,410 or beta times delta t. 62 00:02:58,410 --> 00:03:01,590 Remember, if we're simulating this process, let's say, 63 00:03:01,590 --> 00:03:04,170 for every contact with an infectious individual, 64 00:03:04,170 --> 00:03:06,360 beta times delta t is my transmission rate 65 00:03:06,360 --> 00:03:07,530 times the duration. 66 00:03:07,530 --> 00:03:09,510 So my transmission rate might be, you know, 67 00:03:09,510 --> 00:03:12,510 0.01 transmission per hour. 68 00:03:12,510 --> 00:03:14,636 If my delta t is one day, 69 00:03:14,636 --> 00:03:19,636 If my delta T is one day 70 00:03:20,070 --> 00:03:23,010 And I applied this as a discrete probability 71 00:03:23,010 --> 00:03:25,590 for every one of my infectious contact. 72 00:03:25,590 --> 00:03:26,977 Everyone that can infect me, we ask, 73 00:03:26,977 --> 00:03:28,950 "Do you infect me? Yes or no?" 74 00:03:28,950 --> 00:03:30,900 And I'm only going to remain susceptible 75 00:03:30,900 --> 00:03:32,130 if they all answer no. 76 00:03:32,130 --> 00:03:32,963 So they answer no 77 00:03:32,963 --> 00:03:37,230 with probability 1 minus the transmission probability, 78 00:03:37,230 --> 00:03:42,230 and I have I of t potential infectious people infecting me. 79 00:03:42,750 --> 00:03:47,250 Then we had an average term here I of t for recoveries, 80 00:03:47,250 --> 00:03:50,310 so flow of individuals back from I to S. 81 00:03:50,310 --> 00:03:52,920 And then I don't need to write I of t plus 1 82 00:03:52,920 --> 00:03:54,540 or I of t plus delta t 83 00:03:54,540 --> 00:03:56,520 'cause I know it's N, my total population, 84 00:03:56,520 --> 00:03:58,170 minus whoever's in susceptible. 85 00:03:58,170 --> 00:04:00,753 So the system is fully fixed by this. 86 00:04:02,280 --> 00:04:07,280 We saw in the bonus video for Taylor series 87 00:04:07,380 --> 00:04:12,380 that one thing you can do is develop this probability 88 00:04:13,110 --> 00:04:14,430 as a Taylor series, 89 00:04:14,430 --> 00:04:16,350 meaning we're going to make the approximation 90 00:04:16,350 --> 00:04:19,173 that beta times delta t is really, really small. 91 00:04:20,160 --> 00:04:22,830 And that's going to give us something 92 00:04:22,830 --> 00:04:27,830 like 1 minus beta delta t times I of t, 93 00:04:29,370 --> 00:04:31,443 and then plus some terms, 94 00:04:36,000 --> 00:04:38,550 whoops, that go as beta times delta t, 95 00:04:38,550 --> 00:04:39,600 the whole thing squared, 96 00:04:39,600 --> 00:04:42,270 so beta squared times delta t squared. 97 00:04:42,270 --> 00:04:44,550 The key part is that, if that probability, 98 00:04:44,550 --> 00:04:46,170 beta times delta t, is very small, 99 00:04:46,170 --> 00:04:48,483 we can ignore those other terms. 100 00:04:49,740 --> 00:04:51,600 So that's one thing we can do when delta t 101 00:04:51,600 --> 00:04:53,403 becomes really, really small. 102 00:04:55,080 --> 00:04:56,460 And that's going to be super useful. 103 00:04:56,460 --> 00:04:59,733 So if this is a little confusing right now, what's in red, 104 00:05:00,570 --> 00:05:03,540 I invite you to go and rewatch the bonus video 105 00:05:03,540 --> 00:05:06,060 for a formal definition of Taylor series 106 00:05:06,060 --> 00:05:07,983 in this particular example. 107 00:05:09,090 --> 00:05:11,910 But now what we're going to want to do is remember 108 00:05:11,910 --> 00:05:15,840 that that simple result for small probabilities, 109 00:05:15,840 --> 00:05:19,620 and we're going to ask, "As delta t goes to zero," 110 00:05:19,620 --> 00:05:22,173 so as my windows get smaller and smaller, 111 00:05:23,167 --> 00:05:25,870 "what is the instantaneous change 112 00:05:29,160 --> 00:05:33,237 between a time step t and a time step t plus delta t?" 113 00:05:37,980 --> 00:05:39,280 That's what we care about. 114 00:05:44,700 --> 00:05:48,603 So let's assume that we now know the result that was in red. 115 00:05:50,610 --> 00:05:52,350 We have that stored in memory forever. 116 00:05:52,350 --> 00:05:55,650 That's going to be useful often. 117 00:05:55,650 --> 00:05:57,453 So let's just store that in memory. 118 00:06:03,780 --> 00:06:07,263 And now I'm going to expand my terms a little bit. 119 00:06:10,590 --> 00:06:12,300 I'm going to have S of t. 120 00:06:12,300 --> 00:06:15,063 I'm using the result that I just erased, 121 00:06:16,410 --> 00:06:19,950 and that's going to give me this delta t times beta 122 00:06:19,950 --> 00:06:23,883 times I of t times S of t. 123 00:06:28,260 --> 00:06:31,830 Let me do something to help me write here more clearly. 124 00:06:31,830 --> 00:06:32,910 'cause I have a lot of terms. 125 00:06:32,910 --> 00:06:37,910 I'm just going to omit the explicit dependency on times. 126 00:06:38,850 --> 00:06:40,920 I'm just going to use I times S 127 00:06:40,920 --> 00:06:43,140 instead of I of t for everything. 128 00:06:43,140 --> 00:06:45,153 That's delta t gamma I. 129 00:06:50,580 --> 00:06:53,550 I was missing a delta t here in my previous equation. 130 00:06:53,550 --> 00:06:57,663 The probability of recovery, again, was gamma terms delta t. 131 00:06:59,160 --> 00:07:01,080 Good thing I have notes. 132 00:07:01,080 --> 00:07:04,353 Okay, so that's this whole thing over delta t. 133 00:07:05,370 --> 00:07:09,390 You know, bonus point for those who corrected my term here, 134 00:07:09,390 --> 00:07:13,257 initially, the same way I add beta times delta t here, 135 00:07:15,510 --> 00:07:18,933 I needed gamma times delta t times I of t. 136 00:07:25,530 --> 00:07:27,360 Well now I have some terms that cancel out. 137 00:07:27,360 --> 00:07:29,340 So this limit is actually going to be 138 00:07:29,340 --> 00:07:30,390 pretty straightforward to do. 139 00:07:30,390 --> 00:07:32,403 I have a minus S and a plus S, 140 00:07:33,360 --> 00:07:36,663 and then everything that's left is proportional to delta t. 141 00:07:37,530 --> 00:07:41,610 So really what I have is delta t over delta t, 142 00:07:41,610 --> 00:07:46,610 and then gamma I minus beta IS. 143 00:07:51,570 --> 00:07:54,150 So then I can easily take the limit. 144 00:07:54,150 --> 00:07:57,750 The two delta t's cancel out and it doesn't matter. 145 00:07:57,750 --> 00:08:01,530 And then I simply have gamma I of t. 146 00:08:01,530 --> 00:08:02,760 This is my final result, 147 00:08:02,760 --> 00:08:05,583 so I'll put the time dependency back on there, 148 00:08:06,810 --> 00:08:08,553 I of t, S of t. 149 00:08:09,420 --> 00:08:13,890 And then this, we'll say, is equal to the time derivative 150 00:08:13,890 --> 00:08:15,033 of S of t. 151 00:08:17,250 --> 00:08:19,620 Because if you remember from your calculus courses, 152 00:08:19,620 --> 00:08:22,620 this instantaneous change that we just calculated, 153 00:08:22,620 --> 00:08:26,673 that's the, you know, purest definition of a derivative. 154 00:08:27,630 --> 00:08:31,410 So this last thing here is essentially just by definition, 155 00:08:31,410 --> 00:08:34,770 which we've calculated is the differential equation 156 00:08:34,770 --> 00:08:37,590 governing the continuous time evolution 157 00:08:37,590 --> 00:08:40,320 of this S of t variable. 158 00:08:40,320 --> 00:08:42,030 And it looks a little funny here, 159 00:08:42,030 --> 00:08:45,123 and if you wanted to make it a little more explicit, again, 160 00:08:46,530 --> 00:08:49,200 everything here we have to remember that I of t 161 00:08:49,200 --> 00:08:51,600 is equal to N which is just a constant, 162 00:08:51,600 --> 00:08:55,050 number of people in the model, minus S of t. 163 00:08:55,050 --> 00:08:57,720 So I could replace both my I of t's here 164 00:08:57,720 --> 00:09:01,110 by this N minus S of t form, 165 00:09:01,110 --> 00:09:04,770 and I would have a complete differential equation 166 00:09:04,770 --> 00:09:08,910 or continuous time model for the SIS process. 167 00:09:08,910 --> 00:09:11,820 So we're going to look into how to solve this model 168 00:09:11,820 --> 00:09:13,860 and analyze this model, simulate this model, 169 00:09:13,860 --> 00:09:15,870 a little further in the subsequent video. 170 00:09:15,870 --> 00:09:17,673 So I'll see you all in the next one.