Assessing analytical methods for detecting spatiotemporal interactions between species from camera trapping data
Funding Information: We thank the German Federal Ministry of Education and Research (BMBF FKZ: 01LN1301A) and the Leibniz Institute for Zoo & Wildlife Research for funding this research and two anonymous reviewers whose comments helped to substantially improve the manuscript
.
Abstract
Assessing spatiotemporal interactions between species is of fundamental interest to behavioural and community ecology. Observer-independent methods such as camera trapping facilitate the study of interactions, but analyses are hampered by the lack of comparative assessment of available approaches. We present a flexible and expandable framework to simulate and explore spatiotemporal interactions between species from camera trapping data with well-defined properties, and compare methods to detect such interactions in a two-species system with two types of (spatio)temporal interactions: spatiotemporal avoidance (of a site by a species after the presence of another species) and temporal segregation (shifts in daily activity patterns between species), across a range of daily activity patterns and interaction strengths. For spatiotemporal avoidance, we analysed time intervals between species records using linear models, the Mann–Whitney U-test, a permutation test and a test based on randomly generated records. For temporal segregation, we applied a permutation test. Statistical power (the ability to detect an existing effect) for detecting spatiotemporal avoidance between species was strongly affected by interaction strength, highest for linear models and reliable above 50 records per species. Reliably detecting strong temporal segregation required fewer records (10–20 records) but depended heavily on the underlying activity pattern. All tests were valid (uniform distribution of P-values under the null hypothesis) even at low sample sizes above a minimum of 10 records per species. Linear models were the most suitable approach to analyse spatiotemporal avoidance and can easily correct for other sources of variation in interactions. The framework presented here can help to improve survey design in camera trapping and be extended to more complex settings (e.g. with imperfect detection). In addition, it allows researchers to validate the methods used for inference of spatiotemporal interactions from camera trapping data in their specific circumstances.
Introduction
Investigating biotic interactions is a central topic in ecology due to their tremendous importance in shaping community and ecosystem processes (Sinclair 2003; Tylianakis et al. 2008). All species are embedded in complex interaction networks and species interactions play a significant role in determining population dynamics and trophic control in ecosystems (Sinclair et al. 2003), in shaping species distributions (Araújo and Luoto 2007; Wisz et al. 2013; Urban et al. 2016) and other important ecological phenomena such as disease transmission (Benham and Broom 1989) or prey switching (Kjellander and Nordström 2003). This is particularly relevant as including biotic interactions has been identified as one of the greatest challenges in predicting species, community and ecosystem processes under ongoing global ecological change (Tylianakis et al. 2008; Gilman et al. 2010).
Species interactions can range from mutually detrimental to antagonistic (detrimental to one species and beneficial to the other) to commensal (beneficial to one partner and neutral to the other) and mutualistic (beneficial to both partners). Commensal and mutualistic interactions are a key to understanding specific coordinated behaviour such as ungulate migration and feeding successions (Dickman 1992; Stachowicz 2001). Detrimental and antagonistic interactions are however more widespread with a scarcity of empirical evidence for positive species interactions from mammal communities (Forsman et al. 2002) and decades of research have shown how such antagonistic interactions shape mammal communities (e.g. Palomares and Caro 1999; Sinclair et al. 2003; Ritchie and Johnson 2009). Therefore we will focus on detrimental and antagonistic interactions here, which include exploitation and interference competition, harassment, kleptoparasitism, classic and intraguild predation, and pathogen–host interactions (Palomares and Caro 1999; Caro and Stoner 2003; Arim and Marquet 2004; St-Pierre et al. 2006; Vanak et al. 2013).
A venue of research leading to a better understanding of detrimental and antagonistic interactions is the study of niche partitioning. Niche partitioning reduces the strength of such interactions and enables sympatry through adaptations in morphological, physiological or behavioural traits (Connell 1980; Di Bitetti et al. 2010). Here, we focus on behavioural niche partitioning. This type of niche partitioning can be spatial, temporal or spatiotemporal. Spatial niche partitioning includes avoidance of sites occupied by a competitor or predator or habitat partitioning along environmental gradients. Two-species occupancy models are an established method to study spatial niche partitioning (MacKenzie et al. 2004, 2006; Richmond et al. 2010). Such models can be used to assess the level of co-occurrence between species, and whether detections are influenced by the presence or the detection of another species. Co-occurrence patterns are, however, a result of site-level occupancy processes and therefore only a measure of spatial and not temporal species interactions. Furthermore, sampling occasions in camera-trap based occupancy surveys are usually at least 1 day long and thus too long to detect short-term spatiotemporal avoidance patterns and variations in activity and detectability throughout 24 h periods. We note, however, that for very common species shorter occasion lengths are conceivable.
Niches can also be partitioned temporally or spatiotemporally, for example by the adjustment of activity patterns to avoid interaction with other species, or by temporarily avoiding sites after the presence of a predator or competitor (Kronfeld-Schor and Dayan 2003; Apfelbach et al. 2005; Schuette et al. 2013; Karanth et al. 2017). Studying temporal or spatiotemporal niche partitioning in wild populations of medium-sized to larger mammals, however, is challenging, and it is less clear what the most suitable methods for studying it are. In this paper, we explore how such (spatio)temporal niche partitioning can be inferred from camera trapping data, a widely used and cost-effective method for wildlife surveys, particularly for cryptic or rare species.
For the direct assessment of (spatio)temporal interactions, several approaches have been developed and applied. One approach estimates spatiotemporal avoidance, that is, to what extent site visitation by species A (the ‘primary’ species, hereafter) influences subsequent visitations by species B (the ‘secondary’ species, hereafter, e.g. Harmsen et al. 2009; Parsons et al. 2016; Karanth et al. 2017). Such avoidance behaviour can be mediated by olfactory (Apfelbach et al. 2005; Ferrero et al. 2011), visual (Blumstein et al. 2000; Stankowich and Coss 2007) or acoustic cues (Hauser and Wrangham 1990). The second, more commonly used approach assesses temporal segregation between species. Here, the temporal overlap in activity between two species is estimated to assess whether daily activity patterns may have shifted in response to the presence of the other species (Ridout and Linkie 2009; Linkie and Ridout 2011; Foster et al. 2013; Lynam et al. 2013; Ross et al. 2013; Farris et al. 2015; Sunarto et al. 2015). Often, camera trap stations are pooled for this analysis, thus omitting spatial information.
Although many methods have been proposed to use camera trap data for drawing inferences about spatiotemporal avoidance and temporal segregation, the suitability of these methods for such a purpose has not been assessed. The aim of this study was therefore to assess different measures and statistical tests for detecting spatiotemporal avoidance and temporal segregation. For this purpose, we simulated species interactions across a wide range of avoidance and activity patterns, taking into account the typical structure of camera trap data. Simulations allowed us to overcome the main obstacle of field data, the unknown (latent) true state of the study system that generates the records, by explicitly specifying the characteristics of the interactions (Peck 2004). We compared tests in terms of their statistical power and validity of P-values for the most commonly found daily activity patterns with increasing intensities (strengths) of avoidance or segregation. Specifically, we assessed under which circumstances spatiotemporal avoidance and temporal segregation can be detected, how many species records are needed for a reliable detection and which method is the most powerful and valid of those described.
Materials and Methods
Outline of the study system
We simulated the interactions of primary species A and a secondary species B at one camera trap station, but the findings extend to typical multi-camera studies (see discussion). We assumed that species A is unaffected by the presence of species B, whereas species B has two possibilities to avoid an interaction with species A. In spatiotemporal avoidance, species B avoids a site after species A was recorded, expressed as a reduced probability of recording species B after species A was recorded. In this case, we assumed a subsequent linear recovery of the chance that species B visits the site (Fig. 1). Alternatively, in the case of temporal segregation, species B can shift its activity peaks relative to species A to reduce activity overlap and thus reduce the chance of encountering species A (Fig. 2).




The activity patterns of both species were chosen to be uniform (flat), unimodal (with one activity peak per day) or bimodal (two peaks per day). Uniform activity patterns are representative of species without a fixed activity rhythm (cathemeral species). Unimodal and bimodal activity patterns are more common, the former being typical of diurnal or nocturnal species, the latter, crepuscular species (Ridout and Linkie 2009; Levy et al. 2012; Foster et al. 2013; Lynam et al. 2013; Monterroso et al. 2013; Ross et al. 2013; Farris et al. 2015; Ikeda et al. 2016). All computations were performed in R 3.3.3 (R Core Team, 2017), the circular activity patterns were simulated with functions from the R package circStats v0.2-3 (Lund and Agostinelli 2012). See Supplementary Methods for a more thorough description of the simulation procedure.
Spatiotemporal avoidance
For each combination of simulation parameters as shown in Table 1, we generated simulated species records, termed observed data here. The number of records and the activity patterns were identical for both species; we only varied the strength and duration of the spatiotemporal avoidance. Avoidance strength is expressed as an odds ratio between the odd of detecting B in the absence of A relative to the odd of detecting B directly after an observation of A. An odds ratio of 2 stands for mild, 10 for moderate and 100 for strong avoidance. After an observation of A the odds ratio linearly recovers to a value of 1 (no effect) for an adjustable amount of time (see Supplementary Methods).
Function input | Details | Spatiotemporal avoidance | Temporal segregation |
---|---|---|---|
Number of days | Number of simulated days | 100, 300 | 100, 300 |
Number of records A | Number of records of species A | 10, 20, …, 90, 100 | 5, 6, 7, 8, 9, 10, 20, 30, 40, 50 |
Number of records B | Number of records of species B | 10, 20, …, 90, 100 | 5, 6, 7, 8, 9, 10, 20, 30, 40, 50 |
activity pattern1/2 |
Uniform, unimodal (von Mises) or bimodal (von Mises mixture) |
uniform, unimodal, bimodal |
unimodal, bimodal |
κ (kappa)1/2 | κ (kappa), concentration parameter of the von Mises distributions used for uni- and bimodal activity patterns | 2 | 1,2,3 |
Spatiotemporal avoidance strength2 | The odds ratio between the odds for detecting B in the absence of A relative to the odds for detecting B after A was recorded | 1, 2, 10, 100 | 1 (no effect) |
Spatiotemporal avoidance duration2 | Duration for which the effect of A on B persists until full recovery (in days) | 1, 3 | - (no spatiotemporal avoidance) |
Activity peak difference2 | Time difference between the activity peaks of A and B (in hours) | - (synchronous activity patterns) |
unimodal: 1,2,3,…,12 bimodal: 1,2,3,…,6 |
- 1 Argument impacts on the probability distribution of the primary species A.
- 2 Argument impacts on the probability distribution of the secondary species B.
Analogous to the common practice for ensuring temporal independence between records in camera trapping data, we removed records of a species within a period of 60 minutes after the last record of the same species at the same camera trap (Sollmann et al. 2013; Meek et al. 2014; Burton et al. 2015). We calculated the following time intervals between detections of the primary species (A) and the secondary species (B) in the observed data to assess which is most suitable for detecting spatiotemporal avoidance: AB, BA, AA, BB, ABA, BAB, and the ratios AB/BA and BAB/BB. The notation of time intervals represents the order of the different events. For example, AB is the time interval between a record of A until the next record of B, whereas BA is the opposite. AB and BA were used by Harmsen et al. (2009) and Karanth et al. (2017). The two ratios correspond to the attraction-avoidance-ratios (AARs) T2/T1 and T4/T3 in Parsons et al. (2016). The ratios compare the time intervals between a primary species and a secondary species to the converse situation (AB/BA, T2/T1) or the time intervals between records of secondary species with or without the passage of a primary species in between (BAB/BB, T4/T3). If a record was preceded by a sequence of multiple records of the other species, we calculated the time interval since the last record of that sequence to the current record.
Linear models
We first directly compared the time intervals AB and BA (primary–secondary and secondary–primary) by fitting two linear models using either natural log-transformed or untransformed time intervals as the response variable. Log-transformation was applied to meet linear model assumptions. For both linear models, the only predictor considered was the type of the time interval (i.e. a factor with two levels: AB and BA). We used the interval BA as the reference level in the model, since species A should not be affected by species B. The linear models thus estimate the difference between AB and BA (or log(AB) and log(BA)), with a positive effect indicating avoidance and a negative effect indicating attraction. The effect size indicates the time difference between the means of AB and BA (or log(AB) and log(BA)). The P-value of the parameter estimate from the fit of the linear model for this difference corresponds to the P-value obtained in a traditional t-test on the data in this simple situation of one simulated camera trap station.
We checked whether the main assumptions about errors in linear models were met, namely homoscedasticity using the Breusch–Pagan test, independence (absence of serial autocorrelation) as measured by the Durbin–Watson test, and normality of model residuals using the Shapiro–Wilk test (the Shapiro-Wilk test provides both a measure of the strength of non-normality and of its significance).
Mann–Whitney U-test
Real data, and also our simulated data, are rarely normally distributed, even after transformation. We therefore also compared the time intervals AB and BA using the non-parametric Mann–Whitney U-test. It is used to test for a difference in central locations between two independent groups which come from similar underlying distributions, but does not require observations to be normally distributed.
Permutation test
Permutation tests are non-parametric tests for statistical significance in which P-values are calculated by comparing a test statistic for the observed data to the distribution of the test statistic under the null hypothesis which is obtained by repeatedly and randomly exchanging labels of data points and recalculating the test statistic (Rodgers 1999).

Random records
We explored random records of the secondary species (B) as an alternative method to simulate data under the null hypothesis of no spatiotemporal avoidance between species. We did so by assigning random times and dates to records of secondary species while accounting for their daily activity patterns. To generate random times of day, we derived kernel density estimates of the diurnal activity patterns from the observed data of secondary species using the R package overlap (Meredith and Ridout 2016), as one would do to estimate activity patterns from field data. The kernel density estimates were used to weight the random draws of 1-min intervals from a 24-h period, thereby producing random times. These random times were then combined with randomly selected dates from the study period of secondary species. We held the number of random records identical to the number of the original data points. This procedure was used by Karanth et al. (2017) without explicitly taking activity patterns into account, and by Cusack et al. (2017). The newly generated records of B were again filtered for temporal independence (60 min). Records of A were not manipulated.
We then calculated the median of all time intervals mentioned above for 1000 independent sets of random records generated in this manner and compared the median observed values to the distribution of values from the random records. As in the permutation test above, we performed a two-sided significance test comparing the observed test statistic and obtained the P-value with the same equation.
Temporal segregation
We created records with temporal segregation between both species (time shifts of activity peaks) ranging from 0 to 12 h for unimodal activity patterns and 0–6 h for bimodal activity patterns (in 1-h steps). Both species had the same type of activity pattern (uni or bimodal) and no spatiotemporal avoidance. The shape of the activity patterns was varied by varying the concentration parameter κ in the von Mises distributions (making them more or less concentrated, Fig. 4). Table 1 shows the parameters used in the simulations. The method was applied to simulated datasets containing between 5 and 50 records per species with identical number of records for both species.
















Power analysis
Statistical power is defined as the probability of true positives, that is, the probability that a test correctly rejects the null hypothesis when it is false. To assess the power of the tests, each test was performed on 1000 sets of independently generated records of both species (observed data) for each combination of parameter values of the function as detailed in Table 1. Power was calculated as the percentage of significant tests at α = 0.05 out of these 1000 independent tests. We considered a test as reliable if power was >0.8.
Validity of P-values
Under the null hypothesis, the P-values of a statistical test are expected to follow a uniform distribution. A deviation from a uniform distribution suggests that a test will reject the null hypothesis more (or less) frequently than suggested by the significance level, leading to biased conclusions. We assessed the validity of the tests using the empirical cumulative density functions (ECDFs) of P-values from 1000 independent tests with data generated under the null hypothesis of no interaction, that is, no spatiotemporal avoidance and no temporal segregation respectively. We assessed the expected uniform distribution in three complementary ways, by (1) visually assessing the ECDFs of P-values, which should follow a straight line, (2) comparing the distribution of the obtained P-values with a uniform distribution using a Kolmogorov–Smirnov test, and (3) computing the value of the ECDFs at a significance level of α = 0.05, expecting an ECDF value of about 0.05 at α = 0.05 if the distribution of P-values is uniform. Major deviations from an expected value of 0.05 would indicate that the test has a higher (or lower) chance of returning a false positive result than suggested by the nominal significance level, that is, it is not valid.
Results
Spatiotemporal avoidance
Power
All four tests—linear models, Mann–Whitney U-test, permutation test and the test based on randomly generated records—detected spatiotemporal avoidance of a primary species by a secondary species (given sufficient records) and were not affected by the type of activity pattern considered. For all tests, a higher number of records and stronger or longer avoidance resulted in higher power (Fig. 3).

Overall, the highest power was achieved with a linear model comparing log-transformed time intervals AB and BA, followed by the U-test, the linear model with untransformed data and the comparison of the observed time interval AB to those from randomly generated records or the permutation test (Fig. 3). Under favourable conditions (strong avoidance, large sample sizes), power can be close to 1. Between the linear models and the U-test, which compared the intervals AB and BA, power was generally similar in range, but highest when using a linear model on log-transformed time intervals, intermediate for U-tests, and lowest in linear models considering untransformed interval values as the response variable. The power of these three tests was generally higher than for the permutation test or for the test based on randomly generated records (Fig. 3).
In both the permutation procedure and the test based on randomly generated records, the highest power was achieved when the interval AB was used. The avoidance-attraction ratio AB/BA achieved the second highest power followed by time interval ABA. The power of the remaining time intervals was consistently lower across all tests (Fig. 3). For the time interval AB, the power was slightly higher when using random records than applying species label permutation. The same was observed in a more pronounced way for the time interval ABA, whereas for the ratio AB/BA, the test using species label permutation achieved a slightly higher power (Fig. 3).
For all statistical tests and even with the time interval with the highest power, reliable test results (power > 0.8) required high numbers of records and strong avoidance effects (>50 records per species, odds ratios ≥10, see Supplementary Methods). Below 50 records per species, power dropped sharply, and even very strong avoidance effects could not be detected reliably, with power at or below 0.5 for 40 records and approximately 0.25 for 30 records (Fig. 3). The minimum number of records to reliably detect spatiotemporal avoidance was lower if the avoidance effect lasted longer relative to the survey duration. If avoidance was subtle (odds ratio = 2), even 100 records per species were insufficient to reliably detect spatiotemporal avoidance.
Validity of P-values
All tests were valid for all types of activity patterns and all factor combinations tested. The ECDFs of P-values under the null hypothesis were linear; there was no evidence for systematic deviations from a uniform distribution (Supplementary Figs. S1 and S2); and around 5% of tests were significant when the threshold for significance was set at 5% (Supplementary Figs. S1 and S2). In the linear models, P-values were distributed uniformly under the null hypothesis (i.e. in the absence of interaction effects) despite frequent significant deviations from the assumptions of normality and homoscedasticity. While significant deviations from homoscedasticity were common, the values of the test statistic of the Breusch–Pagan test indicated only limited heteroscedasticity under the null hypothesis. However, heteroscedasticity became substantial when spatiotemporal avoidance was set to be strong (odds ratio = 10 or 100), particularly when the number of records was high. This pattern was usually more pronounced when data were log-transformed and most severe for unimodal activity patterns. We also found frequent significant deviation from normality, particularly when the number of data points (records) was high. Nevertheless, the values of the test statistic of the Shapiro–Wilk test were consistently close to 1, indicating that the deviation from normality was usually not substantial even if they were statistically significant. Log-transformation resulted in values of the Shapiro–Wilk test statistic closer to 1, thus decreasing deviations from normality compared to untransformed data. There was no evidence for systematic autocorrelation.
Temporal segregation
Power
The power of a species label permutation test to detect temporal segregation between species varied considerably. It increased when activity peaks became narrower, as the number of records grew and as the magnitude of the time shift between activity peaks became more pronounced. For a given number of records, power was higher if species had unimodal rather than bimodal activity patterns (Fig. 4).

The conditions under which power was high (i.e. >0.8) therefore depended on the type of activity patterns, the extent of temporal segregation and sample size. For narrow unimodal activity patterns (concentration parameter κ = 3), even small time differences between activity peaks of 2 hours could be reliably detected, provided sample size was sufficient (40 or more records). Differences in activity peaks of 5 h and more were reliably detected with <10 records (κ ≥ 2). On the other hand, it was impossible to reliably detect even considerable temporal segregation in large numbers of records with relatively modest bimodal activity (κ = 1). Similar to unimodal activity patterns, power approached 1 for more pronounced bimodal activity patterns (κ = 3) with higher numbers of records and shifts of activity peaks by 3 h or more (Fig. 4).
Validity of P-values
Species label permutation tests for differences in activity peaks of species were valid for all parameter combinations with at least seven records for each species. Below this minimum, the observed chance of obtaining false positives with α of 0.05 was 20–30% (see Supplementary Fig. S3), demonstrating that the tests were not valid in this situation.
Discussion
We developed a flexible simulation framework and investigated the validity and statistical power of several statistical methods to detect two types of species interactions from camera trapping data – four methods to assess spatiotemporal avoidance and one method to assess temporal segregation (shifts in activity patterns). These five statistical methods were generally valid, powerful and capable of detecting both types of interactions between species irrespective of species activity patterns. However, the extent to which they provided sufficient statistical power (>0.8) depended on several factors, primarily sample size and avoidance strength.
Our results showed that spatiotemporal avoidance can be detected if avoidance is sufficiently strong (odds ratio ≥ 10), if the recovery of the detection probability of the secondary species takes sufficiently long (≥1 day), and if sample size is sufficiently large (>50 records per species). However, if avoidance was weak (i.e. a slight decrease in detection probability of the secondary species after records of a primary species, odds ratio = 2) or very short-term (e.g. in a range of hours rather than days), avoidance cannot be reliably detected even with a high number of records (e.g. 100 records).
The most powerful method for detecting spatiotemporal avoidance behaviour was the linear model comparing the time intervals between the primary species A and secondary species B, and vice versa (time intervals AB and BA). Harmsen et al. (2009) used a similar linear modelling approach and found evidence of spatiotemporal avoidance between jaguars and pumas in a neotropical forest. Even though assumptions of linear models were not always met in the simulated data, the power and validity of P-values were not negatively affected by the small departures from normality and homoscedasticity we observed and did not pose a serious problem for this type of application. The non-parametric Mann–Whitney U-test provides an alternative method for robust detection of spatiotemporal avoidance behaviour with more substantial deviations from these assumptions with only slightly lower power (Adams and Anthony 1996). In the permutation test and the test based on randomly generated records for detecting spatiotemporal avoidance behaviour, our simulations showed that the preferred time interval is the time elapsed between the presence of the primary and the secondary species (AB). Karanth et al. (2017), using a similar test based on randomly generated records, compared times intervals between co-occurring species (times-to-encounters, akin to AB here) from observed data and random records and found some evidence for spatiotemporal interactions between dholes, leopards and tigers in Indian wildlife reserves.
For the reliable detection of shifts in activity peaks of a few hours between species with unimodal activity patterns (temporal segregation), a minimum of 20 records per species was usually required. The minimum number of records for detecting smaller shifts of 2-3 h, or in the case of bimodal activity patterns, is more likely to be around 50 records per species. Power strongly depends on the shape of the underlying density distribution of the detection probability and the actual activity shift. Thus, in some cases subtle shifts in activity peaks of 1–2 h might go unnoticed even with large numbers of records unless activity peaks are very narrow (narrower than simulated in this study). These are statistical perspectives. To what extent subtle spatiotemporal avoidance or temporal segregation matters from a biological point of view depends on the research question. The test for shifts in activity peaks assumes activity patterns of comparable shape. Therefore, it is important to identify the likely activity density function for both species before conducting the test, as differences in the underlying activity density functions between species (e.g. one having a unimodal and the other a bimodal activity pattern) may also produce significant but misleading results.
Statistical tests with low numbers of records generally have low power, thus impeding the detection of spatiotemporal avoidance or temporal segregation when it is present. For the sake of simplicity, we generated equal numbers of records for both species in all tests, but actual data are rarely balanced. If the number of records differs between species, the number of available time intervals for analyses of spatiotemporal avoidance is dictated by the smaller of the two samples and statistical power is reduced accordingly. In addition, when calculating activity densities (for the creation of random records or the computation of activity overlaps for temporal segregation analyses), low numbers of records give a disproportionate weight to individual records and can prevent the correct inference of actual activity patterns. As a consequence, activity densities estimated from low numbers of records do not necessarily provide an adequate representation of the underlying distribution. Previous camera trapping studies are generally aware of this limitation and used from 10 to well-over 1000 records for estimating activity densities (Lynam et al. 2013; Ross et al. 2013; Farris et al. 2015).
Our simulation function makes a number of assumptions and simplifies complex real-world species interactions. Realism could be increased in a number of ways. In simulating spatiotemporal avoidance, we assumed detection probabilities of the secondary species to recover linearly after the presence of the primary species. Simulating the mechanism of spatiotemporal avoidance via ‘forgetting’ functions (e.g. an exponential decay of the perceived threat) could increase realism but would introduce a (assumed or estimated) decay constant as an additional simulation parameter (White 2001). In addition, the assumption that the primary species remains unaffected by the presence of the secondary species may be unrealistic in some situations, for example when predators actively follow prey (Hughes et al. 2010). Since interactions between species can be expressed as time-to-event data, other statistical approaches such as statistical tests traditionally used in survival analyses (e.g. semi-parametric Cox regressions) may be investigated.
Another extension would be the incorporation of the manifold sources of uncertainty found in real-world data which we omitted from the current study, particularly the issue of imperfect detection (MacKenzie et al. 2004). Imperfect detection is likely to reduce the power of tests for spatiotemporal avoidance, as it alters the distribution of time intervals between records (by increasing both the mean and the variance of time intervals) and reduces sample size. Thus, a potential extension of the presented simulation framework would be to mimic imperfect detection by randomly removing records of both species from simulated data. Then, one would have to assess the quality of the tests as a function of the proportion of such omitted records. For the test for temporal segregation, however, we predict that imperfect detection should not affect the outcome, provided there are sufficient records and that detection probabilities of both species are constant throughout the day.
The various methods we examined for investigating spatiotemporal avoidance and temporal segregation are based on time and location of species records exclusively and thereby cannot distinguish between the ecological mechanisms underlying the observed patterns. The observed patterns could be the result interactions, or they may reflect other aspects of the species’ ecology, such as differences in physiological adjustments to fluctuating ambient environmental conditions (Haim and Fourie 1980; Fuller et al. 2010). Interspecific interactions are complex, and species have a wide array of behavioural responses at their disposal to avoid interactions, for example by partitioning space or resources instead of time. Thus, even if no evidence for temporal segregation is found, this does not necessarily indicate the absence of avoidance in other dimensions. Conversely, a significant permutation test for temporal segregation does not necessarily indicate avoidance between two species. The behaviour of a species may not necessarily depend on that of the other species but could also respond to any other coincidental factor, including the activity of a third species.
The presence of other species besides the two focal species may introduce further complexities (Morales-Castilla et al. 2015), and detecting other species in between records of the focal species could indicate the presence of other relevant interactions. Removing time intervals during which a third species was present between subsequent detections of the focal species before analysing the data (as in Parsons et al. 2016) may partly alleviate this problem at the cost of reduced sample size and thus, power. Removing these time intervals, however, would not be sufficient if occupancy by a third species changes activity patterns of one of the study species (e.g. Ross et al. 2013). In this situation, the third species may introduce spurious relationships between focal species that in reality is caused by interactions with the third species. Including a third species in the analyses presented here would be possible in theory, but substantially increases the number of necessary comparisons and thus the data requirements to reach a given power. It is also likely to complicate the interpretation of findings. An alternative to this procedure may be a functional, trait-based approach which treats records of different species from the same guild or other species grouping (such as ‘medium-sized felids’, or ‘small carnivores’) as ‘one species’ (group) at the cost of reduced ecological (or taxonomic) resolution.
In order to obtain unambiguous results, we simulated data for a simple system of a single camera trap station without spatial variation in the ability to detect interactions. Therefore, another key perspective would be to upgrade our framework for data originating from several camera traps. All methods we present here can easily be expanded to a camera trapping grid consisting of several cameras, as will be found in almost all field camera trapping studies. If all camera trap stations are considered equivalent with respect to avoidance, information can be pooled across stations and sample sizes and power given here refer to detections across the entire camera grid. For linear models, the consideration of several camera traps could also be done using additional predictors or linear mixed-effects models, that is, by considering the location of the camera trap station as an additional fixed or random effect. This way, a linear model which compares the (log-transformed) time intervals AB and BA could also investigate geographical differences in interval times which may be caused by variation in local abundance. Linear models have the additional advantage that other factors of interest (or nuisance factors) potentially affecting the interaction between species, such as habitat characteristics, could also be included. If the violations of linear model assumptions are severe, non-parametric U-tests could be performed and the P-values of U-tests from individual stations be combined using Fisher's method to test the global null hypothesis of no avoidance (Fisher 1932) at the cost of reduced power. Alternatively, appropriate robust non-parametric statistical equivalents of linear models could be investigated (e.g., Kloke and McKean 2015). Similarly, for both the random record method and the permutation test for spatiotemporal avoidance, the P-values from tests at each station can be aggregated using Fisher's method. The species label permutation test can only be applied if the numbers of records at each station is high enough to ensure a sufficient number of possible permutations and avoid the problems with the validity of P-values shown above. When using randomly generated records to detect spatiotemporal avoidance, pooling records from different stations can give a more accurate reflection of species’ general activity patterns, thus providing more realistic randomly generated records, provided activity is constant between stations.
Analyses of activity overlap are commonly performed on data pooled across camera trap stations, omitting the spatial information and implying that activity patterns are constant between stations. All stations can then be jointly analysed in one permutation test. If activity patterns are assumed to differ between stations, for example because of prior information or hypotheses about ecological processes at the stations, independent permutation tests can be run on different (sets of) stations. Fisher's method can also be applied here if multiple permutation tests are performed, for example on different subsets of camera trap stations. Pooling data from many stations or over extended periods of time will, however, induce an increase in observed activity overlap as an artefact of pooling (Nouvellet et al. 2012).
In conclusion, the simulation approach we presented provides a flexible, extensible framework for the development and testing of statistical methods for detecting species interactions in camera trapping data under well-defined conditions. Our results provide guidance to field researchers exploring two-species spatio–temporal interactions as to when their data are likely to be of sufficient quality to test spatiotemporal avoidance and temporal segregation, and how such tests could be implemented. The tests for spatiotemporal avoidance can be conducted if researchers hypothesize that a species temporarily avoids sites after the presence of another species, but it requires relatively large sample sizes. The test for temporal segregation requires less data and can be applied to test whether there is a shift in activity patterns between two species. We suggest that researchers use similar approaches or expand the provided simulation framework to test the power and validity of interaction tests in their specific circumstances (expected survey duration, sample sizes, various interaction scenarios). Irrespective of the type of analysis, our simulation study showed that in order to detect spatiotemporal interactions, numbers of records need to be high and may have to exceed a number of 100 per species and more. It is consequently most feasible for common species that are captured frequently by camera traps. As understanding species interactions is a key topic in ecology, our results support calls to standardize data collection schemes and combine camera trap datasets from different studies in joint analyses (Forrester et al. 2016; Steenweg et al. 2017).
Acknowledgments
We thank the German Federal Ministry of Education and Research (BMBF FKZ: 01LN1301A) and the Leibniz Institute for Zoo & Wildlife Research for funding this research and two anonymous reviewers whose comments helped to substantially improve the manuscript.
Open Research
Data Accessibility
Analyses reported in this paper can be reproduced using the R code for simulating camera trapping records of two interacting species provided in the supplementary material.