... | ... | @@ -23,7 +23,7 @@ config templates: [M0](https://gitlab.ethz.ch/ites-le/gen3sis/gen3sis_wiki/-/blo |
|
|
|
|
|
### 1.1.1 Global equatorial ancestor (Pantropical diversity, Hagen and Skeels et al 2021)
|
|
|
|
|
|
This function intialises a single species that occupies all non-arid equatorial grid cells.
|
|
|
This function initializes a single species that occupies all non-arid equatorial grid cells.
|
|
|
|
|
|
Required traits: *dispersal*, *temp*, *temp_width*
|
|
|
|
... | ... | @@ -51,7 +51,7 @@ create_ancestor_species <- function(landscape, config) { |
|
|
|
|
|
### 1.1.2 Global ancestor (Evolutionary Speed Hypothesis, Skeels et al 2021)
|
|
|
|
|
|
This function intialises a single species that occupies all global grid cells.
|
|
|
This function initializes a single species that occupies all global grid cells.
|
|
|
|
|
|
Required traits: *dispersal*, *temp*, *prec*, *body_size*
|
|
|
|
... | ... | @@ -63,7 +63,7 @@ create_ancestor_species <- function(landscape, config) { |
|
|
t_world <- raster::rasterFromXYZ(cbind(landscape$coordinates,landscape$environment[, 1, drop = F]))
|
|
|
t_world <- extend(t_world, landscape$extent)
|
|
|
|
|
|
# Will the simulation sample the ancestor from a partcular continent or randomly from anywhere?
|
|
|
# Will the simulation sample the ancestor from a particular continent or randomly from anywhere?
|
|
|
start_cells <- as.character(Which(t_world, cells=T))
|
|
|
|
|
|
# now fill the list of new species
|
... | ... | @@ -87,7 +87,7 @@ create_ancestor_species <- function(landscape, config) { |
|
|
|
|
|
### 1.2.1 Weibull dispersal kernel (Pantropical diversity, Hagen and Skeels et al 2021)
|
|
|
|
|
|
This function draws the dispersal kernel from a Weibull distriution with shape and scale parameters.
|
|
|
This function draws the dispersal kernel from a Weibull distribution with shape and scale parameters.
|
|
|
|
|
|
Explored parameters:
|
|
|
|
... | ... | @@ -133,7 +133,7 @@ apply_evolution <- function(species, cluster_indices, landscape, config) { |
|
|
|
|
|
### 1.3.2 Cluster-level OU + BM (Evolutionary Speed Hypothesis, Skeels et al 2021)
|
|
|
|
|
|
This function evolves a temperature-niche trait under an Ornstein Uhlenbeck model of trait evolution and evolves a body size trait under a Brownian Motion model. The OU model has a random walk element as in the Brownian motion model and also a parameter (*psi*) that draws the value towards an optimal value (based on the mean temperature value across the clusters geographic range). When *psi=0* OU = BM. The OU and BM models each have an independant rate parameter (*sigma_squared*). This function evolves each geographic cluster seperately (instead of each species speerately or each grid cell seperately).
|
|
|
This function evolves a temperature-niche trait under an Ornstein Uhlenbeck (OU) model of trait evolution and evolves a body size trait under a Brownian Motion (BM) model. The OU model has a random walk element as in the Brownian motion model and also a parameter (*psi*) that draws the value towards an optimal value (based on the mean temperature value across the cluster's geographic range). When *psi=0* OU = BM. The OU and BM models each have an independent rate parameter (*sigma_squared*). This function evolves each geographic cluster separately (instead of each species separately or each grid cell separately).
|
|
|
|
|
|
Explored parameters:
|
|
|
params$sigma_squared_bs = [0.001, 0.02]
|
... | ... | @@ -164,7 +164,7 @@ apply_evolution <- function(species, cluster_indices, landscape, config) { |
|
|
traits[cells_cluster, "body_size"] <- traits[cells_cluster, "body_size"] + rnorm(1, mean = 0, sd = sigma_squared_bs)
|
|
|
}
|
|
|
|
|
|
# set bounds between 0 and 1 so the species can;t evolve a niche beyond that present in the data (all temp is scaled between 0 and 1)
|
|
|
# set bounds between 0 and 1 so the species can't evolve to a niche beyond that present in the data (all temp is scaled between 0 and 1)
|
|
|
if(any(traits[, "temp"] > 1)){traits[which(traits[,"temp"]>1), "temp"] <- 1}
|
|
|
if(any(traits[, "temp"] < 0)){traits[which(traits[,"temp"]<0), "temp"] <- 0}
|
|
|
if(any(traits[, "body_size"] > 1)){traits[which(traits[,"body_size"]>1), "body_size"] <- 1}
|
... | ... | @@ -179,7 +179,7 @@ apply_evolution <- function(species, cluster_indices, landscape, config) { |
|
|
|
|
|
### 1.4.1 Linear divergence (Pantropical diversity, Hagen and Skeels et al 2021)
|
|
|
|
|
|
This function increases divergence between populations by 0.1 at each timestep and speciation occurs after divergence crosses threshold S. Values < 1 mean populations seperate more slowly than they come back toegther, as populations that come into secondary contact seperate at rate of 1 per time step.
|
|
|
This function increases divergence between populations by 0.1 at each timestep and speciation occurs after divergence crosses threshold _S_. Values < 1 mean populations separate more slowly than they come back together, as populations that come into secondary contact separate at a rate of 1 per time step.
|
|
|
|
|
|
Explored paramters:
|
|
|
params$divergence_threshold = [1.5,3]
|
... | ... | @@ -193,9 +193,9 @@ get_divergence_factor <- function(species, cluster_indices, landscape, config) { |
|
|
~~~
|
|
|
|
|
|
|
|
|
### 1.4.2 Exponential temperature-dependant divergence (Evolutionary Speed Hypothesis, Skeels et al 2021)
|
|
|
### 1.4.2 Exponential temperature-dependent divergence (Evolutionary Speed Hypothesis, Skeels et al 2021)
|
|
|
|
|
|
This function increases divergence between populations each timestep as an exponential function of the Sum of the mean temperature values across each diverging populations geographic ranges. The exponent is scaled with the parameter, lambda. Speciation occurs after divergence crosses threshold S. Values < 1 mean populations seperate more slowly than they come back toegther, as populations that come into secondary contact seperate at rate of 1 per time step.
|
|
|
This function increases divergence between populations each timestep as an exponential function of the sum of the mean temperature values across each diverging population's geographic ranges. The exponent is scaled with the parameter, _lambda_. Speciation occurs after divergence crosses threshold _S_. Values < 1 mean populations separate more slowly than they come back together, as populations that come into secondary contact separate at a rate of 1 per time step.
|
|
|
|
|
|
Explored paramters:
|
|
|
params$divergence_threshold = [2,10]
|
... | ... | @@ -233,9 +233,9 @@ get_divergence_factor <- function(species, cluster_indices, landscape, config) { |
|
|
}
|
|
|
~~~
|
|
|
|
|
|
### 1.4.3 Exponential body size-dependant divergence (Evolutionary Speed Hypothesis, Skeels et al 2021)
|
|
|
### 1.4.3 Exponential body size-dependent divergence (Evolutionary Speed Hypothesis, Skeels et al 2021)
|
|
|
|
|
|
This function increases divergence between populations each timestep as an exponential function of 1 - the sum of the mean body size values across each diverging populations geographic ranges. The exponent is scaled with the parameter, lambda. Speciation occurs after divergence crosses threshold S. Values < 1 mean populations seperate more slowly than they come back toegther, as populations that come into secondary contact seperate at rate of 1 per time step.
|
|
|
This function increases divergence between populations each timestep as an exponential function of 1 - the sum of the mean body size values across each diverging population's geographic ranges. The exponent is scaled with the parameter, _lambda_. Speciation occurs after divergence crosses threshold _S_. Values < 1 mean populations separate more slowly than they come back together, as populations that come into secondary contact separate at a rate of 1 per time step.
|
|
|
|
|
|
Explored paramters:
|
|
|
params$divergence_threshold = [2,10]
|
... | ... | @@ -276,9 +276,9 @@ get_divergence_factor <- function(species, cluster_indices, landscape, config) { |
|
|
~~~
|
|
|
|
|
|
|
|
|
### 1.4.3 Exponential temperature + body size-dependant divergence (Evolutionary Speed Hypothesis, Skeels et al 2021)
|
|
|
### 1.4.3 Exponential temperature + body size-dependent divergence (Evolutionary Speed Hypothesis, Skeels et al 2021)
|
|
|
|
|
|
This function increases divergence between populations each timestep as an exponential function of the sum of the mean temperature values across each diverging populations geographic ranges and 1 - the sum of mean body size values. The exponent is scaled with the parameter, lambda. Speciation occurs after divergence crosses threshold S. Values < 1 mean populations seperate more slowly than they come back toegther, as populations that come into secondary contact seperate at rate of 1 per time step.
|
|
|
This function increases divergence between populations each timestep as an exponential function of the sum of the mean temperature values across each diverging population's geographic ranges and 1 - the sum of mean body size values. The exponent is scaled with the parameter, _lambda_. Speciation occurs after divergence crosses threshold _S_. Values < 1 mean populations separate more slowly than they come back together, as populations that come into secondary contact separate at a rate of 1 per time step.
|
|
|
|
|
|
Explored paramters:
|
|
|
params$divergence_threshold = [2,10]
|
... | ... | @@ -338,17 +338,17 @@ apply_ecology <- function(abundance, traits, landscape, config) { |
|
|
|
|
|
### 1.5.2 Environmental carrying capacities (Evolutionary Speed Hypothesis, Skeels et al 2021)
|
|
|
|
|
|
This function using the temperature niche optima and the sites aridity value to determine the local abundance of each species. There are zero-sum dynamics operating so increases in one species will lead to decreases in otehr species if the site is at equilibrium.
|
|
|
This function uses the temperature niche optima and the site's aridity value to determine the local abundance of each species. There are zero-sum dynamics operating so increases in one species will lead to decreases in other species if the site is at equilibrium.
|
|
|
|
|
|
The size (N) of population i in site j is determined by a gaussian function of resource use efficiency - the distance between the temperature value in the site (Tj), and the population’s temperature optimum (Ti):
|
|
|
The size (_N_) of population _i_ in site _j_ is determined by a gaussian function of resource use efficiency - the distance between the temperature value in the site (_Tj_), and the population’s temperature optimum (_Ti_):
|
|
|
|
|
|
Nij = K * exp(-(Ti - Tj/omega)2 ) equation 1
|
|
|
|
|
|
where omega is a parameter that determines the strength of environmental filtering, with small values leading to a sharper decline in abundance as the species temperature niche optimum (Ti) becomes more different from the temperature of the site (Tj). Nij will equal K in the absence of competitors if population i were perfectly adapted to the site. The carrying capacity for each site (K) was independent of temperature but decreased exponentially with the aridity index in each site (Aj) according to the function:
|
|
|
where omega is a parameter that determines the strength of environmental filtering, with small values leading to a sharper decline in abundance as the species temperature niche optimum (_Ti_) becomes more different from the temperature of the site (_Tj_). _Nij_ will equal _K_ in the absence of competitors if population _i_ were perfectly adapted to the site. The carrying capacity for each site (_K_) was independent of temperature but decreased exponentially with the aridity index in each site (_Aj_) according to the function:
|
|
|
|
|
|
K = Kc * exp(-1*Aj) equation 2
|
|
|
|
|
|
Where Kc was a constant [30000]. We model a zero-sum game where sites have finite resources available and this places ecological limits on the maximum number of individuals in a site across populations of all species present (Nj). Therefore, if the total community abundance across all species, Nj, is at or above K the addition of any new species will decrease resources available to all present species. In saturated communities (where Nj >= K), the realised abundance of each species (N̂ij) is apportioned according to the resource use efficiency of each species:
|
|
|
Where _Kc_ was a constant [30000]. We model a zero-sum game where sites have finite resources available and this places ecological limits on the maximum number of individuals in a site across populations of all species present (_Nj_). Therefore, if the total community abundance across all species, Nj_,_ is at or above _K_ the addition of any new species will decrease resources available to all present species. In saturated communities (where _Nj_ >= K), the realized abundance of each species (_N̂ij_) is apportioned according to the resource use efficiency of each species:
|
|
|
|
|
|
N̂ij=Nij∗min(Nj,K)/Nj equation 3
|
|
|
|
... | ... | @@ -356,7 +356,7 @@ Local extinction occurs deterministically if N̂ij = 0 or stochastically as a si |
|
|
|
|
|
1/(1+exp(-μd * (μt - N̂ij)))) equation 4
|
|
|
|
|
|
Where μt is the population size threshold below which extirpation in site j becomes more likely and μd is the rate of decay of the function. Extinction of a species occurs when it no longer occupies any sites.
|
|
|
Where μt is the population size threshold below which extirpation in site j becomes more likely and _μd_ is the rate of decay of the function. Extinction of a species occurs when it no longer occupies any sites.
|
|
|
|
|
|
Explored parameters:
|
|
|
params$K = 30000
|
... | ... | @@ -385,9 +385,9 @@ apply_ecology <- function(abundance, traits, landscape, config) { |
|
|
# difference between landscape and species optimum temperature niche
|
|
|
diff_t <- abs(traits[, "temp"] - landscape[, "temp"])
|
|
|
|
|
|
# potential population size based on resource use efficieny
|
|
|
# omega is strength of environmental filtering
|
|
|
# will equal K when tthe species is perfectly adapted
|
|
|
# potential population size based on resource use efficiency
|
|
|
# omega is the strength of environmental filtering
|
|
|
# will equal K when the species is perfectly adapted
|
|
|
# modified from McPeek 2008/2007
|
|
|
Nij <- K * exp(-(diff_t/omega)^2)
|
|
|
|
... | ... | |