This week, we’ll do a series of group exercises to get you practicing with randomizations, apply functions, and loops. For any one of these problems, there are multiple solutions. The exact codes don’t matter as much as the ability to think creatively to come up with a solution to a problem. Here are the guidelines:
Last week, we spent a little bit of time modeling exponential/geometric population growth with and without stochasticity in population growth rates. Those are all cases of density-independent population growth–i.e., there is no carrying capacity for the population. Today, we will start by modeling a classic density-dependent population growth model called logistic population growth.
As review, here is the exponential population growth equation: \[N_t=N_0e^{rt}\]
The rate of change of this population is simply: \[\frac{dN}{dt}=rN\] So, if we are plotting the change in the population over discrete time steps, we can say that \[N_{t}=r_dN_{t-1}+N_{t-1}\] Here, we use the notation \(r_d\) to represent the discrete growth factor
Then, we can project the population with a growth rate of \(r=0.2\) and initial population size \(N_0=10\) over a number of time steps (let’s say 50) like this:
r=0.2
N0=10
time=50
N=vector(length=time+1)
N[1]=N0
for(t in 2:(time+1)){
N[t]=r*N[t-1]+N[t-1]
}
plot(0:time, N, type="o", pch=19, las=1, xlab="Time")
Now, we will take the same approach to project the growth of a population that has a carrying capacity, K. In this case, the rate of change of a population at any time t is described the logistic population growth equation: \[\frac{dN}{dt}=rN\left(1-\frac{N}{K}\right)\] In this case, the population changes more (increases faster) when N is small, and stops growing when N approaches K.
To express population size at any time t, you can use this equation: \[N_t=N_{t-1}+rN_{t-1}\left(1-\frac{N}{K}\right)\] That is, the population size at time t is the population size in the previous time step (t-1) plus the change in the population.
Using the equation above, plot the growth of a population over 50 years given these parameters:
Make your plot look like this:
Now, build the same model but with varying initial population sizes:
and make a plot that looks like this:
Now make several different plots of this model with different growth rates:
Plot the results on 4 panels like this (the actual plots not shown):
You should see some interesting difference in the population dynamics. See footnote1 for details:
A random walk is a stochastic process that describes a path consisting of a series of random steps on some space. It is essentially a null model of the behavior of some process, and has extremely broad applicability, including from biology, chemistry, physics, and economics. Here, we will attempt to simulate the random walk process on a single dimension.
The rules of a random walk are simple:
Your goal is to simulate a random walk process from scratch.
Simulate 1 iteration of a one-dimensional random walk over 1,000 time steps and plot the results.
Produce a figure that looks like this:
Now simulate the random walk 5 times and plot the results, like this:
Logistic population growth undergoes different population dynamics under large population growth rates. When \(r<2\), the population converges towards K. When \(2<r<2.45\), we get a stable limit cycle. When \(r>2.6\) or so, the population begins to hope around an infinate number of unique points. This is NOT random. Rather, it is chaos–i.e., deterministic, non-repeating patterns.↩