Multiple assemblage dissimilarity for orders q = 0-N.

dissCqN(
mat,
q = 0:2,
pairwise = FALSE,
compare.sub = NULL,
shared.spp = FALSE,
parallel = "no",
ncpus = NULL,
cl = NULL
)

## Arguments

mat A matrix with assemblages in rows and species or species interactions in columns. Alternatively, a list of matrices, which will be interpreted as interaction networks and used to construct an assemblage x interaction matrix. Integer, the order(s) of q for which to calculate dissimilarity. Can be any set of integers between 0 and N (the number of assemblages in mat). Logical, whether to calculate pairwise, rather than multiple assemblage, dissimilarity. Subsets of assemblages to compare pairwise. These should be supplied as a list of two sets of assemblage names or indices. If only one set is supplied, this is compared to all other assemblages in mat. If more than two sets are supplied, only the first two are used. If NULL (default), all assemblages are compared. Logical, whether to compare networks of shared species only (if mat is a list of networks). The type of parallel processing to use, if any. Can be one of "snow", "multicore", or "no" (for none – the default). Passed to pSapply(). Number of system cores to use for parallel processing. If NULL (default), all available cores are used. Optional cluster to use if parallel = "snow". If NULL (default), a local cluster is created using the specified number of cores.

## Value

A numeric vector of dissimilarities, or a pairwise dissimilarity matrix (or list of matrices), for the orders of q.

## Details

Dissimilarity is calculated here for multiple species assemblages (or interaction networks) via the CqN generalisation of similarity indices (Chao et al., 2008; Jost et al., 2011). Increasing the value of q increases the 'depth' of the measure, that is, how much emphasis is placed on changes in relative abundance of the most common species. Setting q = 0 represents the qualitative Sørensen index (Sørensen, 1948), where rare and common species are treated equally. q > 0 is more sensitive to common species, with q = 1 representing the Shannon-based Horn index (Horn, 1966) and q = 2 the Simpson-based Morisita-Horn index (Horn, 1966; Morisita, 1959). For N > 2, indices are generalised to consider species shared across multiple assemblages (Diserud & Ødegaard, 2007; eqns. 6.3-6.5 in Jost et al., 2011). For q >= 2 <= N, common species increasingly dominate the measure, and it can then be interpreted as the ratio of two probabilities of randomly sampling q individuals of the same species from the N assemblages, where 1) the individuals came from at least one different assemblage ($$^{q}G_{D}$$) and 2) they all came from the same assemblage ($$^{q}G_{S}$$) (Jost et al., 2011). Dissimilarity is thus:

$$1 - ^{q}G_{D} / ^{q}G_{S}$$

Pairwise dissimilarity can be calculated for all or a subset of the assemblages (or networks) in mat, in which case a dissimilarity matrix is returned (one for each value of q). If comparing subsets, the names or indices of assemblages to compare should be supplied to compare.sub. Note that pairwise calculation may take a long time if N is large, in which case parallel processing may speed up results (e.g. parallel = "snow").

If shared.spp = TRUE and mat is a list of interaction networks (as matrices), multiple or pairwise interaction dissimilarity will be calculated for networks of shared species only (see netShared()). This can be useful to help partition the different components of network dissimilarity, e.g. dissimilarity due to interaction 'rewiring' among shared species vs. that due to species turnover (Poisot et al., 2012).

## References

Chao, A., Jost, L., Chiang, S. C., Jiang, Y.-H., & Chazdon, R. L. (2008). A Two-Stage Probabilistic Approach to Multiple-Community Similarity Indices. Biometrics, 64(4), 1178–1186. doi: 10/fcvn63

Diserud, O. H., & Ødegaard, F. (2007). A multiple-site similarity measure. Biology Letters, 3(1), 20–22. doi: 10/bwhfx6

Horn, H. S. (1966). Measurement of “Overlap” in Comparative Ecological Studies. The American Naturalist, 100(914), 419–424. doi: 10/b62ct5

Jost, L., Chao, A., & Chazdon, R. L. (2011). Compositional similarity and beta diversity. In A. E. Magurran & B. J. McGill (Eds.), Biological Diversity: Frontiers in Measurement and Assessment (pp. 66–84). Oxford University Press.

Morisita, M. (1959). Measuring of interspecific association and similarity between communities. Memoirs of the Faculty of Science, Kyushu Univ., Series E (Biology), 3, 65–80.

Poisot, T., Canard, E., Mouillot, D., Mouquet, N., & Gravel, D. (2012). The dissimilarity of species interaction networks. Ecology Letters, 15(12), 1353–1361. doi: 10/f4dv37

Sørensen, T. (1948). A method of establishing groups of equal amplitude in plant sociology based on similarity of species and its application to analyses of the vegetation on Danish commons. Kongelige Danske Videnskabernes Selskabs Biologiske Skrifter, 5, 1–34.

## Examples

# Sample community data from SpadeR package (three assemblages, 120 species)
data(SimilarityMultData, package = "SpadeR")
d <- SimilarityMultData$Abu # Multiple-assemblage dissimilarity for q = 0:2 (CqN <- dissCqN::dissCqN(t(d))) #> C0N C1N C2N #> 0.3411215 0.3479117 0.4198004 # Compare to empirical CqN values from SpadeR::SimilarityMult() sim <- SpadeR::SimilarityMult(d, datatype = "abundance", nboot = 1) CqN_2 <- 1 - c( "C0N" = sim$Empirical_richness["C0N(q=0,Sorensen)", "Estimate"],
"C1N" = sim$Empirical_relative["C1N=U1N(q=1,Horn)", "Estimate"], "C2N" = sim$Empirical_relative["C2N(q=2,Morisita)", "Estimate"]
)
stopifnot(all.equal(CqN, CqN_2))

# Pairwise dissimilarity matrices
dissCqN::dissCqN(t(d), pairwise = TRUE)
#> $C0N #> V1 V2 V3 #> V1 0.0000000 0.3099415 0.5357143 #> V2 0.3099415 0.0000000 0.5586207 #> V3 0.5357143 0.5586207 0.0000000 #> #>$C1N
#>           V1        V2        V3
#> V1 0.0000000 0.3193235 0.4497502
#> V2 0.3193235 0.0000000 0.4222305
#> V3 0.4497502 0.4222305 0.0000000
#>
#> \$C2N
#>           V1        V2        V3
#> V1 0.0000000 0.5413686 0.2558286
#> V2 0.5413686 0.0000000 0.5546613
#> V3 0.2558286 0.5546613 0.0000000
#>