1 00:00:00,750 --> 00:00:03,330 Welcome back to Modeling Complex Systems. 2 00:00:03,330 --> 00:00:07,800 This will be our final video for Module one. 3 00:00:07,800 --> 00:00:12,800 We have reached the end of our module on Dynamical System. 4 00:00:13,110 --> 00:00:15,970 I just wanna use this video to 5 00:00:17,550 --> 00:00:18,840 talk a little bit more 6 00:00:18,840 --> 00:00:22,020 about both, the very start of the class. 7 00:00:22,020 --> 00:00:25,097 How do we model a system as a dynamical system? 8 00:00:25,097 --> 00:00:27,330 How do we model a problem? 9 00:00:27,330 --> 00:00:28,740 And some things to keep in mind 10 00:00:28,740 --> 00:00:31,050 once we have a model and we start analyzing it. 11 00:00:31,050 --> 00:00:33,393 What are the potential sources of error? 12 00:00:34,500 --> 00:00:37,410 So I wanna divide this video in three parts, 13 00:00:37,410 --> 00:00:39,690 to think about modeling as a recipe. 14 00:00:39,690 --> 00:00:42,270 So we're gonna have the ingredients, 15 00:00:42,270 --> 00:00:44,220 this is how we start our model. 16 00:00:44,220 --> 00:00:47,130 The preparation, which is really how we run our model, 17 00:00:47,130 --> 00:00:48,030 put everything together. 18 00:00:48,030 --> 00:00:51,270 And finally, how to present our beautiful dish 19 00:00:51,270 --> 00:00:53,310 and what are the possible sources of error. 20 00:00:53,310 --> 00:00:54,810 Because even the best models, 21 00:00:54,810 --> 00:00:59,810 if not interpreted correctly, can be problematic. 22 00:01:00,330 --> 00:01:03,330 So the ingredients, we've talked a lot about time, 23 00:01:03,330 --> 00:01:05,640 in these dynamical systems. 24 00:01:05,640 --> 00:01:07,890 So time could be discrete, we have discrete models. 25 00:01:07,890 --> 00:01:09,030 It could be continuous. 26 00:01:09,030 --> 00:01:12,540 We could even think about models that are static. 27 00:01:12,540 --> 00:01:14,820 We haven't done so yet but we will, 28 00:01:14,820 --> 00:01:18,270 as we look at statistical models, for example. 29 00:01:18,270 --> 00:01:20,640 So first is to pick what notion of time 30 00:01:20,640 --> 00:01:23,700 best represent the problem you're interested in. 31 00:01:23,700 --> 00:01:25,860 Then we also wanna think about space. 32 00:01:25,860 --> 00:01:30,150 Similarly, space can be continuous or discrete. 33 00:01:30,150 --> 00:01:31,380 It could also have dimensions. 34 00:01:31,380 --> 00:01:33,030 This will all become important. 35 00:01:33,030 --> 00:01:34,920 When I say dimensions, especially, 36 00:01:34,920 --> 00:01:36,450 are we in 2D or 3D? 37 00:01:36,450 --> 00:01:38,220 Are we on a network? 38 00:01:38,220 --> 00:01:40,380 This will all become important, 39 00:01:40,380 --> 00:01:43,863 mainly as starting with the second module on structure. 40 00:01:46,470 --> 00:01:51,470 Then the key part of this modeling as representing a system, 41 00:01:51,750 --> 00:01:53,970 as building a representation of a system, 42 00:01:53,970 --> 00:01:56,550 is to think about what are the important parts 43 00:01:56,550 --> 00:01:57,690 of this system. 44 00:01:57,690 --> 00:02:01,470 So in terms of epidemic models, we knew it was 45 00:02:01,470 --> 00:02:04,290 having both susceptible and infectious individuals. 46 00:02:04,290 --> 00:02:07,500 That was the key part, was the separation of a system 47 00:02:07,500 --> 00:02:12,500 into boxes and following those boxes which represent 48 00:02:12,540 --> 00:02:14,010 parts of different nature 49 00:02:14,010 --> 00:02:17,520 and asking how those different boxes 50 00:02:17,520 --> 00:02:19,113 and parts are interconnected. 51 00:02:20,490 --> 00:02:21,660 Then we wanna ask questions 52 00:02:21,660 --> 00:02:23,790 about whether the system is closed or open. 53 00:02:23,790 --> 00:02:25,860 So when we were doing compartmental models, 54 00:02:25,860 --> 00:02:28,320 it was about whether we had arrows coming or going 55 00:02:28,320 --> 00:02:29,493 to the outside. 56 00:02:30,330 --> 00:02:34,050 Or whether all arrows started in a box, went to another box, 57 00:02:34,050 --> 00:02:35,580 meaning that we had a closed system 58 00:02:35,580 --> 00:02:38,103 and some conserved quantity, often. 59 00:02:39,750 --> 00:02:41,400 Then we need to think about the rules 60 00:02:41,400 --> 00:02:43,470 and whether or not we feel like it's important 61 00:02:43,470 --> 00:02:45,300 to have stochastic, meaning, 62 00:02:45,300 --> 00:02:47,850 rules with an element of randomness. 63 00:02:47,850 --> 00:02:49,740 So if you're flipping coins, 64 00:02:49,740 --> 00:02:52,380 the way we did a little bit in some pseudo code, 65 00:02:52,380 --> 00:02:53,213 that was 66 00:02:54,210 --> 00:02:56,550 stochastic models. 67 00:02:56,550 --> 00:02:58,290 A set of stochastic rules, 68 00:02:58,290 --> 00:03:02,190 where we had to draw random numbers between zero and one. 69 00:03:02,190 --> 00:03:04,740 Otherwise deterministic rules can give you something 70 00:03:04,740 --> 00:03:07,050 like ordinary differential equations. 71 00:03:07,050 --> 00:03:10,050 Those ODEs are deterministic by their nature. 72 00:03:10,050 --> 00:03:12,870 Tell me where I am and I'll know exactly where I'm going. 73 00:03:12,870 --> 00:03:15,360 That's what the differential equation is telling me. 74 00:03:15,360 --> 00:03:17,640 So that's deterministic. 75 00:03:17,640 --> 00:03:20,610 To compare, again, one good analogy between the two, 76 00:03:20,610 --> 00:03:22,260 is that you can run the same model 77 00:03:22,260 --> 00:03:24,240 with the same initial condition twice. 78 00:03:24,240 --> 00:03:25,740 If it's a stochastic model, 79 00:03:25,740 --> 00:03:27,570 you're not gonna get the same time series, 80 00:03:27,570 --> 00:03:28,560 the same solution. 81 00:03:28,560 --> 00:03:30,390 If it's deterministic, 82 00:03:30,390 --> 00:03:32,970 your initial condition determine the future 83 00:03:32,970 --> 00:03:34,980 and so you'll get the exact same solution, 84 00:03:34,980 --> 00:03:36,903 even if you run it more than once. 85 00:03:38,280 --> 00:03:40,740 Then there are other questions that the system have memory. 86 00:03:40,740 --> 00:03:44,160 Are we dealing with a Markovian, meaning, no memory. 87 00:03:44,160 --> 00:03:47,250 The present dictates the future. 88 00:03:47,250 --> 00:03:50,370 Are we dealing with non-Markovian models, 89 00:03:50,370 --> 00:03:52,290 where there might be some memory 90 00:03:52,290 --> 00:03:54,960 and we have to take that into account somehow? 91 00:03:54,960 --> 00:03:57,390 Those were the more general questions. 92 00:03:57,390 --> 00:04:00,330 But really, when we think about how to run a model, 93 00:04:00,330 --> 00:04:02,050 the textbook has this great 94 00:04:03,300 --> 00:04:06,963 set of principles that's easy to remember, IOU. 95 00:04:08,280 --> 00:04:09,750 IOU a model. 96 00:04:09,750 --> 00:04:11,970 And the way I will give you that model, 97 00:04:11,970 --> 00:04:16,140 is by initializing it, observing it and updating it. 98 00:04:16,140 --> 00:04:18,900 So initialization means to define the variables 99 00:04:18,900 --> 00:04:19,770 of the system. 100 00:04:19,770 --> 00:04:22,863 What do you care about and what is their initial state? 101 00:04:23,700 --> 00:04:25,500 So that could simply be a number 102 00:04:25,500 --> 00:04:28,050 of initially susceptible individuals 103 00:04:28,050 --> 00:04:30,510 and a number of officially infectious individual. 104 00:04:30,510 --> 00:04:33,030 And that sets the initial state of my system. 105 00:04:33,030 --> 00:04:35,823 Could be a number of predator and a number of prey. 106 00:04:36,660 --> 00:04:38,430 Then we have to define what we observe. 107 00:04:38,430 --> 00:04:40,920 How do we monitor the system? 108 00:04:40,920 --> 00:04:42,660 What do we wanna measure, 109 00:04:42,660 --> 00:04:45,900 as the system runs, as the model runs? 110 00:04:45,900 --> 00:04:47,070 And then once we've done that, 111 00:04:47,070 --> 00:04:48,540 we can actually update the system. 112 00:04:48,540 --> 00:04:50,340 We start with our initial state. 113 00:04:50,340 --> 00:04:52,920 We apply the set of rules that we've defined 114 00:04:52,920 --> 00:04:54,240 in the previous step 115 00:04:54,240 --> 00:04:56,910 and then measure what we wanna observe. 116 00:04:56,910 --> 00:04:58,350 Apply the set of rules again, 117 00:04:58,350 --> 00:04:59,610 measure what we wanna observe, 118 00:04:59,610 --> 00:05:02,130 apply the set of rules, measure what we wanna observe, 119 00:05:02,130 --> 00:05:03,540 until we have enough data 120 00:05:03,540 --> 00:05:05,280 and decide that we're done. 121 00:05:05,280 --> 00:05:08,850 So this is just a good mnemonic trick to remember 122 00:05:08,850 --> 00:05:11,343 the importance of these three different steps. 123 00:05:12,210 --> 00:05:14,910 You do wanna play with different way to look at the systems. 124 00:05:14,910 --> 00:05:16,350 So different things to observe. 125 00:05:16,350 --> 00:05:18,600 You wanna play with different initial conditions. 126 00:05:18,600 --> 00:05:21,570 So the model as a set of rules, is not always enough 127 00:05:21,570 --> 00:05:24,060 and you need to think of the other step 128 00:05:24,060 --> 00:05:25,533 of preparation as well. 129 00:05:26,460 --> 00:05:29,520 And then finally, with this presentation, 130 00:05:29,520 --> 00:05:30,690 meaning, we have a model, 131 00:05:30,690 --> 00:05:33,390 we are measuring something and often we either wanna 132 00:05:33,390 --> 00:05:36,600 compare it to data or we just wanna communicate the results 133 00:05:36,600 --> 00:05:38,880 of our model because we think it's insightful 134 00:05:38,880 --> 00:05:42,000 and tells us something about the real system 135 00:05:42,000 --> 00:05:43,920 we're interested in. 136 00:05:43,920 --> 00:05:46,320 So when we think about presentation, really, 137 00:05:46,320 --> 00:05:47,153 what we mean is, 138 00:05:47,153 --> 00:05:49,350 what are the possible problems at this stage? 139 00:05:49,350 --> 00:05:51,510 What are the possible sources of error 140 00:05:51,510 --> 00:05:53,400 that we need to be curious about? 141 00:05:53,400 --> 00:05:55,140 So when you present your model, 142 00:05:55,140 --> 00:05:57,810 you wanna be transparent about everything that came before. 143 00:05:57,810 --> 00:06:00,660 What assumption and idealization did you do? 144 00:06:00,660 --> 00:06:02,220 What did you measure and observe? 145 00:06:02,220 --> 00:06:04,590 How did you update your model? 146 00:06:04,590 --> 00:06:06,150 But there are a whole set 147 00:06:06,150 --> 00:06:08,490 and I'm putting them up all on screen right now. 148 00:06:08,490 --> 00:06:11,580 There are a whole set of potential sources of error, 149 00:06:11,580 --> 00:06:13,443 even once you've been transparent. 150 00:06:14,610 --> 00:06:15,960 So let's say your model, you know, 151 00:06:15,960 --> 00:06:17,640 doesn't fit well with data 152 00:06:17,640 --> 00:06:20,703 or doesn't capture the intuition you want it to capture. 153 00:06:21,600 --> 00:06:22,830 It could be model error. 154 00:06:22,830 --> 00:06:25,740 It could be that in these early stages of the system, 155 00:06:25,740 --> 00:06:27,960 you made a mistake, you ignored something, 156 00:06:27,960 --> 00:06:30,090 you made an assumption or an idealization, 157 00:06:30,090 --> 00:06:31,770 that you shouldn't have made. 158 00:06:31,770 --> 00:06:35,430 So any problem in the specification of the model, 159 00:06:35,430 --> 00:06:37,560 we would call a model error. 160 00:06:37,560 --> 00:06:41,370 One very common source of error is, is due to parameters. 161 00:06:41,370 --> 00:06:43,590 You might have the right mechanisms in the right model 162 00:06:43,590 --> 00:06:47,040 but the bad values on these mechanisms, 163 00:06:47,040 --> 00:06:49,620 maybe the rules of the model should change 164 00:06:49,620 --> 00:06:50,730 in time and they do not. 165 00:06:50,730 --> 00:06:53,010 Or maybe you simply didn't measure something 166 00:06:53,010 --> 00:06:55,710 like birth rate of the prey, well enough. 167 00:06:55,710 --> 00:06:57,540 So that's definitely possible. 168 00:06:57,540 --> 00:07:00,300 So often what you'll wanna do, is test 169 00:07:00,300 --> 00:07:02,040 a whole range of parameter, 170 00:07:02,040 --> 00:07:04,350 which we often call a parameter sweep 171 00:07:04,350 --> 00:07:06,420 or sensitivity analysis, 172 00:07:06,420 --> 00:07:09,030 to see how much of the same behavior you get 173 00:07:09,030 --> 00:07:10,710 when you vary those parameters. 174 00:07:10,710 --> 00:07:13,530 And then at least you'll know how important measuring them 175 00:07:13,530 --> 00:07:14,733 in practice will be. 176 00:07:15,630 --> 00:07:18,540 Or selecting them correctly. 177 00:07:18,540 --> 00:07:20,400 The third source of error that I have on there, 178 00:07:20,400 --> 00:07:21,650 is measurement error. 179 00:07:21,650 --> 00:07:23,940 It is possible that the model is right 180 00:07:23,940 --> 00:07:26,160 and it is the world that is wrong, right. 181 00:07:26,160 --> 00:07:28,830 Maybe you're comparing to data that just doesn't exactly 182 00:07:28,830 --> 00:07:31,140 capture what you wanted to capture. 183 00:07:31,140 --> 00:07:32,500 We often look at 184 00:07:33,420 --> 00:07:35,973 epidemic models by comparing them to what we call, 185 00:07:37,971 --> 00:07:39,000 influenza-like illness. 186 00:07:39,000 --> 00:07:42,150 So we think of flu as a disease that we wanna forecast. 187 00:07:42,150 --> 00:07:44,730 It has an important disease burden. 188 00:07:44,730 --> 00:07:47,160 And we have those well-defined flu season 189 00:07:47,160 --> 00:07:49,200 but it is very hard to diagnose. 190 00:07:49,200 --> 00:07:51,150 So the proxy that we're using, 191 00:07:51,150 --> 00:07:53,970 is these influenza-like illnesses, 192 00:07:53,970 --> 00:07:56,790 which is not just flu, it's a bunch of other things. 193 00:07:56,790 --> 00:07:59,580 So we're comparing about something that is super noisy. 194 00:07:59,580 --> 00:08:01,560 So the things that we're comparing against 195 00:08:01,560 --> 00:08:03,390 are not measured right. 196 00:08:03,390 --> 00:08:06,000 That could also be a source of parameter error, 197 00:08:06,000 --> 00:08:08,550 if we're not measuring those parameters right. 198 00:08:08,550 --> 00:08:10,740 So sometimes a model is right 199 00:08:10,740 --> 00:08:12,573 and it is the world that is wrong. 200 00:08:13,800 --> 00:08:16,830 Our fourth category here, is discretization error. 201 00:08:16,830 --> 00:08:18,330 That is super common. 202 00:08:18,330 --> 00:08:21,790 Most complex systems are interesting because they're 203 00:08:23,520 --> 00:08:27,360 created by a collective of parts. 204 00:08:27,360 --> 00:08:29,460 But those parts are often discrete, right. 205 00:08:29,460 --> 00:08:33,183 Discrete predators and prey, discrete number of people. 206 00:08:35,220 --> 00:08:38,190 But most of our model are gonna assume continuous 207 00:08:38,190 --> 00:08:42,000 mathematics, just because it is a powerful set of tools. 208 00:08:42,000 --> 00:08:43,920 If we can use, you know, differential equations 209 00:08:43,920 --> 00:08:48,030 over continuous variable, that's a powerful tool to use. 210 00:08:48,030 --> 00:08:52,500 And unfortunately, reality of our system is often discrete. 211 00:08:52,500 --> 00:08:54,720 The same goes with data. 212 00:08:54,720 --> 00:08:56,410 Our model is gonna give us 213 00:08:57,780 --> 00:09:00,990 prediction of predator or prey over time, 214 00:09:00,990 --> 00:09:02,670 in continuous time. 215 00:09:02,670 --> 00:09:03,930 But the data might just come 216 00:09:03,930 --> 00:09:06,810 from observations that are monthly. 217 00:09:06,810 --> 00:09:09,210 Those observations are gonna have some measurement error 218 00:09:09,210 --> 00:09:12,240 but they're also gonna have this discretization error, 219 00:09:12,240 --> 00:09:14,820 that we're only observing them once in a while 220 00:09:14,820 --> 00:09:18,060 and putting a lot of data together, bending them over time. 221 00:09:18,060 --> 00:09:19,620 So that's something to keep in mind. 222 00:09:19,620 --> 00:09:22,050 And finally, as we saw with chaos theory, 223 00:09:22,050 --> 00:09:23,820 there can be numerical errors. 224 00:09:23,820 --> 00:09:26,160 The model might be a little unstable, 225 00:09:26,160 --> 00:09:28,860 so it might be hard to solve for some fixed points. 226 00:09:28,860 --> 00:09:31,443 Or it could be sensitive to initial conditions, 227 00:09:32,490 --> 00:09:35,130 such that, even the best algorithm won't give you 228 00:09:35,130 --> 00:09:37,080 a good prediction 229 00:09:37,080 --> 00:09:38,880 of which you should expect from that model. 230 00:09:38,880 --> 00:09:41,460 And then it becomes hard to compare reality 231 00:09:41,460 --> 00:09:45,243 with those noisy numerical predictions. 232 00:09:46,230 --> 00:09:47,730 So, you know, 233 00:09:47,730 --> 00:09:50,190 these are meant to just be things to keep in mind 234 00:09:50,190 --> 00:09:52,593 as you start creating your own models. 235 00:09:54,120 --> 00:09:57,870 Ingredients, preparation, the IOU mnemonic trick 236 00:09:57,870 --> 00:09:59,910 and the presentation. 237 00:09:59,910 --> 00:10:02,040 But we're gonna keep applying the same recipe. 238 00:10:02,040 --> 00:10:05,430 We're gonna see other sources of error, other ways to model. 239 00:10:05,430 --> 00:10:06,870 This is only the beginning. 240 00:10:06,870 --> 00:10:09,180 It is the end of our first module. 241 00:10:09,180 --> 00:10:12,120 But starting next week, we'll be talking about structure. 242 00:10:12,120 --> 00:10:13,860 We'll have two modules on structure. 243 00:10:13,860 --> 00:10:16,200 The first one on Cellular Automata. 244 00:10:16,200 --> 00:10:19,860 And the second module on structure, module three, 245 00:10:19,860 --> 00:10:21,000 will be on networks. 246 00:10:21,000 --> 00:10:25,440 So this whole step, this next step, I should say, 247 00:10:25,440 --> 00:10:26,340 starts next week. 248 00:10:26,340 --> 00:10:28,530 I'm super excited to start 249 00:10:28,530 --> 00:10:30,750 talking a little more about structure. 250 00:10:30,750 --> 00:10:33,630 It is just, if not more interesting than dynamics. 251 00:10:33,630 --> 00:10:36,360 And eventually we'll put all of that together 252 00:10:36,360 --> 00:10:38,340 and we'll be creating really, really cool models. 253 00:10:38,340 --> 00:10:39,513 So I'll see you soon.