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:

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 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 ${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.

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