Statistikk og Simulering

Lab Veke 7–11. Predator/Prey

Veke 11. Analyse av predator/prey

8.5. Veke 11. Analyse av predator/prey

I denne siste delen av prosjektet, skal me sjå på data frå simulering.

In the following exercises, you are asked to plot data from your simulator. A good and straight-forward approach to do this is the following:

Your simulator dumps the statistics to a file using comma-separated values (CSV).
Load the CSV file into Matlab or another appropriate tool.
Plot the results using the plot() function in matlab or similar.

Instead of Matlab, it is possible to use a spreadsheet tool (libreoffice) or python, or a number of other tools.

Oppgåve 8.18 Using the log data from your simulator, plot the population size for each species as a function of time. Present one plot for each of the three scenarios from Exercise 8.16.

Oppgåve 8.19 Consider the scenario with co-existing predator and prey. Run the simulator a couple of times and plot population sizes versus time for each run. Discuss the results.

We are interested to know what the expected population size is at a given time in the future. Because the populations are oscilating, the size at a single point in time is not meaningful. It is in contrast very interesting to compare the two populations, using the correlation coefficient.

Oppgåve 8.20 Consider the scenario with co-existing predator and prey. Calculate the correlation coefficient of the two population sizes. If the population sizes at time step i are Xi and Y i, calculate the correlation coefficient between

Xi and Y i
Xi and Y i+1
Xi and Y i1
Xi and Y i+2
Xi and Y i2

Feel free to try other offsets between the two signals. Discuss the results in your group.

Oppgåve 8.21 (Discuss) What is the relationship between the population sizes of the predator and the prey.