Statistikk og Simulering

Økt 19+. Analyse av predator/prey

Statistikk og Simulering

17. Økt 19+. Analyse av predator/prey

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 17.1 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 16.5.

Oppgåve 17.2 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 17.3 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.