BD 3.5 Practical: Individual Based Models

Here we will model a disease by building interactions of individuals rather than modelling mathematically with variables that represent entire populations.

After accomplishing the first five steps you'll have a model equivalent to the SIR model you have already built in R. But the methodology here is very different: the program describes the behaviours of individuals and the behaviour of the population emerges. The SIR model you built in R describes populations. After building the equivalent model you'll explore the influence of spatial and social heterogeneity on the spread of diseases. This would be very hard to model analytically with equations that model populations.

Step 1. Start the program.

Click on INITIAL MODEL to load a model containing only a population of susceptible individuals and some technical machinery. This model has no infected individuals or a mechanism for spreading an infection; these are things you will will add here.

Step 2. Explore the initial model

You should be starting with a model that includes only susceptible people.

Click on the RUN button in the Behaviour Composer tab and then NetLogo, a different modelling tool is launched inside the browser with the model constructed so far. Click on NetLogo's SETUP button to initialise the model. It should look like this:

insert image!

Try changing the slider labelled the-initial-susceptible-population and then click on the SETUP button to see its effect. To move the slider by small amounts, set it slider near the desired value and click the mouse to the left or right to move it by one unit.

Pressing the GO button does nothing since we have yet to introduce infected individuals or any other behaviours.

Step 3. Create some infected individuals

Click on this web page
CREATE-INITIAL-INFECTED-POPULATION
with the micro-behaviour to create the initial infected population. Click on CREATE-INITIAL-INFECTED-POPULATION and add it to the Person prototype to create an initial population of infected individuals. Then click on the greyed-out micro-behaviour of the Observer labelled CREATE-INITIAL-INFECTED-COUNT-SLIDER and select Activate. Run your model and you'll see an infected individual displayed in red after clicking on SETUP.

Step 4. Spread the infection

The simplest way to model encounters is where an individual randomly encounters another and probabilistically infects that person. This is implemented by the RANDOM-ENCOUNTER micro-behaviour. Browse for it and add it to Person. It needs the CREATE-ENCOUNTER-RATE-SLIDER and CREATE-INFECTION-ODDS-SLIDER micro-behaviours, which are already in the list of Observer behaviours so click on them and activate them.

Question 4a

Run your model: click RUN, click SETUP and finally GO. What happens?

Please enter your response in the form below…

Step 5. Add plots to see what is happening

It is hard to get a sense of the big picture without graphs. Click on the CREATE-EMPTY-POPULATIONS-PLOT micro-behaviour to activate it. Browse for and add ADD-SUSCEPTIBLE-TO-POPULATIONS-PLOT and ADD-INFECTED-TO-POPULATIONS-PLOT to Observer.

Question 5a

Run the model again and sketch what you see
(you may need to scroll down the screen to see the plot).

Please enter your response in the form below…

Step 6. Replace the random encounter with one based upon social networks

In above model that you have just made, each individual had an equal chance of contacting any other. This is not realistic for most disease scenarios.

We can incorporate a range of non-random encounters, while keeping the average number of contacts the same (we have set this figure to four). Add all of the following to your model by navigating to the web page with the micro-behaviour and open it. Click on the button labelled "Add this code to Observer". Once they are on the screen in the middle, make sure all are inactivated except the one you want to use.

Inactivate the RANDOM-ENCOUNTER behaviour and add the RANDOM-SOCIAL-ENCOUNTER to Person.

1. INITIALISE-SOCIAL-NETWORK-SYMMETRIC. Here each individual has the same number of potential contacts, called acquaintances. Disease can transfer only between individuals that are acquaintances (symmetric just refers to the fact that if A is an acquaintance of B then B is also an acquaintance of A). Add this to Observer since it is one behaviour that creates relationships for the entire population.

Question 6a

Run this model and compare it to the random encounter model where any two individuals had the same chance of contacting each other. Describe the difference below.

Please enter your response in the form below…

You can show lines of social contact (linking to the four 'acquaintances') and subsequent lines of infection by the following. Add DISPLAY-LINE-TO-EACH-OF-MY-ACQUAINTANCES to Person. Reduce the number of susceptibles to about 10 and run the model.

This is rather confusing with more than a handful of individuals so we replace lines of social contact with a variable size of the individual: the bigger the more social contacts. Inactivate DISPLAY-LINE-TO-EACH-OF-MY-ACQUAINTANCES and add SET-SIZE-PROPORTIONAL-TO-NUMBER-OF-MY-ACQUAINTANCES to Person. Since everyone has four acquaintances when INITIALISE-SOCIAL-NETWORK-SYMMETRIC is used the sizes are the same now. Run the model until it stops (STOP-EVERYTHING-WHEN causes it to stop after 50 cycles). If you run your model within NetLogo you can save the plot after running this by clicking any where over the plot and choosing the 'copy image' option. You may wish to choose 'select' first and make the plot much bigger. Open up Word or your favourite word processor and paste the image of the plot into your document and write a caption. Alternatively you can use the 'Print Screen' facility in most operating systems to capture the screen as an image.

2. INITIALISE-SOCIAL-NETWORK-NORMAL-DISTRIBUTION-SYMMETRIC. Here instead of each individual having the same number of acquaintances, we use a normal distribution (the familiar bell-shaped curve) with mean of four, so some individuals have more and some have fewer acquaintances. Notice the difference in when most of the popular and unpopular individuals become infected. Once again choose the 'copy image' option after clicking on the plot and save this plot. Compare the plots in your document.

3. INITIALISE-SOCIAL-NETWORK-POWER-LAW-DISTRIBUTION-SYMMETRIC. Here we use a power distribution to determine how many acquaintances an individual has.

Question 6b

Add the plot to the above two and sketch the difference below.

Please enter your response in the form below…

Question 6c

Draw the social networks in the above three models that you might observed for say five individuals.

Please enter your response in the form below…

Question 6d

The power law distribution more accurately represents the situation in a sexually transmitted disease such as AIDS in a population where some individuals have a very large number of encounters while others are monogamous or nearly so. Run the model for a second or two until you see different size images of people. If you run the model in NetLogo you can remove individuals from the population by clicking on an individual and selecting from the bottom submenu 'inspect object nnn'. Scroll down to find the field labelled 'dead' and change false to true and then type enter. Quantify the effect of removing the most promiscuous five individuals (roughly the largest ones) from the model.

Please enter your response in the form below…

Question 6e

Apart from representing social networks, what other important factors in the spread of a disease could be represented by this new parameter?

Please enter your response in the form below…

Question 6f

In what other areas in biology might such individual based models be useful (some clues given in website that you have been browsing)?

Please enter your response in the form below…

Step 7. When you run your model it is saved. Copy the URL for the model and email it to us.

Please send email to ku.ca.xo.scuo|nhak.htennek#ku.ca.xo.scuo|nhak.htennek attaching the link to your final model and your document containing the saved plots.

Options if finished early or if you wish to continue another time:

If you want to model recovery so that infected individuals can change their state to recovered you can add the
RECOVERY-POSSIBLE-AFTER-INFECTION
micro-behaviour to Person. You should also add
CREATE-RATE-OF-RECOVERY-SLIDER
. If you want to graph the recovered population then add
ADD-RECOVERED-TO-POPULATIONS-PLOT
to Observer. You may wish to add DISPLAY-LINE-OF-INFECTION to Person to see a graph of the infection emerge.

Click on INITIALISE-SOCIAL-NETWORK-POWER-LAW-DISTRIBUTION or the other behaviours for initialising a social network and select 'edit'. Change the '4' in 'let average-acquaintance-count 4' to another value and click on 'Save'. Re-run your models.

Try adding RANDOM-SPATIAL-ENCOUNTER and inactivate RANDOM-SOCIAL-ENCOUNTER to explore diseases that spread spatially.

Explore the other possibilities in the BehaviourComposer.

Start of the feedback e.g. google iframe embedded below:

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License