compute_dis: compute pairwise network dissimilarity indices

View source: R/compute_dissimilarities.R

compute_disR Documentation

compute pairwise network dissimilarity indices

Description

Function to compute pairwise network dissimilarity indices based on Hill numbers following the method described in Ohlmann et al. 2019

Usage

compute_dis(metanetwork, q = 1, res = NULL, ncores = 4)

Arguments

metanetwork

object of class 'metanetwork'

q

viewpoint parameter controlling the weight given to abundant species/groups and links, default is 1

res

a vector containing the resolutions at which the diversities are computed

ncores

number of cores used for the computation, default is 4

Details

This function compute pairwise dissimilarity indices using Hill numbers on node and link abundances. Importantly, a viewpoint parameters q allows giving more weigth to abundant nodes/links. Given a network, we note p_q the abundance of node q (stored as node attribute ab) and \pi_{ql} interaction probability between nodes q and l (stored as edge attribute weight). The link abundance L_{ql} between nodes q and l is then:

L_{ql} = \pi_{ql}p_q p_l

Node diversity (for q = 1) is then computed as:

D(p) = \exp (\sum_q - p_q \log p_q)

Link diversity is computed as:

D(L) = \exp (\sum_{ql} - \frac{L_{ql}}{C} \log L_{ql}{C})

where C is the weighted connectance

C = \sum_{ql} \pi_{ql}p_q p_l

For q = 1, the pairwise node dissimilarity indices are computed from pairwise diversities as:

\delta_P=\frac{\log(G_P)-log(A_P)}{\log 2}

where G_P is node \gamma-diversity and A_P the node \alpha-diversity

Pairwise link diversity is:

\delta_L=\frac{\log(G_L)-log(A_L)}{\log 2}

where G_P is the link \gamma-diversity and A_P the link \alpha-diversity

For more details on \alpha-,\beta- and \gamma-diversity, see Ohlmann et al. 2019.

Value

a list of data.frame containing node and link pairwise dissimilarities

References

Ohlmann, M., Miele, V., Dray, S., Chalmandrier, L., O'connor, L., & Thuiller, W. (2019). Diversity indices for ecological networks: a unifying framework using Hill numbers. Ecology letters, 22(4), 737-747.

See Also

compute_div()

Examples

library(metanetwork)
library(igraph)

#on angola dataset
data(meta_angola)
compute_dis(meta_angola,q = 1,ncores = 1)

#computing dissimilarities only at Phylum level
compute_dis(meta_angola,q = 1,res = "Phylum",ncores = 1)


MarcOhlmann/metanetwork documentation built on July 1, 2023, 6:27 a.m.