Introduction

Species interactions are central to understanding ecological and evolutionary dynamics, yet are among the most challenging attributes to quantify and relate to other aspects of biodiversity (Strauss and Irwin 2004; Pascual and Dunne 2006; Bersier and Kehrli 2008; Gómez et al. 2010). Darwin (1859) envisaged the complex network of interacting organisms as an “entangled bank” shaped by deterministic “laws” that drive the associations among species. We have now come to recognize that these “laws” likely reflect different ecological and evolutionary processes (Strauss and Irwin 2004). Some of the well-recognized factors shaping the architecture of ecological networks are environmental gradients (Danielson 1991; Tylianakis et al. 2007), species abundance (Krishna et al. 2008; Vázquez et al. 2009; Verdú and Valiente-Banuet 2011; Ibanez 2012), sequential evolution (Jermy 1976), cocladogenesis or cospeciation (Page and Charleston 1998; Page 2003; Thompson 2014), coevolution (Thompson 1994; Gross and Blasius 2008; Guimarães et al. 2011) and species functional traits (Cohen 1977; Rezende et al. 2007; Rossberg et al. 2010; Ibanez 2012; Vizentin-Bugoni et al. 2014), defined here as any measurable organismal eto-ecological characteristic or phenotype associated with a biotic interaction or an ecosystem function of interest (Schmitz et al. 2015). Nonetheless, knowledge of the independent role of these factors on species interactions at the community level is still poorly appreciated (Mitter et al. 1991; Lewinsohn et al. 2005; Novotny and Basset 2005), especially when it comes to measuring the importance of functional traits. As closely related species are likely to retain their ancestral traits, discriminating the effects of species traits and long-term evolutionary history is troublesome (Felsenstein 1985; Losos 2008).

Over the past recent decades, ecologists have started to incorporate phylogenetic-based methods into ecological research, which gave rise to a novel and prolific field of inquiry, the so-called Ecophylogenetics (Webb 2000; Webb et al. 2002; Mouquet et al. 2012). These methods have allowed ecologists to overcome some of the difficulties inherent to the study of evolutionary phenomena, and have been very useful in studies trying to understand how historical and evolutionary contingencies affect patterns at different ecological scales (Mouquet et al. 2012). With the ready availability of extensive phylogenies, community ecologists have started to integrate ecological and evolutionary processes in order to describe patterns of ecological community assembly and species diversity (Webb 2000; Webb et al. 2002; Johnson and Stinchcombe 2007; Cavender-Bares et al. 2009; Pillar and Duarte 2010).

Despite the advances that phylogenetic data have brought to our understanding of patterns of community structure, the same has not been achieved for the ecological knowledge on interacting species yet. In this respect, approaches that relate phylogenetic data to species interactions have been used in order to verify the degree of phylogenetic clustering or over dispersion in the specificity of plant-herbivore interactions, especially in tropical forests (e.g., Novotny and Basset 2005; Weiblen et al. 2006). Such an approach has also been used to study coevolution within small clades (e.g., Pedron et al. 2012), to investigate the importance of traits and phylogenies within a single trophic level (e.g., Novotny and Basset 2005; Weiblen et al. 2006) and to evaluate the effect of phylogenetic structure on coextinction cascades within networks (Rezende et al. 2007). However, the only ecological information incorporated in these models is the relationship between abundance and each taxa, and important ecological factors such as habitat structure and species traits are usually omitted (but see, for instance, Pearse and Hipp 2009; Vázquez et al. 2009; Rafferty and Ives 2013). The interplay between phylogenetic history and the degree of phylogenetic conservatism in species traits are likely to affect some of the patterns found in empirical ecological networks (Fig. 1).

Fig. 1
figure 1

Patterns of ecological interactions arising from the interplay between species functional traits and their evolutionary history. Black squares denote realized species interactions. a Species interactions are a result of labile species traits that are not phylogenetic conserved; b traits accounting for species interaction are phylogenetic conserved; c interactions are mediated by shared phylogenetic history, independent of species traits; d functional traits are partially phylogenetic conserved

Insofar, few integrative methods have been proposed and evaluated in detail. For instance, Legendre et al. (2002) and Hommola et al. (2009) developed permutation methods to measure coevolution and cospeciation between hosts and their parasites. Cruz et al. (2012) developed a method to test the influence of phylogenies in the arrangement of bipartite networks (i.e., a network which has two sets of species, such as plants and pollinators, with edges between and not within sets). These methods use only phylogenetic data, and recent analyses have demonstrated that some of them are likely to result in high rates of Type I Error, i.e., incorrectly rejecting a true null hypothesis (Hadfield et al. 2014). Model based approaches, such as generalized linear mixed models or phylogenetic regressions (Ives and Godfray 2006; Hadfield et al. 2014) have also been developed in order to describe phylogenetic patterns in bipartite networks, and have recently been extended to include trait data (Rafferty and Ives 2013). However, these model-based approaches rely on distribution assumptions, which may be unrealistic and complicated to parameterize. Randomization tests offer a simpler solution and are much less restricted by assumptions, as they rely on distribution free statistics and on algorithms that use systematic or random data permutations to generate alternative outcomes for the chosen test statistic under a true null hypothesis (Pillar 2013).

Here, we develop a statistical framework that integrates phylogenetic and trait data from bipartite networks, although the method can be extended to unipartite networks (networks that have only one set of species, such as a co-occurrence network), based on fuzzy set theory (Zadeh 1965) and randomization tests. Our approach enables the detection of: (1) phylogenetic signal in traits accounting for species interactions; (2) correlation among traits accounting for species interactions, removing the effect of phylogenies; and (3) correlation between phylogenies, which is a necessary but not sufficient condition to be considered a sign of cospeciation or cocladogenesis. We provide a simulation study that shows that our methodology provides adequate rates of Type I Error. We also showcase our framework with an analysis of a mutualistic network from southern Brazil.

Input Data

Our framework requires data organized into, at least, five matrices (Fig. 2a): (i) A matrix containing the observed pairwise species interactions (matrix N AB ; containing either binary or frequency data). For simplicity we will assume that this matrix contains two different trophic levels, with prey (A) and predators (B), but it can accommodate any kind of antagonist or mutualistic interaction, and it can also contain data from unipartite networks. The phylogenetic pairwise resemblances between species: matrix A A for the lower trophic level and A B for the higher trophic level (ii–iii). Species trait data: matrices B A (traits × species) for the lower trophic level and B B for the higher trophic level (iv–v), with traits of any type. An additional binary matrix (F), containing species pairwise co-occurrence (either temporal or spatial), coded as 0 (the pair of species do not co-occur) or 1 (the pair of species co-occur), can also be used (Fig. 2c). Matrix F is not required for the analysis, but may provide additional information and control for situations where phenological or spatial decoupling, for instance, is common.

Fig. 2
figure 2

An overall scheme of our analytical framework. a Input data; b scaling-up of phylogeny and trait-based data to the network level; c fuzzy-weighted interaction matrices are multiplied, using Hadamard element-wise multiplier, by a (temporal or spatial) co-ocurrence matrix; d eco-evolutionary patterns revealed by matrix correlations

Scaling Up of Traits and Phylogenies to the Network Level

Trait data in matrices B A and B B, and phylogenetic data in matrices A A and A B (Fig. 2a) are scaled up to the network level using similar methods previously described in Pillar and Orlóci (1991), Pillar et al. (2009) and Pillar and Duarte (2010), which are extended and explained here in detail. The first step is to transform trait matrices (B A and B B ), into a symmetric similarity matrix (Matrices S A and S B ; Fig. 2b), using an appropriate measure. For this, we have used Gower’s general similarity coefficient in the range 0–1, which is defined as:

$${G_{ij}} = \frac{{\mathop \sum \nolimits_{j = 1}^p {w_{ijh}}{s_{ijh}}}}{{\mathop \sum \nolimits_{j = 1}^p {w_{ijh}}}}$$
(1)

where s ijh is the partial similarity for trait h in the range 0–1 between any species i and j of the same trophic level, and p is the number of traits. This partial similarity can be applied to different types of traits (binary, qualitative, semiquantitative, quantitative and mixed variables) each one according to its own mathematical type (Podani 2000; Legendre and Legendre 2012). w ijh is the Kronecker’s delta, describing the presence of information: w ijh = 0 when the information about trait h is missing for species i and/or j; w ijh = 1 when information is present for both species (Podani 2000; Legendre and Legendre 2012). w ijh may also be used as weights (between 0 and 1), instead of being used as Kronecker’s delta (Legendre and Legendre 2012).

Based on their functional similarity, every species i among s species in each trophic level specifies a fuzzy set to which every species j (j = 1 to s species, including species i) in the same trophic level belongs to with a certain degree of belonging (u ij ), taking values in a unit interval. The degrees of belonging of each species are the elements comprised in the new matrices U A or U B (Fig. 2b) and are standardized to unit column total by

$${u_{ij}} = \frac{{{s_{ij}}}}{{\mathop \sum \nolimits_{k = 1}^s {s_{kj}}}}$$
(2)

where s ij is the pairwise similarity in the range 0–1, in our definition, Gower’s similarity.

Using matrix multiplication, Y A  = U A N AB and Y B  = N AB U’ B , we can estimate the probability of a species in one trophic level interacting with a species in the other trophic level, weighted by their trait similarities (Fig. 2b). Using the same procedure, matrices of phylogenetic similarities A A and A B are transformed into fuzzy set matrices (Q A and Q B; Fig. 2b), and then scaled up to the network level, generating matrices P B and P A , corresponding to the probability of species interactions weighted by species phylogenetic resemblance in each trophic level (Fig. 2b). Matrices Y A , Y B , P A and P B contain the probability of interaction between species that are originally described in matrix N AB . However, the probability value for the same interaction will differ between matrices, since in each matrix the values are constrained by a different subset of traits (matrices Y A and Y B ) and phylogenetic distances (matrices P A and P B ).

Dealing with Co-Occurrence

Ecologists usually assemble networks that result from sampling schemes that encompass different spatial (Winemiller 1990; Dáttilo et al. 2013) and temporal scales (Winemiller 1990; Díaz-Castelazo et al. 2010; Johansson et al. 2015). Nonetheless, in the resulting network some interactions may never happen because a pair of species may not co-occur either in time (e.g., phenological differences) or space (e.g., species inhabit different habitat patches), despite their phylogenetic- or trait-similarity. To illustrate the point, imagine two predator species that have similar probabilities of interaction with a specific prey, either because they are functionally or phylogenetically similar, but one of them may not consume the same resource species because they never occur at the same place and time (e.g., spatial and phenological decoupling), either by chance or by biological reasons. Matrix F may be used to take this into account or to reveal spatial and temporal patterns. Using Hadamard element-wise multiplier, we can multiply matrices Y A , Y B , P A and P B by matrix F (Fig. 2c). This multiplication will result in four new matrices (Fig. 2c), which contain interaction probabilities, either weighted by trait- or phylogenetic resemblance, but corrected by either spatial or temporal mismatch between species from different trophic levels.

Matrix Correlations and Null Model

The probabilistic matrices defined before can be used in a series of matrix correlation tests in order to detect (i) the phylogenetic component of interactions, (ii) phylogenetic signal in traits in both trophic levels and (iii) the functional component of interactions (Fig. 2d). The statistical significance of each matrix correlation is evaluated by permutation against a null model, which is explained in details bellow. Using Mantel matrix correlation, the correlation ρ(P A P B ) reveals patterns of the phylogenetic component of interactions which might be an evidence of cospeciation or, more generally, cocladogenesis (Fig. 2d), in which two or more interacting lineages undergo matched branching events during their phylogenetic history (Thompson 2014). Phylogenetic signal in traits are evaluated through the matrix correlations ρ(Y A P A ) and ρ(Y B P B ) (Fig. 2d). When the matrix correlation ρ(Y A Y B ) is high, we may infer that the observed interactions are largely due to functional traits of species in both trophic levels, e.g. plant and animal species. However, as we pointed out earlier, traits may present a significant degree of phylogenetic autocorrelation (Felsenstein 1985; Losos 2008), which makes necessary to consider the influence of phylogeny into this trait-based analysis in order to appreciate the independent effect of traits on species interaction. At first, we used higher-order partial matrix correlation to remove the effect of phylogenies and estimate the independent effect of traits, but this approach resulted in tests that were inaccurate in terms of Type I Error rates (see “Simulation Study to Assess Type I Error Rates” section for more details). Thus, to assess the independent trait component of interactions, we used a slightly different approach removing the phylogenetic component of interactions by computing linear regressions using the vector that contains species pairwise phylogenetic similarities as the predictor variable and the vector containing species pairwise functional similarities as response variable (Fig. 3). These vectors are obtained from the original phylogenetic similarity matrices and by calculating similarity matrices from the original trait matrices from each trophic level (Fig. 3). The residuals of these regressions are then used in the scaling up process, resulting in two new matrices, U resA and U resB (Fig. 3). By matrix multiplication, we obtain new trait-weighted interaction matrices removing the effect of phylogenies: R A = U resA N AB and R B = N AB U resB . The matrix correlation ρ(R A R B ) will express the correlation between these trait-weighted interaction matrices independent of the effect of phylogenies (Fig. 3).

Fig. 3
figure 3

Method used to assess the functional component of interactions removing the effect of phylogeny. a Scaling up of traits to the network level, removing the phylogenetic signal, based on linear models (LM). b Matrix correlation model used to test the effect of traits in species interactions

The statistical significance of each zero-order matrix correlation, based on distance matrices, is then evaluated by permutation against a null model in which the interaction matrix is independent from the interacting species traits or phylogeny. This is achieved by random permutation among the column vectors in one of the fuzzy weighted matrices (U A , U B , Q A or Q B and related matrices; Figs. 2b, 3a). The column vectors in these matrices represent the fuzzy sets defined by each and every species, which are kept intact when permuted, generating a new random matrix. This random rearrangement is repeated many times and new values of matrix correlations are computed and compared to the observed value; P values for the test will be the proportion of matrix correlations statistics (ρ) larger than or equal to the observed ρ in a large number of random permutations (P[ρnull ≥ ρ observed]).

Computer Software

The methods described here have been implemented in the R (R Core Team 2012) package SYNCSA (Debastiani and Pillar 2012) and the code is available in the Online Resource 1.

Simulation Study to Assess Type I Error Rates

We evaluated the accuracy of the test by investigating the rates of Type I Error (the incorrect rejection of a true null hypothesis) using large sets of simulated data (50,000 iterations in each test). Simulations were implemented as to represent realistic biological scenarios, with interaction networks varying in size, number of functional traits and the number of interactions, and with species traits evolving according to distinct evolutionary models. However, as we were interested in the accuracy of the test, a pure stochastic process was used to determine species interactions. Simulations were implemented in several steps, which are described in detail below:

  1. a.

    We first produced simulated phylogenetic trees of different sizes, from 5 to 20 species for each trophic level, which gave us networks (see step d) that varied in size, from 10 to 40 species. The size of the networks used in our simulations is consistent with the size of sampled ecological networks, which are usually small, comprising, on average, 23 species as suggested by Jonsson (2014);

  2. b.

    We simulated the evolution of a small number of continuous characters (1–8 traits) along with their phylogenetic trees, under an Ornstein–Uhlenbeck model, which simulates different levels of constraints, such as stabilizing selection towards an optimum trait value for all species in each phylogenetic lineage (Hansen 1997; Blomberg et al. 2003). The choice of the number of traits is also congruent with evidence that suggests that very few traits are necessary to account for species interaction (Cohen 1977; Allesina et al. 2008; Eklöf et al. 2013). The Ornstein–Uhlenbeck model is governed by one special parameter (α), which directs the strength of the stabilizing selection towards an optimum trait value; larger values of α indicate that trait values will be closer to the optimum value, thus showing less phylogenetic signal (Blomberg et al. 2003; Harmon et al. 2010). We simulated different sets of parameter values, in order to determine the strength of character evolution towards the optimum trait value. The range of parameter choices used in the simulations allowed trait evolution to either follow a Brownian process (α → 0), as if evolution of traits followed a random walk through evolutionary time, or to follow a strong stabilizing selection towards an optimum trait value (α → 1).

  3. c.

    As we were interested in estimating Type I Error rates, we simulated qualitative interaction matrices based on a random process, using a binomial distribution, where each cell of each simulated network has a probability of success, i.e., that a pair of species from different trophic levels interact, equal to 0.5. Therefore, the resulting network is determined solely by chance, without any regard to traits or phylogenies.

  4. d.

    We then tested three sets of matrix correlations, in order to assess the following eco-evolutionary patterns (see Figs. 2d, 3b): (1) phylogenetic component, i.e., the association between phylogenies; and the functional component of interactions (2) removing the effect of phylogeny and (3) without removing it. The significance level to reject the null hypothesis was set a priori at α = 0.05. Each test was deemed accurate if Type I Error was within 99.9% confidence limits (0.05 ± 0.0032 for 50,000 simulated datasets). The R code for the simulation study is available in the Online Resource 2.

The results of our simulation study show that our framework is accurate, with Type I Error within 99.9% confidence limits for P = 0.05 (Table 1). All tests behave adequately in terms of Type I Error, rejecting a true null hypothesis in ~5% of the simulated datasets, independent of network size, number of traits and the strength of stabilizing selection. The results for each subset of parameters can be seen in the Online Resource 3. In a first simulation study, we tried to estimate the functional component of interactions by removing the phylogenetic signal using simple first order matrix correlations (akin to partial Mantel test) using the phylogenetic and trait matrices after they have been scaled up to the network level (matrices Y A , Y B , P A and P B in Fig. 2). However, the results of this first simulation study showed these higher order matrix correlations were inaccurate, with very low rates of Type I Error, in which true null hypotheses were rejected in 0.3% of the simulated datasets. In order to circumvent this problem, we used the procedure described above (see section “Matrix Correlations and Null Model” and Fig. 3) by scaling up the residual matrices from phylogenetic and trait matrices. This procedure proved to be accurate in terms of Type I Error (Table 1).

Table 1 Simulation results for Type I Error of the matrix correlation tests proposed in this paper, based on 50,000 simulated data sets. Tests were considered accurate in terms of Type I Error if the rejection rates fell within the 99.9% confidence limits (0.05 ± 0.0032)

An Example from a Mutualistic Network

In order to illustrate our approach, we used data from a seed dispersal network from a grassland-forest mosaic from southern Brazil (30°25′S; 52°21′W). Birds were captured with mist-nets, which were placed in grasslands near to forest patches. Mist nets were set up monthly for eight consecutive days, between July 2007 and June 2008. Birds captured in mist nets were then placed into fabric bags for 20 min, and their feces were collected from bags. The seeds found in fecal samples were identified to species, and with this information at hand it was possible to build an interaction matrix between birds and the plant they consumed, with the frequencies of interaction (i.e., the number of times a specific bird species consumed a specific plant species). This interaction matrix consists of 128 interactions between 22 plant species, and 12 bird species (see Fig. 4).

Fig. 4
figure 4

Seed-dispersal interactions in southern Brazil, with the phylogeny of each trophic level represented in the margins. Circle sizes are proportional to the frequency of the interaction

We measured five plant traits (dispersule diameter, maximum plant height, aril presence, diaspore shape and color) and four bird traits (body length, beak length, beak height and the hand-wing index; for further details, see Online Resource 4). Using the APG III megatree (R20100701.new; Angiosperm Phylogeny Group 2009), we constructed a base family-level phylogeny. Due to the lack of within-family resolution, species and genera were represented as soft polytomies within genera and families, respectively. Branch lengths were added to the phylogeny using the BLADJ algorithm (Webb et al. 2008), which constrains the age of nodes included in the sample according to the dated molecular phylogeny of Wikström et al. (2001). For birds, we used the phylogenetic trees available at birdtree.org (Jetz et al. 2012). We then built a strict consensus tree using Mesquite 2.75 (Maddison and Maddison 2007). As for plant species, bird taxa were also represented as soft polytomies. Branch lengths of terminal taxa were arbitrary lengthened in the consensus tree using the function “ultrametricize” in Mesquite. Phylogenetic distances between all pairs of species were then calculated using the PHYDIST procedure of Phylocom (Webb et al. 2008). The data are available at the Interaction Web Database (https://www.nceas.ucsb.edu/interactionweb/).

We employed our framework to scale phylogenetic and trait data to the network level. As sampling lasted nearly 1 year, we used Hadamard multiplier to multiply all four probabilistic matrices by the F matrix, which is an incidence matrix, where 1 s mean that at least once, during the sampling period, a bird species occurred in the study site when a specific plant species was fructifying, and 0 s mean otherwise. We then tested four matrix correlation models, using Euclidean distance as a resemblance measure: phylogenetic signal in traits in each trophic level; correlation among traits accounting for species interactions, removing the effect of phylogenies and; the correlation between phylogenies, in order to detect patterns of cocladogenesis.

The results are shown in Table 2. Among the four tested models, the only significant correlation was the one between bird and plant traits, showing that birds must have specific traits in order to consume their plant resources, and that phylogenetic resemblance has no explanatory power for the evolution of species traits and species interactions in this seed-dispersal network. As the benefits of plant-animal disperser interactions are mutual, ecologists and evolutionary biologists have long pondered whether this sort of mutualistic interaction is constrained by strong evolutionary forces (Snow 1971; Morton 1978; Howe 1993; Muller-Landau and Hardesty 2005). Theoretical models and empirical data suggest that plant-seed disperser interactions are a system of low specialization (Herrera 1995; Muller-Landau and Hardesty 2005), in which a species from one trophic level can interact with many species of the other level. Moreover, it has been suggested that frugivory is a foraging mode that does not require special adaptation in traits involved in the interaction (Jordano 2000). Our results seem to corroborate the idea that plant-seed disperser networks exhibit low specialization, in terms of interacting species, and are not governed by strong evolutionary constraints. Alternatively, the lack of correlation between phylogenies may indicate selection imposed by mutualistic interactions strongly affecting trait evolution, as expected in mutualisms among free-living species and based on trait-matching (Thompson 2006; Guimarães et al. 2011). In fact, our results also demonstrate that some level of trait complementarity is relevant for determining interaction patterns, despite the high plasticity of the foraging spectrum of birds. Although one might expect trait evolution to be influenced by the phylogenetic relationship among species, it is now widely recognized that traits vary tremendously in their phylogenetic pattern (Blomberg et al. 2003), and recent evidence suggest that this relationship should be expected only under some very specific conditions that are seldom expected to hold in mutualisms among free-living species (Thompson 1994). For example, Nuismer and Harmon (2015) have demonstrated that mutualistic networks, such as our example, should exhibit less phylogenetic signal in rates of interactions than competitive ones, and that if interactions within a network depend on a mechanism of phenotype differences, phylogenetic information has little predictive power for trait evolution and interaction rates.

Table 2 Summary statistics for four models for the seed dispersal network from southern Brazil

Discussion and Final Remarks

Understanding how species interact and how the topology of ecological networks influences the dynamics of populations and communities is at the core of ecological inquiry and has been challenging ecologists for over a century now (Camerano 1880; Paine 1980; Polis and Strong 1996; Schleuning et al. 2015). Despite the long tradition, the study of complex ecological networks has dramatically increased in the past two decades (Miranda et al. 2013). Nonetheless, most empirical studies still focus on the description of network properties, such as size (i.e., species richness within the network), connectivity and degree distribution (Miranda et al. 2013). Only recently, there has been a growing interest of moving beyond the description of topological patterns and the integration of other types of data, such as phylogenetic and trait data, to reveal patterns of species interactions (e.g., Rezende et al. 2007; Rafferty and Ives 2013; Hadfield et al. 2014; Vizentin-Bugoni et al. 2014). Here, we developed a statistical framework based on fuzzy set theory and Monte Carlo statistics capable of identifying eco-evolutionary patterns that might suit some of this interest. More specifically, our method is intended to answer the following ecological questions: Is there phylogenetic signal in traits accounting for species interaction? Are species interactions driven by trait resemblance? Are species interactions driven by phylogenetic resemblance (i.e., is there evidence of cocladogenesis?)? At this point, however, it is important to note that interpreting cophylogenetic analyses can be extremely difficult and finding correlated phylogenies does not necessarily indicate a history of coevolution or cospeciation (Banks and Paterson 2005; Thompson 2005). Accordingly, coevolution does not imply in cospeciation, cocladogenesis, or in correlated phylogenies (Thompson 1994, 2005). For instance, in host-parasite networks, gradual host-switching by parasite species, followed by speciation events may lead to “false” congruent phylogenies (Banks and Paterson 2005). Thus, results should be interpreted with caution. However, our cophylogenetic analysis can help ecologists to understand network patterns and bring important information to applied matters, such as choosing target species to conservation or restoration plans, as it allows us to identify pair of species with higher chance of interacting, and the role of phylogenetic- and/or trait-resemblance, even if different processes may lead to the same apparent pattern.

Our method is less restricted by statistical assumptions than model-based approaches, it is relatively easy to apply and can be used with both qualitative and quantitative species interaction matrices. Other advantage of the method is that it is suitable for a range of data types, allowing investigators to use qualitative (expanded as dummy variables) and/or quantitative traits. Also it does not require the availability of dated phylogenetic trees, as the method is based on resemblance matrices. In situations where phylogenetic trees are not available, distances can be computed from raw data such as sequences in databases. Moreover, our method could be easily expanded to include other kind of ecological information, such as environmental variables. By using higher order matrix correlations, one could access the effects of phylogeny, traits and the underlying environmental gradient on the architecture of networks.

Hadfield et al. (2014) evaluated the accuracy of the cophylogenetic permutation tests proposed by Legendre et al. (2002), Homola et al. (2009) and the model-based approach proposed by Ives and Godfray (2006). Their results show that in the presence of phylogenetic signal, and when evolutionary interactions effects are present, these three methods give severely inflated Type I Error rates when trying to estimate the correlation between phylogenies in a bipartite network. Contrary to these methods and despite its resemblance with the Mantel and partial Mantel approach (Smouse et al. 1986; Legendre and Fortin 2010; Debastiani and Duarte 2016), which has been criticized by its low power, and under some circumstances, inflated Type I Error rates (Lapointe and Legendre 1995; Harmon and Glor 2010; Legendre and Fortin 2010; but see Debastiani and Duarte 2016), our statistical framework gave accurate rejection rates, rejecting a true null hypothesis in ~5% of the simulated datasets, even in the presence of strong phylogenetic signal, as shown in our simulation study.

We additionally point out another possible application of the framework developed here. The method could be used to construct an interaction probability matrix for unobserved realizations, and predict possible interactions. Using the scaling up process we presented here, one could predict the interaction probability of species that are known to occur in the study site, but were not observed interacting with other species. These species could be included in the interaction matrix, with zero values across their rows or columns. Then, one could estimate the probability of interaction with each and every species in the other trophic level, based on species trait- of phylogenetic- resemblance. Although this possibility has yet to be tested, it is a potential feature of the method, which can account for sampling problems or be used in other applied matters, when one has to estimate the probability of interactions that were not observed directly in the field.

To conclude we stress that the statistical method we developed here and its extension can de used to tackle a wide range of eco-evolutionary questions. We hope that further developments broaden the range of possible applications and our understanding of underlying mechanisms driving patterns in ecological networks.