 Thank you very much, I'm delighted to have people from all over the world by the looks of it. So let me get started. So now let's get into the meat of the discussion here. Agent based modeling for social sciences. To start off with, I'll explain the differences between top down and bottom up. I'll talk a bit about agents and agent based models. Obviously, I'll go through a simple example of an agent based model. And then a more complex example of an agent based model that has the same theme as the simple so you can see differences in how a particular question could be answered simply or maybe more completely. What you can do with the output at pros and cons of agent based modeling platforms and languages that you might want to use and some other resources, followed by time for Q&A at the end. Obviously, yeah, enter questions into the Q&A section at any time, but I will answer them at the end. I won't be looking at those until we get through the slide deck. But moving ahead. I have too many table of contents. Right, a problem is top down. If it exists within a system that you can understand as whole well understood or with a central controller structure. Both these things are in quotes both is and whole and well understood, because nothing is properly whole or well understood. Obviously, we don't understand everything about everything. But we there are things that are very useful to treat as whole or well understood or top down for that matter. Where the cause for a problem or the cause of an effect can be isolated to constituent parts to defined interactions to specific problem areas. Or if this kind of problem is well suited to a classical scientific method approach so that was focuses on isolating the interactions or the problems predicting what will happen if you do a specific thing. So you set the whole thing up and run it multiple times to be clear that you get the same outcome from the same input things like that. So some examples are, for example, a machine. So machines are typically understood as top down because they're composed of a bunch of parts that we can replace if we know they're problematic. We understand how they work how you know if you pull this lever this thing happens. I'm not surprised by usually by the way machines work. I'll also give the example here of a prosthetic leg, and I say this is a top down example in contrast to the real to the sort of biologic leg, because the prosthetic leg can be taken apart. The ankle joint can be replaced or the knee joint can be replaced quite easily certainly compared to a human sort of biological leg. And we can sort of replace the materials or isolate the problems or take it apart and put it back together quite easily compared to a biological leg. And here in a wind tunnel. This is testing sort of a parachute effect and you know how much oops, how much sorry I've gone the wrong way. How much airflow it takes to fill it to its full capacity what it what it's sort of how it behaves in there. And I use this as an example of top down because I'm wind tunnel isolates this parachute within a very consistent flow of air. With no other interactions there's no chance of a bird coming in on the side there's no chance of wind blowing sideways or changing direction suddenly or a thunderstorm this is quite isolated clear it's trying to find a clear output from a clear input. So here's a mentee quiz. A school wants to know how many students it can accommodate. Is this a top down question. Your options are top down definitely not top down definitely or I think I need more information. Oh, got some disagreement here. I will let you know controversially that there is no right or wrong answer to this. These, in fact, most of the questions that I will come out with throughout the workshop today. Can be interpreted in more than one way and that is why things were in sort of stair quotes earlier because we have to think about whether this is useful to think of a school and how many students it can accommodate as a top down question. So it looks like people are leaning more towards I need more information and that is wise as scientists I agree with you. But most the second most common answer is top down definitely and I think there's a there's this makes sense. They write a teacher can handle, you know, X number of students, we have X number of classrooms therefore it's sort of a cumulative problem of like how many students can we handle. Or if we were to add another classroom, you know, add another component into this we would then be able to handle X number of students more. So there is a top down sort of isolationist reductionist approach you can take this question and it makes a lot of sense. If you applaud your uncertainty and the popularity of people saying, I think I need more information. Moving on, a problem is bottom up, if it occurs women a poorly understood open system with vague parts or interactions and partial or decentralized control open systems as opposed to close systems in the top down sort of problems. For people enter and exit the system all the time, sometimes in regular ways, sometimes in unpredictable ways. So rivers, for example, water's always flowing through. You can't say you know this reservoir is a closed system because water is always coming in and going out evaporation and this all depends on weather which is quite unpredictable. So, you know that this for example would be a bottom up problem how much water is in the reservoir surprisingly bottom up. Not reasonable to assume reducibility linearity time context independence or closed simplicity. So, like with the reservoir, we can't really assume that we'll get water on a consistent basis at it it depends on rainfall it depends on upstream changes to the watershed system. You know, if if upstream suddenly everything becomes paved, then rainfall with a certain area will change its speed of the volume might not change. You know, it's it's complicated. And it's not necessarily easy to apply classic scientific methods. In the reservoir you could, you know, you could apply some methods but I'll give some examples of other bottom up problems that are really hard to study with classic scientific methods. And generally, rather than a classic method where you're trying to isolate a thing and take it apart, understand all of its bits and put it back together. And that's trying to recreate it, for example, in the simulation, such as an agent based model, which is why we're talking about top down and bottom up. Let's move forward slightly and talk about some examples. Now at the one side here. I've got earthquake. This is a seismic seismographic map I think. So, the actual size and location of an earthquake is very hard to predict. Although on a global scale, we know where earthquakes are likely to happen and where big earthquakes are likely to happen. And this is because earthquakes like well topography is a bottom up problem. The interaction of all the different plates, plus the things that are on the plates plus, you know, some things that are happening down underneath the plates and different kind of levels of magma liquid hot magma. You know, this is all very unpredictable, very contingent, everything interacts with everything else, and we don't really have good information about it. So predicting earthquakes, very bottom up. Another classic example is traffic. You know, we really, we know cars move in and out of a system. But how big is the car? Where are they going? Is the person in a hurry? Is the driver in a bad mood? Are they carrying multiple passengers? Are they going to have to stop because someone in the back is sick? Are there motorcycles or truck heavy goods vehicles, which maybe things have fallen off of? All of this creates incredibly difficult to manage systems. And in fact, the incidents of when a traffic jam will occur is very hard to predict because because of all of these things, plus the design of the roads and the weather, everything is huge. And it's a problem. And that's why traffic is such a nightmare. Here's a slightly more culturally fun example. This is a Catalan Castillers competition in which they make human pyramids. And they try and scale up to so many layers and they have what's called the Fortaleza at the bottom. That's all these people supported. And so the actual height that a given team can achieve depends on the people in it, how they're feeling that day, the Fortaleza, how good and consistent and like well connected they are. It's super complicated and really like jaw-dropping to watch. If you ever get a chance, I recommend it. Don't worry. The tiny children that climb right up to the top are well protected. It's still like really heart-stopping. So here's another question. A school wants to know how many students it can accommodate. Is this a bottom-up question? You might think, haha, I've heard this question before. But now maybe you know a bit more about the difference between top-down and bottom-up. So let's have another think. Again, people still say they don't have enough information and you're absolutely right because we don't know what information they're using to make to assess this problem. Maybe the purpose of the problem, are they trying to cram in as many students as possible or are they trying to design the building layout? This may be effects when you can build as top-down or bottom-up. But this time we see much more even split between bottom-up definitely and not bottom-up, I'm sure of it. Whereas before it seemed like everyone thought it was pretty much top-down. And this is, yeah, it is a complicated question that it kind of depends on how you want to look at it, whether it's bottom-down or bottom-up or top-down. Because maybe you're trying to create the best student experience. And that's a really bottom-up question that depends on how many students and what ages they are, whether they have behavioral problems or special learning needs, whether the technology you have really accommodates things well. You know, are your rooms quite sound efficient or noisy or hot? Like you can probably have fewer people if your buildings are really crummy. But then maybe your technology requires sort of one-to-one in isolation. Yeah, so there's lots and lots of questions. I'm inclined to think that if your question is just a simple thing like how many students can we get a pupil premium for? That's a bit top-down. But if your question is how do we create the best learning environment for a given number of students? That's a bottom-up question. So you see the difference between the questions there. And I appreciate you humoring me with asking the same question twice. So now we're on to agents. What is an agent? Well, quite often people associate agents with artificial intelligence. And artificial intelligence is about learners or problem solvers. They tend to be quite autonomous and they tend to be an individual. So in this case, the terminator, he's got a particular problem to solve. He has to kill John Connor. He learns how to do that by learning about 1984 whenever the first film came out. And he moves independently. So this, you know, think about terminators as artificial intelligence. Try not to scare yourself too much. Artificial intelligence is not always about trying to kill people. Not always. Another kind of things that we talk about are multi-agent systems. So these are distributed control problems. They tend to be quite specific. They tend to be not autonomous essentially. So in this case, you have what six different little sort of robots and their problem is to move from one space to another. And there are obstacles in the way. And they join forces to collaborate to overcome those problems. Now a real world application of this would be things like transportation systems tend to have a lot of multi-agent systems. So traffic lights will have an agent at each traffic light who tells the ones of nearby, my light is on green, expect traffic coming from this direction. Then the other traffic lights will know, right, he's green. So I've got to be green unless this happens from that agent over there is telling me I need to turn red. So they'll sort of take information from multiple things. They'll work together to try and solve a problem which is smooth flow of traffic. But the one I'm really interested in is agent-based models. Now these are multiple agents in an agent-based model. They interact with each other and they each act according to rules. The different agents do not have to have the same kind of rules although they can. And obviously I'll talk more about this because that's what this talk is about. But before we do that, it's fun to have a little bit more sort of questioning. Now I've sort of given the answer to this away. But you can answer any way you like. Yeah, most people are going with multi-agent systems for smart traffic lights. In general, if there's lots of them and they're working together to achieve a problem, it's probably multi-agent systems. On the other hand, if you have a smart traffic robot who's standing there sort of directing traffic with the white gloves, that would be an AI. You certainly could build an agent-based model of traffic, but it would weirdly be an agent-based model of a multi-agent system. So that'll blow your minds. And agreed, proper scientists here, we've got several saying it depends and you're right, it does. So are weather predictions, are they AI? Are they multi-agent systems or are they agent-based models? Early answer in there with the depends. Oh, got some disagreement here, AI, ABM, multi-agent systems. It's good that you are disagreeing on this because I actually don't, I don't know. You definitely can have multi-agent systems if you're talking about multiple weather stations, communicating and feeding into an AI that then creates the predictions. Oh, it's complicated. So the individual weather stations would probably be multi-agent systems. The single program that runs big predictions could be an agent-based model or it could be an AI or it could be both. So you are not wrong to have a good spread of answers here. Well done, everyone. You're at foxing me. Oh, here's one. Maybe you'll have thought about our self-parking cars, AI multi-agent systems or agent-based models. Yeah. Yeah. I mean, your initial reaction here, certainly the distribution of answers I'm agreeing with. I'm inclined to think self-parking cars are probably AI. They are using their own cameras, their own sensors, their own internal sort of like logic to learn how to park this car in this space that they can see. Now, some self-driving cars are multi-agent systems because you'll have multiple cars who then connect. They talk to each other about how to best get the entire group moving at a consistent speed. And you certainly could have an agent-based model which is testing out different kinds of algorithms. But yes, self-parking cars, the actual ones that you can get now that you push a button and it parks itself, those are AI. Now, let me talk a bit more about agent-based models. And you think, oh, we should have had this before we answered all those questions. But don't worry, you're not wrong. No one has got the wrong answer. But let's talk about agent-based models. They have a simulated world that has both states and rules. And I'll talk a bit more about what that means. But before that, apparently, I have a question I wasn't expecting. But let's talk about an agent-based model. What in theory would you use an agent-based model to explore? I mean, I thought this was coming at the end after we talked about agent-based models a bit more. But that's all right. Media discourse, COVID spread, very good. You're going to like my examples later. Media discourse is an interesting one. So maybe how people get into, you can certainly model how people polarize in discussions. I think quite interesting. Social systems, pandemics, racism, voting spreads. These are great examples. Inequality, a psycho-linguist. So if possible, the ways in which different components of processing system interact. These are great. Induction of cycling, ideas, a spread of ideas in a population, humanitarian systems, obesity, social systems, disease modeling, pupil progress and educational friendships, collaborations, complex system dynamics, migrations, revival. These are some wonderful examples. I'm loving this. How policies affect social phenomena. That's a great one. Anchor tech and farming, collective action, conflict, information dissemination, pest suppression. The landscape scale by farmers. Very good. Interaction and effects of agents. You can't predict the actions of people, dogs, trams. Very good. Yeah. That's really quite, I mean, riots. These are some great examples. And I'm very pleased that you have such a good variety of very interesting examples. Because let's go back into where I thought I was. So simulated world, agent-based models have a simulated world with states and rules. And within that world, they have objects and or agents that also have states and rules. So you see it's kind of a nested system. We have a thing with states and rules that also has things that have states and rules. And in fact, those things can have things that have states and rules. We won't go too far down that rabbit hole. So let's talk, here's the world. I mean, this is a example taken from a video game that you might recognize it if you're a great big nerd. That's fine. They can represent any scale. So actually the landscape farming scale that came up earlier is great. So the world can represent an individual farm, a collection of farms, a country in which there are farms of various size. You know, you can pick whatever scale you want for your world in your agent-based model. And it proceeds through time and discrete time steps. And again, those can represent any scale. A time step can be a second, an hour, a week, a year. It kind of depends on what you're modeling. If you're modeling the world, you know, like as in multiple nations, probably your time steps are also going to be fairly big, you know, maybe days. Whereas if you're modeling, you know, an individual farm, maybe hours, you might say like how many people, you know, where are the cows now, that kind of thing, or how many insects do we have right now at this time of day, because it does matter time of day for animals and plants. And your world can include any potentially relevant factors that you care about for your research questions. So that could be the population, for example, the population of insects, or the population of plants or animals that are on this farm. The weather that's going on, infrastructure like, you know, is water flowing in or goods flowing out via road or by a train or canal, and laws, so what's the maximum amount of, you know, insect repellent that you're allowed to use in this place at this time if you want to qualify as organic or, you know, all of these things affect your world. And if they affect your world, you can include them. And the world is unique for each agent within the model. It contains everything else that is outside of that agent. So, you know, Pac-Man's world contains Inky, Blinky, Pinky and Sue. But Pinky's world contains Pac-Man and Inky, Blinky and Sue. Yeah, as you go again with the game, I apologize. And the world has states and follows rules. I'll explain more on this later because, you know, I don't want to get ahead of myself too much because the agents also have states and follow rules, so I'll explain them all at the same time. And the agents, they can represent things in your model. They can be people, they can be cars, universities, businesses, train lines, whatever you want. They, again, like the world, include whatever you think matters to your, the world you want to create and test and study. So, you know, if you're talking about farms, maybe that's bank balances or crop output or, you know, many animals that live there at the time, things like that. You know, if we're talking about cars, it might be color and speed, efficiency, gas mileage, something like that. If we're talking about universities, be competitive ranking, number of students, maybe the physical, you know, location of the buildings, things like that. So, whatever matters to your question, your world. Agents are unique and behave uniquely. Even two agents that start out exactly the same way and follow exactly the same rules will be unique because they will have access to information at a different time. In the simulated world of computers, one of them will always go first. They never exactly take turns at the exact same time, so there will be differences, which can be quite subtle or quite obvious. They have states and follow rules. I did warn you it will come up again. And the agents importantly make decisions. Even deciding not to act is a decision. So, that's what makes agents different than objects in the model because agents make decisions whereas objects have decisions acted upon them, I guess. Right. So, let's talk about states now. A state is the current features of an agent or the world. So, it could be, you know, what's the global temperature if you're modeling sort of air currents or ocean currents or something like that. It could be, you know, current bank balance if you're talking about farms or businesses. It could be current number of students if you're talking about universities. So, whatever features are important in your world, the state is the current status of all of those things. They can be dynamic or static and they can randomness. They can grammar. They can use randomness to inform the dynamic states. So, for example, a dynamic state would be something like what's the current temperature? Temperature is expected to change. A static state would be what is the name of this university? That is not expected to change. It's not very rapidly. And randomness can include things like, you know, certainly weather models include a lot of randomness, but even, you know, traffic models, for example, would include things like there'd be a certain random time delay about how many people take journeys today as opposed to a typical day. So, the current state can be influenced by the previous state of itself or others, according to the rules. So, let's take an agent. Its current location would be part of its state. Now, its current location is strongly influenced by its location at the last time step. So, where I am now is strongly linked to where I was a moment ago, barring, you know, sort of like some kind of sci-fi world where people can zap around randomly. So, the rules might be about how fast I can walk. You can really predict how far I can get to if you have good rules about how fast I can walk or what modes of transport I'm allowed to take. So, you know, can I catch the bus or the train? Can I ride a bike or drive a car that will change the rules about how fast I'm moving at a given space? But they're still influenced by my previous state. And the current state can influence future states. Ah, I have a question. What's the difference between states and variables? That's not bad. Let me just explain this one. So, current state, just as it can be influenced by previous states, can influence future states of myself or others. So, the fact that where I am now will be linked closely to where I will be soon, but it also might influence where someone else is. So, if I'm standing, you know, so far away from the bus doors, the person who wants to get off the bus after me has to stand slightly behind me. But in the future, they will stand where I'm standing. So, there's an interaction there according to the rules of behavior. So, states you can think of as the sum of all the variables. Variables are individual status of a particular feature. A state is the collection of all of the variables at a given point in time. Hopefully that clears that up. This is slightly pedantic language. Some people might call it the collection of variables. Other people might call the states A, like a meta variable. They're very closely linked, but at least in the worlds that I've been working in, states is a collection and variables are individual. Now rules. So, what are these rules? They govern how states change from one moment to the next or how decisions are made. They can use model generated info, such as the states, model a choice and randomness. That's, they can be simpler complex. Let's look at some example rules. You might have rules about if you're trying to travel to study how bike use might change over time. You might have agents have rules like if weather equals raining and temperature equals cold, I travel by bus. Otherwise, I travel by bike. Now you might give 70% of agents this rule and the other 30% of agents will have a different rule that says always travel by bike. Those are hardcore people who have good weather gear. Other people might actually always travel by bus. They really hate bikes. You can have different agents with different rules. Maybe another rule might be while interest rates are lower than or equal to some predetermined limit. Borrow and spend, but do not save. And then if interest rates go up, start saving because you can see that there's a, we in fact, as humans have these kind of rules, heuristics, but we don't often make them formal. I will do question and answer at the end, ideally. It's just that one came into the chat and they caught my eye and I was distractible, distractible as a kid. Another rule, for each school-aged child in the house, spend X money on school fees uniform. So if your model includes something about budgeting and sort of spending and saving and something like that, you would have rules like spend so much on school uniforms per year per child. So these are just some sample rules. Obviously the rules that you would build for your model would be very specific to your research question. Now let's look at the sample models I had. And when someone asked about the pandemic and COVID spread, I think you'll like this model. I've switched over to NetLogo now. So you should see this screen. And NetLogo is a free and easily downloadable, quite a small program that you can download. And it comes with a bunch of preset models that you can use. What you do is you change anything that has a slider. You can sort of drag that up. So maybe let's have 300 people or maybe I want just 120. You can change how infectious the disease is, their chance of recovery, their illness duration. You can even change whether you want them to look like people or circles. Let's go with people set up. So red ones are infected, green ones are not. And then if I hit go, you'll see they all move around. You know, blah, blah, blah, blah, blah. People who had been infected and recovered are now immune. You can track that number here. Healthy, total, sick immune. So you can see these charts. You can also get sort of numerical values of how many are infected, how many are immune. You can stop this and you look at it now. There's many more red, quite a bit of gray. Those are now immune people. You can then change the numbers. Let's make it a lot of people, very infectious, chance of recovery. But I won't change the others set ups. Now there's lots more people go. What happens here? We see very different numbers here. And that's because I changed the parameters of the experiment. And we get very different interactions. Ooh, look at that. There's no red. There's no sick people. It burned itself out. That's very interesting. Now. That, if I move back to my mentor meter is the simple example. And if we go on, there is also a complex example. Which here has many more sliders. You know, different kinds of things you can decide, are they allowed to travel? Are they not? Are they allowed to move around within their areas? Let's just set it up so you can see. This is one in which there is two different regions. There's a barrier to travel between those regions. So let's let it run as it is. We see that one side is much more infected than the other. But in fact, the populations, it sort of settles down to where it, the infection dies out quite quickly. Infection and recovery rates, you can see them here. But let's change the sliders and see it again. Maybe lots of people infected. Average isolation tendency. Let's say. Let's move that down. I have no reason to believe that people would be. Less likely to isolate. Average hospital going tendency inoculation chance. Initial ambulance. You can read more about it in the info tab. So let's. Set up now under the new conditions and go again. Lots of people. Get infected very quickly. But it looks like they're also dying out quickly. The disease is dying out quickly, not the people. So you can see how the same concept and same epidemiological concept of people moving around infecting each other, being infectious for a certain period of time, and then recovering is the same on these two. Different examples, the simple and the complex, but one obviously being more complex allows you to ask different kinds of questions like should people be allowed to travel in and out of infected areas? What happens if people resist going to a hospital or resist getting inoculations? So you can ask more complex questions in the complex example, but likewise it is also harder to build and harder to analyze because there's more data coming out of it. So this brings up why should you even worry about an agent-based model? It's because how things play out at big scales is not intuitive for bottom-up systems. So how people will behave in a global pandemic, for example, I think many of us might have been quite surprised by how some people behaved in a global pandemic. We really did not understand the variety of reactions people would have, how that relates to their internal rules and how the interaction of those rules over time would play out. And agent-based models, for example, if we were to double the number of agents, it would increase how infectious the disease was or to change the time of recovery. Anything that we can change, as humans, really bad at predicting what effect that will have. I, for example, expected increasing the number of people and increasing the infectiousness to lead to longer-lasting disease throughout this population. But in fact, they all got infected and it burned itself out quickly. Obviously, in this condition, there was not the option for the virus to mutate and can people to get infected more than once, but that's a change you could make if you wanted to test that. Okay, so that's why you should use an agent-based model. Let me go back to that a little bit. Because it's not always ethical to experiment directly on people. That's one of the clear reasons to use an agent-based model. It's not great to just say, hmm, throw it at the wall, see if it sticks, see what happens. It's certainly in situations where the outcomes are really important, really life-changing, really life-or-death questions. It's not great to just sort of have a go. Also, we only get one chance to have a go in real life. Whereas in an agent-based model, you can run it again and again and again and say, well, maybe if we increase inoculation by 10%, what happens? How many people get infected? You can test all of those things multiple times. And so that's certainly better scientifically because you can do statistics on it. Whereas the real world only happens once, a sample of one is not good for statistics. So what do you do with the output? I mean, it depends on the model. But common options include parameter sweeps or interaction testing. So you saw where I changed the sliders. Those are parameter sweeps. I mean, not in a very professional way. I only picked two locations. Whereas a parameter sweep in a real model, you would pick maybe every 10. It would increase by 10 each time. So you can do that with the model once with parameter at zero, once again with parameter at 10, once again with parameter at 20, and so on. And you can do that with more than one parameter at a time. So you can say, the population only really has an effect after it gets to a certain point, unless inoculation is at this level. So you could say there's an interaction between those two parameters, but only in a certain space. So that's an important one. And that's something that we're not good at predicting just off the top of our heads. Like, oh, pro no, inoculation doesn't matter unless it's below a certain level. And then it really matters. People are just bad at those kinds of predictions. Outcome probabilities. So even with the exact same parameter testings, there is still randomness in most agent-based models. And that leads to different outcomes. But if you run it a thousand times, say 75% of the time we get outcome A, 10% of the time we get outcome B, and the remainder outcome C, you can sort of differentiate between how likely things are to happen with different combinations of parameters. You can identify emergent phenomenon, such as that the virus burns itself out by a certain time, or that traffic jams form, or that the market goes into a sudden crash, or something like this. These are emergent phenomenon. They're typically very hard to predict in the specific. But if you run thousands of runs of a model, you can predict we get at least one crash every time. These conditions lead to crashes. So that's something you can predict. You can also export the results to another analysis method, such as the social network analysis. In these models, the agent seems to just sort of move around randomly, sneezing on each other. But if you had a more complex model in which they moved very closely in certain social networks, and only occasionally outside of them, then it makes sense for this, the data from how they were infected, how and when they were infected, how long they were ill, things like that. You might export that to analyze with social network analysis to identify key hubs, super spreader events, things like that. That would be quite important. Now, the pros of agent-based modeling are that there's no need to rely on crummy human intuition for complex behaviors. You can formalize mental models for inspection by others. So when I write down the rules about, like, if it's cold and it's raining, travel by bus, otherwise bike. People will be able to look at that and say, yes, that's correct. That's how I think about traveling as well, where someone else would say, no, I definitely care about the cold, but not the raining. I've got good wet weather gear, but cold really does me in. So they can really look at it and criticize it carefully. Whereas when we're speaking just as people, we might say, if the weather is bad, take a bus. What do we mean by bad? We have to formalize it. Forces abstract concepts into concrete representation. So infectiousness, you know, ill or recovered inoculation rates. We're forcing these to be numbers and concepts that computers can understand, which means that we definitely able to write them down and understand them. Sometimes it's easy to get away with not really understanding. It's relatively cheap and easy to test the untestable, things like what would happen if we changed the road layouts tomorrow, or if we managed to achieve 100% inoculation. Inoculation rates. It's potentially very fast. You saw how fast those models run. That is much faster than real life. Can show a range of possible futures. Can use real data, training data, random data. So you can base your model on real world observations or completely made up things. It's up to you. You can run it multiple times with or without changes to really get a statistically analyzable set of outcomes. And it can be very intuitive. It's clear that when I showed the difference between the simple and complex model, those differences seemed very clear in the demonstrations. Whereas if you were to look at the code or look at a wordy, you know, sort of journal article about these differences. Probably some people would understand that, but other people wouldn't. Whereas the visual representations is generally very easy to understand for most people. Now the cons are that mental models and the agent based models that we build based on our mental models can be difficult for us to see the problems with. And when other people point out the problems, we get very defensive. Concrete representations may not always adequate to capture abstract concepts. So inoculation resistance, for example, includes a lot of things about healthcare mistrust, but also like tendency to follow weird people on social media or maybe access to reliable doctors, surgeries, something like that. There's a lot of things there that are collapsed into one. And maybe that's a problem. Being fast, certainly faster than the real world, lends itself to prediction, but the predictions are only as good as the models they're built on, which people tend to overestimate how good their models are. Possible futures are hard to turn into risk profiles. So when we know that 70% of the runs result in situation A and 20% in situation B, et cetera, that's kind of hard to deal with. We don't know, should we avoid that situation? Should we prepare for that situation to happen? What measures can we take to deal with that? It's not always easy. They give a false sense of security and truthiness because it's computers and it's full of colorful flashing lights and people are really bowled over by computational analysis. Likewise, some people are really distrustful with computational analysis. So you get people who will automatically agree with whatever you're saying because you presented it through a computer and other people will automatically disagree with everything you're saying because you presented it through a computer. They're very easy to misunderstand. So the fact that I showed a simple and a complex model and the differences seemed quite clear. We're probably fooling ourselves that we understand those differences very well. There's lots of platforms. Mason, RePast, NetLogo, that's the one I've used, and Lab, Agent Spring, and Object-Oriented Software. If you're already coding in Python, you can do that. There are pros and cons to a lot of these. Some of them are easy to learn or free. Others are strong but less different, more difficult to learn to use. Some are modular. Some you have to start from scratch every time. These slides will be available on the website and the YouTube video later. So you can always look at this list in more detail again. Here's more resources. Again, these links and the slides will be available later. So I won't go over these too much. But just comparison of agent-based modeling software is what an agent-based model is. Comcess is a resource with lots of agent-based models that you can download and work with. Summary, top-down is reducible, isolatable, straightforward, whereas bottom-up is non-intuitive, large-scale consequences of many small decisions. Agents are heterogeneous actors that observe, decide, and act. Agent-based models are bottom-up simulations with easy testing. Pros are that you can inspect it. It's cheap, easy, fast, and it can do impossible experiments. The cons are that it simplifies complex concepts, can be misused for prediction and misunderstood. Let me take the Q&A now. Does bottom-up have to have feedback loops? Almost always. I think complex, to be a complex or chaotic system, you have to have feedback loops so that things can really spiral out of control quickly. I don't believe that bottom-up has to have feedback loops. A good example of that would be that cellular automata, which is not easy to say, is one of the agents, sorry, one of the models you can look for. Let me just go here. If you download NetLogo and go to File, Models Library, and I believe biology is cellular automata. You get these fractal patterns that they are bottom-up emergent phenomena, but they do not have feedback loops, so it's not strictly a feedback loop consequence, although feedback loops, I believe, are essential for chaotic behavior. That can be wrong. Regarding the track example, I wonder if agent-based models and AI machine learning used in automated cars intersect. Certainly there is an intersection in that people model traffic behavior with agent-based models, and you can use agent-based models to teach AI algorithms how best to behave, and probably they go feed one into the other, but an agent-based model would not be in control of a car, for example. Agent-based models are just about exploring possible worlds. They're not for actually making decisions. I hope that answers your question. I cannot feel free to submit another one. Shouldn't be aimed to let complexity generate the randomness automatically? I mean, in theory, complexity, the randomness is generated automatically. In these models, for example, which agent goes, which of these agents goes first, or maybe even what direction they start moving, is generated automatically by a kind of pseudo-random number generator within NetLogo. You can certainly add randomness to variables that are not totally random. So, for example, you might have the price of a stock at one time step could be generated pseudo-randomly from the price of the stock at the last step, plus a random number up to five, minus a random number up to five. So it could stay exactly the same, could be higher or lower by a little bit or a lot, but it's going to be similar to the last number. So that would be a pseudo-random inclusion of a rule. But again, if that didn't quite answer your question, feel free to submit another one. Discrete time steps. Do they have to be fixed units or can they be varying real number intervals? In NetLogo, the time steps are always fixed units. But you can set rules to act on intervals of time steps. So each time step counts as one time period moving forward, but you could have a rule that says the sun goes up after 300 time steps and the sun goes down after 300 time steps. So a state like the sun is up changes from one to zero every 300 time steps. But the time steps themselves aren't controlling that. That's a rule based on time steps. Let's see if that helps answer your question. If not, again, submit another one. Do you have any tips on how best to report results of agent-based models that find the static format of papers encourages you to report results of a few selected scenarios? Ideally, it'd be nice to let readers play with parameters themselves explore what happens. Yes. You can load your model and datasets to accompany it in things like openabm.org. That's an online free repository for agent-based models. You can also create, there's netlogo.web. It doesn't work for all NetLogo models, but certainly some models. You can create a web portal where people can just play with your model directly on the web. No need to download anything. You can create interactive websites, like with Jupyter notebooks or R-pods or something so that people can play with your data. It's sort of dynamic charts and tables and things like that where they can filter as they like. So there's a lot of ways you can get dynamic interactive outputs for your model. I agree. The problem with journal articles is you really just have to publish things in a table, and that is not the best way to see the results of such a potentially wide-ranging and complex exploratory tool. Like agent-based modeling, but in fact, like many of things, there's loads of analyses that benefit from seeing videos. In fact, you can take videos of your model running, put those on YouTube, link to it. That's a good option. Videos, interactive things, maps, these are all very useful, not easy to put in journal articles. The outcome is not probabilistic that it must be a top-down model, mustn't it? No, I don't agree. Well, I mean probabilistic is you're determining whether it's probabilistic. The thing is deterministic, as in this thing has this consequence, is still true of chaotic models, chaotic systems, in fact. They are deterministic but not predictable because there's just the wide interaction of low-level deterministic rules is still unpredictable. And that's the difference between purely linear kind of determinism where 1 plus 1 always equals 2, whereas z plus z squared does not always equal. And you get these kind of like spiraling things, mandal fractals, and these things where really simple deterministic rules can still spiral really quickly into unpredictable spaces. And so that's somewhat what agent-based models are trying to do. I'm not sure how low-level rules about how people behave. I know that I will take the bike if it's not raining and cold. But how many other people, either with the exact same rules as me, will take a bike and then how busy will the bike lanes be, or how many people will drive instead and how congestive will the traffic lanes be? These are not easy to predict. Hope that answers your question again in more, if it doesn't. How produces the model workings? For example, who decides how many people infect a number of other people? Will these be created by researchers using known data? Yes. How the rules are built into the model is determined by the modeler. This is something that we think it's included in the code here, this third tab. So the info tab gives you more information about the model, why it was built, maybe what data sources they used to inform its thinking. But the code is specifically the rules like if raining plus cold equals take a bus. In theory, those rules should be informed by either experience or proposed rules that you want to see how that works in the world. Should we mandate vaccines? How will that play out? Should we make it easier and cheaper for people to get vaccines but not mandate them? How will that play out? These kinds of things, they could be forward looking. So you create rules that you think might be important. Or you can base them on how things are now and use that as the basis for the rules. Occasionally, you can also have rules that are dynamic. So after a certain number of time steps, the rules change. Or the margins get closer or something like that. They don't have to be fixed throughout the whole of the simulation. Regarding probabilities, are you thinking frequentist approaches or they're also Bayesian approaches, different approaches with different inferences? I mean, how you deal with the statistics and how you interpret them is really up to your research questions and how you built the model. So if you're looking to know how many times, under what parameters, you will get at least 50% of epidemics that burn out within a given time frame. You can analyze it that way. If you want to look at the parameters that lead to, you know, predict, basically whatever questions you want to ask of the real world, you could ask of your model if you build your model to look like the real world. So whatever approaches you want are valid. And this just gives you a synthetic world in which you can pull all the strings and play God and run it as many times as you want. So essentially, this is giving you a multiverse to play with and observe. And you can do whatever you like with it because they're little digital people and they don't have rights. Again, ask another question if that didn't answer it. Any recommendations for resources in Python to do agent-based modeling? I put that there really as an extreme example. Python is such a broad tool that I'm not aware of a lot of people who work in Python. It certainly doesn't come with this lovely automatic visualizer. And so I would say it's a very advanced method. And it should be for things where really you want to crunch very large models and you don't need a visualizer because you understand the model quite well and you just want the output, all of it to happen behind the scenes. So I don't have any clear resources for Python. I would say get really good at understanding how models work and what you can do with them and how much time it takes to build simple ones in something like NetLogo. And then if you think, oh, actually, there's a huge complex model that I could build in NetLogo, but it would take weeks to run the simulations or build it in Python and run it in days instead on a high-powered machine. So, yeah. Sorry, I don't have a better question for resources for Python. What are the boundaries of prediction in complex systems? That is beyond the scope of this paper. No. I mean, that's a difficult one. What are the boundaries of predictions in complex systems? I would say in general, predicting complex systems is a fool's game. I would say it's a better approach to explore what seems to be likely probabilities in complex systems. That is to say you can find the edge of chaos within a system. And there's certainly a lot of go back into the model's library. And show you this. There are art, biology, computer science. There's mathematics systems. These do a lot of things with fractals and probability. There's emergence. There are some really good models already built in there that will allow you to see, to run a model under the same or different conditions and see how often the outcome veers towards the left or veers towards the right or completely collapses or something else. And that's a useful way to understand how predicting complex systems works. Because it doesn't work like a time, like a linear model. It doesn't create a line of best fit. It creates scenarios that have different probabilities. If that helps. It may not, because that's quite a woolly answer. Can you nest models? Could you have this infection model feeding into a larger model of the economy or healthcare spenders sources? Yes, you absolutely can. You can certainly have the outputs of what model be imported into another model. There are, I'll show you some things here about code examples. So there's all kinds of things like I'll just search. It's easy. CSE code examples. So you can look up how to import files. So you could have one model that creates a CSE and exports it. And then another model that reads it and imports it. And you can have one model that maybe generates how neighborhoods create social networks. So you get this sort of big fund. Let's see if we get a social sciences. You can get bidding markets, fruit wars, segregation models, rumor mills. Now these kinds of things. So if you're interested in creating maybe a shape organically, you can build that in one model and then import it into another model and use that shape as your, you know, a shape for a city, for example. The biology has slime molds. That's quite a good one if you want to create sort of organic hub and spoke network shapes. So that's great. I seem to have answered all your questions. So unless someone has other questions, let me just remind everyone that there is an evaluation when you leave the webinar, please complete our short survey. And also here's my contact details. You can hassle me on Twitter if you like.