Learn R Programming

cograph (version 2.0.0)

disparity_filter: Disparity Filter

Description

Extracts the statistically significant backbone of a weighted network using the disparity filter method (Serrano, Boguna, & Vespignani, 2009).

Usage

disparity_filter(x, level = 0.05, ...)

# S3 method for default disparity_filter(x, level = 0.05, ...)

# S3 method for matrix disparity_filter(x, level = 0.05, ...)

# S3 method for tna disparity_filter(x, level = 0.05, ...)

# S3 method for cograph_network disparity_filter(x, level = 0.05, ...)

# S3 method for igraph disparity_filter(x, level = 0.05, ...)

Value

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.

Arguments

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).

Details

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.

References

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.

See Also

bootstrap for bootstrap-based significance testing

Examples

Run this code
# 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)

Run the code above in your browser using DataLab