library(shiny)
# library(rsconnect)

### RE-INSTALL EACH TIME YOU PUSH TO GET LATEST VERSION...
# devtools::install_github("EcoEvoEducation/EcoEvoApps")

Introduction

In the logistic model of population growth we saw that resource limitation can be included in an abstract way by including a carrying capacity for a population. But, what if there are also other species competiting for the same resources? Depending on the strength of competition, competing species can reduce equilibrium population abundance below the carrying capacity. To jog your memory, here is the discrete-time version of logistic growth:

$$ N_{t+1} = N_{t} + rN_{t}\left(1-\frac{N_{t}}{K}\right) $$

where r is the intrinsic per capita growth rate, N is the population abundance, and K is the carrying capacity. The effect of $\left(\frac{N}{K}\right)$ is intraspecific competition (density-dependence) -- the closer N comes to K, the slower the population grows. However, *carrying capacity" is a notoriously difficult term to define and quantify. Peter Chesson (2000) describes a more intuitive way to think about population growth by assuming that "per capita growth rates are linear decreasing functions of the density" of the population (Figure 1A). When this is the case, population growth rate starts low when a species is at low abundance (low $N$, high $r$), increases to a maximum when a species reaches a moderate abundance (medium $N$, medium $r$), and then decreases as the population reaches a high density (high $N$, low $r$) (Figure 1B).




library(ggplot2)
library(ggthemes)
library(gridExtra)
library(viridis)
my_theme <- theme_bw()+
  theme(panel.grid.major.x = element_blank(),
        panel.grid.minor.x = element_blank(),
        panel.grid.minor.y = element_blank(),
        panel.grid.major.y = element_line(color="white"),
        panel.background   = element_rect(fill = "#EFEFEF"),
        axis.text          = element_text(size=14, color="grey35", family = "Arial Narrow"),
        axis.title         = element_text(size=16, family = "Arial Narrow", face = "bold"),
        panel.border       = element_blank(),
        axis.line.x        = element_line(color="black"),
        axis.line.y        = element_line(color="black"),
        strip.background   = element_blank(),
        strip.text         = element_text(size=14, color="grey35", family = "Arial Narrow"),
        legend.title       = element_text(size=14, family = "Arial Narrow"),
        legend.text        = element_text(size=14, color="grey35", family = "Arial Narrow"),
        plot.title         = element_text(size=18, family = "Arial Narrow", face="bold"))

N <- 1:100
a <- 0.01
r <- (1-a*N)
df <- data.frame(N=N, r=r, rpop=N*r)
col <- viridis(2,begin = 0.6, end = 0.6) 
g1 <- ggplot(df, aes(x=N, y=r)) +
  geom_line(size=2, color=col[1]) +
  xlab("Population Density (N)")+
  ylab("Per Capita Growth Rate") +
  ggtitle("Fig. 1A: Per capita growth rate decreases\nas linear function of population density") +
  my_theme

g2 <- ggplot(df, aes(x=N, y=rpop)) +
  geom_line(size=2, color=col[1]) +
  xlab("Population Density (N)")+
  ylab("Population Growth Rate") +
  ggtitle("Fig. 1B: Population growth rate increases and\nthen decreases as a function of population density") +
  my_theme

grid.arrange(g1,g2,ncol=2)




So, we can rewrite the logistic growth equation as:

$$ N_{t+1} = N_{t} + rN_{t} \left(1-\alpha N \right) $$ where $\alpha$ is the absolute effect of intraspecific competition, and is equal to $1/K$. If $\alpha$ is really small, then intraspecific competition (density-dependence) is negligable. If $\alpha$ is very large, then intraspecific competition strongly limits population growth and size. The reason we go to all this trouble to rewrite the logistic growth equation is to make it easier to include the effects of other species on population growth. But first, let's make the equation a little more simple by writing it in terms of population growth $\left(\frac{dN}{dt} \right)$, rather than population size, and by adding subscripts to denote we are talking about species i:

$$ \frac{dN_i}{dt} = rN_{i} \left(1-\alpha_{ii} N_i \right) $$ Notice how we got to drop the t subscripts becuase we are now defining populationg growth at any instantaneous point in time. Also notice that we added two i subscripts to $\alpha$, and $\alpha_{ii}$ reads as the effect of species i on species i. By this point, is is probably becoming pretty obvious how we include the effect of another species.

To include the effect of another species, we assume that growth is further limited by a simple function of the number of the other species, $\alpha_{ij}Nj$, where $\alpha_{ij}$ reads as: "the effect of species j on species i". Putting it all together, we can write equations for a two-species community as:

$$ \begin{align} \frac{dN_1}{dt} &= r_1 N_1 \left(1- \alpha_{11} N_1 - \alpha_{12} N_2 \right) \ \frac{dN_2}{dt} &= r_2 N_2 \left(1 - \alpha_{22} N_2 - \alpha_{21} N_1 \right) \end{align} $$ where the new parameter $\alpha_{2,1}$ is the absolute interspecific competition coefficient describing the the effect of species 2 on species 1. Recall that the fundamental requirement for species coexistence is that each species must be able to increase from low density (i.e., when it is rare in the community), implying that intraspecific competition must be greater than interspecific competition. Put more simply, each species must limit individuals of its own species more than it limits individuals of other species. Because the $\alpha$s control intra and interspecific competition in the Lotka-Volterra model, we can state the criterion for coexistence mathematically as:

$$ \alpha_{jj} > \alpha_{ij} $$ which simply states that species j cannot competitively exclude species i if the effect it has on itself is greater than the effect it has on species i. For a two species community, the coexistence is stable if, and only if:

$$ \alpha_{11} > \alpha_{21} \quad \text{AND} \quad \alpha_{22} > \alpha_{12}. $$

The multispecies equation

Just in case you ever see this in a paper, it is often written in the multispecies case as:

$$ \frac{dN_{i}}{dt} = r_{i}N_{i} \left(1 - \alpha_{ii} N_{i} - \sum_{i \neq j}^S \alpha_{ij}N_{j}\right) $$

where S is the number of species in the community.




Table of parameters and states

To keep everything clear, here is a table of model states and parameters.

| Parameter | Definition | |---|----------------------------------------| | $N_{i}$ | The abundance (or biomass, depending on units) of species i | | $r_{i}$ | Species i's intrinsic per capita growth rate | | $\alpha_{ii}$ | Intraspecific competition coefficient (effect of species i on itself) | | $\alpha_{ij}$ | Interspecific competition coefficient (effect of species j on species i) |





Play with the model parameters

library(deSolve)
library(ggplot2)
library(viridis)
library(ggthemes)
library(reshape2)
library(gridExtra)
library(EcoEvoApps)
shinyAppDir(
  system.file("examples/LotkaVolterra", package="EcoEvoApps"),
  options=list(
    width="100%", height=550
  )
)





Exercises

1. Given that $\alpha_{11} = 0.1$ and $\alpha_{22} = 0.2$, choose interspecific competition coefficients that result in species 1 going extinct.

shinyAppDir(
  system.file("examples/LV2", package="EcoEvoApps"),
  options=list(
    width="100%", height=550
  )
)

2. Given that $\alpha_{11} = 0.3$ and $\alpha_{22} = 0.2$, choose interspecific competition coefficients that result in species 2 going extinct.

shinyAppDir(
  system.file("examples/LV3", package="EcoEvoApps"),
  options=list(
    width="100%", height=550
  )
)

3. Given that $\alpha_{11} = 0.2$ and $\alpha_{22} = 0.4$, choose interspecific competition coefficients that result in species coexistence.

shinyAppDir(
  system.file("examples/LV4", package="EcoEvoApps"),
  options=list(
    width="100%", height=550
  )
)

4. In the figure below, $\alpha_{11} = 0.2$, $\alpha_{12} = 0.2$, $\alpha_{22} = 0.5$, and $\alpha_{21} = 0.3$. Do those parameter values meet the criteria for coexistence? If not, explain why the figure shows the two species coexisting.

my_theme <- theme_bw()+
  theme(panel.grid.major.x = element_blank(),
        panel.grid.minor.x = element_blank(),
        panel.grid.minor.y = element_blank(),
        panel.grid.major.y = element_line(color="white"),
        panel.background   = element_rect(fill = "#EFEFEF"),
        axis.text          = element_text(size=14, color="grey35", family = "Arial Narrow"),
        axis.title         = element_text(size=16, family = "Arial Narrow", face = "bold"),
        panel.border       = element_blank(),
        axis.line.x        = element_line(color="black"),
        axis.line.y        = element_line(color="black"),
        strip.background   = element_blank(),
        strip.text         = element_text(size=14, color="grey35", family = "Arial Narrow"),
        legend.title       = element_text(size=14, family = "Arial Narrow"),
        legend.text        = element_text(size=14, color="grey35", family = "Arial Narrow"))


## Continuous model
run_lv_chesson <- function(initial_pop_size = 1,
                           growth_rates = rep(0.02,2),
                           competition_matrix,
                           generations = 500){
  N     <- matrix(nrow = generations, ncol = 2)
  N[1,] <- initial_pop_size
  r     <- growth_rates
  A     <- competition_matrix

  for(t in 2:generations){
    N[t,1] <- N[t-1,1] + (r[1]*N[t-1,1])*(1 - A[1,1]*N[t-1,1] - A[1,2]*N[t-1,2])
    N[t,2] <- N[t-1,2] + (r[2]*N[t-1,2])*(1 - A[2,1]*N[t-1,1] - A[2,2]*N[t-1,2])
  }
  return(N)
}


A                <- matrix(c(0.2, 0.2, 0.3, 0.5), ncol=2, nrow=2)
model            <- run_lv_chesson(competition_matrix=A) * 10
mod.df           <- as.data.frame(model)
mod.df$Time      <- 1:nrow(mod.df)
colnames(mod.df) <- c("N1", "N2", "Time")
df.m             <- melt (mod.df, id.vars="Time")
myCols           <- c("#277BA8", "#7ABBBD")
ymax             <- max(df.m$value)+2

ggplot(data=df.m, aes(x=Time, y=value, color=variable)) +
  geom_line(size=2) +
  xlab("Time") +
  ylab("Population size (abundance)") +
  scale_color_viridis(discrete=TRUE, end=0.6) +
  scale_y_continuous(limits=c(0,ymax)) +
  my_theme


EcoEvoEducation/EcoEvoApps documentation built on May 6, 2019, 3:10 p.m.