Choices of statistic and surrogate data method both affect test performance in two-species competition systems.

(A, D): Models of competition. Two microbial species inhibit each other’s growth either directly (A) or indirectly through reduction of a shared resource R which is continuously added to the system (D). Populations are also subject to random fluctuations such as from stochastic immigration, modeled as noise terms (εx,t and εy,t in Eq. 1) drawn from a uniform distribution between 0 and 0.025 at regular intervals of step size Δt = 0.05. The “measured” time series (B, E) to which dependence tests are applied have a lower sampling rate of once every five Δt steps. (B, E): Negative correlation between population densities of competing species. (C, F): False positive and true positive rates when analyzing time series data using different combinations of statistic (rows) and surrogate data method or analytical test (columns). We show Granger causality and cross map skill in only one direction because the system is symmetrical and therefore results are the same in both directions. Solid shade, hatched shade, and white-out respectively represent ideal ( 6.2%), questionable (between 6.2% and 10%), and unacceptable ( 10) false positive rates. The number inside the box represents the percentage of true positives rounded to the nearest whole number, with a grey color used for tests with unacceptable false positive rates.

Statistics for measuring correlation between time series.

Different strategies of choosing a lag in the correlation function lead to substantially different test performance.

(A) Lagged correlation may be required to reveal dependence with a delayed response. Here the x variable (Ai) influences the y variable (Aii) with a lag of 2. Aii depicts the original y series (black circles), the series shifted by l = −2 (light grey diamonds), and shifted by l = 2 (dark grey squares). The Pearson correlation between xi and yil is calculated at different time lags l (Aiii), peaking at lag l = −2 (light grey diamond). (B) Three strategies for choosing correlation lags. Bi illustrates time series from a Lotka-Volterra predator-prey system in which predator dynamics lag behind prey dynamics, with the top panel showing a predator (y; blue) and prey (x; red) from the same simulation and the bottom panel showing a predator (y) and prey (X; brown) from different simulations. Both panels share identical y series and random phase surrogates (y*; grey). Bii depicts correlations between x and the original y calculated at different lags l (black curve), or between x and five representative surrogates y* (grey curves). Shown are three ways to choose original and surrogate lagged correlations. With no lag (a, bold dots on green line), all correlations are calculated at lag l = 0. With a “fixed lag” (b, bold dots on gold line), all chosen correlations are calculated at the lag that maximises that of the original series. With “tailored lags” (c, black and cyan open circles), for each pair of time series, either original (black) or surrogates (cyan), the lag with the highest correlation is used. Biii shows the original and surrogate correlations under each lag method isolated on a line to clarify their ranking. An asterisk (*) indicates detection of a significant correlation with p = 1/6 (in practice, at least 19 surrogates are needed to achieve p = 0.05). A check mark indicates a correct inference (rejecting the null hypothesis when x and y are truly dependent, or failing to reject when x and y are truly independent);, incorrect inference is represented by a slashed circle. In this simplified example, the “no lag” approach always fails to detect a correlation, the “fixed lag” approach always detects a correlation, and the “tailored lag” approach produces correct results. (C) A simulation benchmark of the three strategies. Lags, when used, were chosen from between −10 and 10 in steps of size 2. Analytical tests were included in the “no lag” condition. We also tried applying analytical tests at each lag, reporting the lowest p-value and then performing a Bonferroni correction; this procedure’s results are shown next to the “tailored lags” table (Ana.* column). Interpretation of figure (C) is similar to 1. See Methods for simulation details.

In multi-stable microbial communities, tests based on Granger causality and cross map skill can depend on community state.

(A, top): A two-species competitive microbial community in which the two species (x and y) have identical parameters for growth, self-inhibition, and cross-inhibition. There are two steady states (dominance of one or the other species). The system is initialized in the state where x dominates. Both populations experience random fluctuations, so the suppressed species is not permanently extinct. (A, bottom): Similar to the top panel of (A), except here, if a species’ population density drops below 0.4, its intrinsic growth rate is increased by 0.2. (B): Surrogate data tests of dependence using Granger causality or cross map skill applied in either the x → y direction (corresponding roughly to the alternative hypothesis that x drives the dynamics of y), or in the y → x direction. Analytical Granger causality tests are also shown. The top and bottom tables correspond to the top and bottom panels shown in (A), respectively. (C): A vector field plot corresponding to the differential equations shown in the top half of (A), indicating that at the stable community state, changes in y lead to large changes in dx/dt (written as to conserve space), whereas the reverse does not hold. See Methods for simulation details.

Surrogate data generation methods.

Graphical explanations can be found in the appendix. aA test is exactly valid under its modeling assumption if the following criterion is strictly satisfied: The false positive rate - the chance of erroneously reporting dependence - will be no more than the significance level α if we infer dependence only when the p value is equal to or less than α.

Simulation parameters for each figure.

Unif(a, b) and 𝒩(μ, σ2) denote a uniform distribution between a and b and a normal distribution with mean of μ and standard deviation of σ respectively. The integration step size Δt is 0.05 for all systems.

The behavior of surrogate tests differs between using surrogates x* and surrogates y*.

(A) System equations used for simulation. (B) Example time series. Simulations begin with x at a greater population size than y, introducing an asymmetry wherein x is the dominant competitor. (C) Test performance. Each test is performed using either surrogates of y (surrY) or surrogates of x (surrX). Lags such as in Fig 2 were not used in these correlation tests. See Methods for simulation details.