lans | R Documentation |
Remove all edges under certain probability of the fractional edge weight, alpha
.
lans(network, alpha, output, directed = FALSE)
network |
Weighted adjacency matrix, weighted |
alpha |
The |
output |
If the output should be directed or undirected. Default is that the output is the same as the input based on adjacency matrix symmetry. If the default is overridden, set as either "undirected" or "directed". |
directed |
If |
For more information on finding alpha values, see: https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0016431#s5
Weighted adjacency matrix of sparsified network.
Andrew Kramer
Alexander Mercier
Foti, N. J., Hughes, J. M., & Rockmore, D. N. (2011). Nonparametric sparsification of complex multiscale networks. PloS one, 6(2), e16431.
#Generate random ER graph with uniformly random edge weights g = igraph::erdos.renyi.game(100, 0.1) igraph::E(g)$weight <- runif(length(igraph::E(g))) #Sparsify g via LANS S = lans(g, alpha = 0.3, output = "undirected", directed = FALSE) #Convert sparsifier to edge list S_List = simplifyNet::Mtrx_EList(S, directed = FALSE) sg = simplifyNet::net.as(S_List, net.to="igraph", directed=FALSE) igraph::ecount(sg)/igraph::ecount(g)#fraction of edges in the sparsifier
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.