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:

1.
Your simulator dumps the statistics to a file using comma-separated values (CSV).
2.
Load the CSV file into Matlab or another appropriate tool.
3.
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 ${X}_{i}$ and ${Y}_{i}$, calculate the correlation coefficient between

1.
${X}_{i}$ and ${Y}_{i}$
2.
${X}_{i}$ and ${Y}_{i+1}$
3.
${X}_{i}$ and ${Y}_{i-1}$
4.
${X}_{i}$ and ${Y}_{i+2}$
5.
${X}_{i}$ and ${Y}_{i-2}$

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

17.1 Session 9