Published September 8, 2017 | Version v1
Other Open

Appendix S2, manuscript: How to distinguish the signatures of environmental filtering and physiological limits in trait-gradient analyses? Consequences for community assembly at the extremes

Description

R code to simulate and analyze communities.

This example is divided into three parts. The first part simulates communities using the R package ecolottery (F. Munoz, et al. ecolottery, (2017), GitHub repository, https://cran.r-project.org/web/packages/ecolottery/index.html). In the example of the paper, the parameters used to build communities are the following: species pool with 100.000 individuals belonging to 100 species with equal abundances (i.e., 1000 individuals each), and species trait values drawn from a uniform distribution between a=0 and b=1. Each community includes 500 individuals and the immigrants establishing in communities are drawn from the species pool. Stabilizing environmental filtering determines establishment probability of immigrants depending on the departure of their trait value t from a local optimum topt. We thus choose a Gaussian filtering function of mean topt, which varies among communities, and standard deviation σopt equal to 0.25. The data frame of simulated communities is called simulation. The community-weighted mean (CWM) and variance (CWV) are calculated for each community.

In the second part, a test is run for each community to determine whether its trait distribution is influenced by the truncation due to trait range limits. For each community, we perform a likelihood-ratio test of the Gaussian truncated distribution of trait values under two sets of parameters: (i) mean and standard deviation corresponding to the observed CWM and  and (ii) maximum likelihood estimates of the mean and standard deviation. The proportion of communities where truncation is detected is plotted along the topt gradient.

The third section estimates the two parameters topt and σopt in each community, by comparing observed summary statistics of the community to summary statistics simulated over a broad range of topt and σopt values, with approximate Bayesian computation (ABC) analysis (coalesc_abc function; Munoz et al, in press).

Files

Files (7.3 kB)

Name Size Download all
md5:695026a6ae9b1c931996d6d8d58731e8
7.3 kB Download