Efficient algorithms for sampling feasible sets of abundance distributions
Ecological variables such as species richness (S) and total abundance (N) can strongly influence ecological patterns. For example, the general form of the species abundance distribution (SAD) can often be explained by the majority of possible forms having the same N and S, i.e. the SAD feasible set. The feasible set reveals how variables determine observable variation, whether empirical patterns are exceptional to the majority of possible forms, and provides a constraint-based explanation for the ubiquity of hollow-curve SADs in nature. However, use of the feasible set has been limited to inefficient sampling algorithms that prevent large ecological communities and ecologically realistic combinations of N and S from being examined. This is the primary hindrance to using this otherwise novel perspective and theoretical framework. We developed efficient computational algorithms to generate random samples of the feasible set for the SAD and similar discrete distributions of abundance, including those that allow for zero-values, e.g., absences. We provide Python and R based implementations of our algorithms and tools for testing and using them. Our algorithms are often several orders of magnitude faster than a long-standing and recently used approach. This greatly increases the size and diversity of communities that can be examined with the feasible set approach and thus advances progress using constraint-based approaches to decipher ecological patterns.