| disparity_filter | R Documentation |
Extracts the statistically significant backbone of a weighted network using the disparity filter method (Serrano, Boguna, & Vespignani, 2009).
disparity_filter(x, level = 0.05, ...)
## Default S3 method:
disparity_filter(x, level = 0.05, ...)
## S3 method for class 'matrix'
disparity_filter(x, level = 0.05, ...)
## S3 method for class 'tna'
disparity_filter(x, level = 0.05, ...)
## S3 method for class 'cograph_network'
disparity_filter(x, level = 0.05, ...)
## S3 method for class 'igraph'
disparity_filter(x, level = 0.05, ...)
x |
A weight matrix, tna object, or cograph_network. |
level |
Significance level (default 0.05). Lower values result in a sparser backbone (fewer edges retained). |
... |
Additional arguments (currently unused). |
The disparity filter identifies edges that carry a disproportionate fraction of a node's total weight, based on a null model where weights are distributed uniformly at random.
For each node i with degree k_i, and each edge (i,j)
with normalized weight p_{ij} = w_{ij} / s_i (where s_i is
the node's strength), the p-value is:
p = (1 - p_{ij})^{(k_i - 1)}
Edges are significant if p < level for either endpoint.
For matrices: a binary matrix (0/1) indicating significant edges.
For tna, cograph_network, and igraph objects: a tna_disparity object
containing the significance matrix, original weights, filtered weights,
and summary statistics.
Serrano, M. A., Boguna, M., & Vespignani, A. (2009). Extracting the multiscale backbone of complex weighted networks. Proceedings of the National Academy of Sciences, 106(16), 6483-6488.
bootstrap for bootstrap-based significance testing
# Create a weighted network
mat <- matrix(c(
0.0, 0.5, 0.1, 0.0,
0.3, 0.0, 0.4, 0.1,
0.1, 0.2, 0.0, 0.5,
0.0, 0.1, 0.3, 0.0
), nrow = 4, byrow = TRUE)
rownames(mat) <- colnames(mat) <- c("A", "B", "C", "D")
# Extract backbone at 5% significance level
backbone <- disparity_filter(mat, level = 0.05)
backbone
# More stringent filter (1% level)
backbone_strict <- disparity_filter(mat, level = 0.01)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.