Population Models

1: Exponential Population Models

As you work through these lab exercises, you will run the R code provided below, to produce graphs that you will interpret. The blank areas below are the spaces where your results will appear once you run the code.

In some exercises, you will be instructed to add or edit values in this code. To do this, just click in the box containing code, and type whatever the instructions tell you to type.

If you ever make a change that causes the code not to work, just refresh the web page, and everything will be reset – so try whatever you want!

Exercise 1.1: Predicting population growth

Set our starting population size N0 to 100, and our rate of population growth λ (lambda) to 1.5 by typing those values in the box below, in the spaces provided on the first two lines.

Need a hint? Click in the box below, on the second line, which says N0 =. It will let you type in the box. After N0 =, type 100. Then look on the fourth line, which says lambda =. At the end of that line, type 1.5.

Click Run, and examine the plot that is provided.

Now, change the time frame of our model. Currently, it shows a prediction for ten years in the future: t = 0:10. Let’s predict 20 years in the future, by changing that line to t = 0:20.

Click Run again, and examine the new plot.

Exercise 1.2: Trying different growth rates

Now we will update our code so we can look at multiple population trajectories, following different growth rates, on the same graph. You don’t have to edit anything yet: just click Run.

After you examine the figures, change the values of g1 through g4, and re-run the code. Repeat this as many times as you want to experiment with different growth rates.

2: Stochasticity

Exercise 2.1: How does stochasticity affect growth rates?

Before you change anything in this code, click Run to generate a histogram of growth rates that we might observe in our stochastic model.

After you observe the histogram, change the amount of stochasticity, by increasing or decreasing the value after sdval =.

Click Run again to see how this affects our growth rates.

Exercise 2.2: Comparing model predictions with or without stochasticity

This code will run a model to predict population growth over 20 years, starting with a population size of 100 and a growth rate of λ = 1.2. It will run this model both without stochasticity (λ always equals 1.2) and with stochasticity (λ will vary around an average of 1.2).

You do not need to edit the code below. Click Run, and examine the two figures that are produced.

Exercise 2.3: Replicates of a stochastic model

In this exercise, we will run our stochastic model ten times in a row, and plot all of the predictions in the same figure. Once again, our initial population size is 100, the average growth rate is λ=1.2, and we are making a prediction for 20 years in the future. You don’t need to edit the code for this exercise: just click Run.

3: Population Viability Analysis

Exercise 3.1: Calculating average population growth rate from observed population sizes

In this exercise, we will use data on population sizes of an endangered plant over time to determine the average rate of change (λ) in that population. We will need this λ to run our model. You don’t need to edit the code below: just click Run.

Exercise 3.2: Predicting change in the population over the next 20 years

In this exercise, we will run a single replicate of a stochastic model to predict how this population will change over the next 20 years. To set up this model, edit the first two sections of the code below to set time = 20 and the starting population size N0 = 34. This size is based on our current population size, most recently observed in our dataset (34 individuals in 2020).

Once you have added those numbers, click Run. Examine the graph.

Exercise 3.3: Repeated simulations of change over 20 years

Now we will run five replicate simulations of our stochastic model, to see five possible trajectories of our population over the next 20 years. You do not need to edit the code below: just click Run. Examine the graph.

Exercise 3.4: Predicting extinction risk

In this section, we will run 1000 replications of our predictive model, over a 100 year time frame, and count up how many of those replicates show the population size shrinking to zero. Enter our number of simulations nSims = 1000 and our time frame Time = 100 below, then click Run. This will give you a value between 0 and 1, where 0 is 0% risk of extinction, and 1 is 100% risk.

4: Density-dependent (logistic) models

Exercise 4.1: Predicting population growth with a carrying capacity

Set our starting population size N0 = 10, our growth rate r = 0.2, the carrying capacity K = 500, and the time frame of the model t = 50 years. Then click Run and examine the graph.

Exercise 4.2: Different starting population sizes

Now we will run a model with a growth rate of r = 0.2 and a carrying capacity of K = 200, and see how the population trajectories change depending on the starting size. Choose five possible starting values, and enter them as Val1 through Val5 below. Choose some that are lower than 200, and some that are higher. After you enter your values, click Run.

5: Stage-structured models

Exercise 5.1: Predicting population growth in a stage-structured model

Let’s try to predict the size of the population next year, based on abundance values for each of our six teasel life stages. Set the initial abundances to seed1 = 1000, seed2 = 1500, ros1 = 200, ros2 = 300, ros3 = 600, and flowering = 25. Once those values are entered, click Run. Examine the table of results.

Exercise 5.2: Graphing change in the abundance of stages over time

You don’t need to edit this code. Click Run to see a graph (and table) of how the stage abundances change over a four year period.

References

Materials in this exercise are collected for use in BIOL423/523 Plant Ecology at ESU, and modified from published demos by Dai Shizuka and Kevin Shoemaker.