compare: Compare Networks Many-to-Many

View source: R/compare.R

compareR Documentation

Compare Networks Many-to-Many

Description

Compares one network to a list of many networks.

Usage

compare(
  networks,
  net_kind = "matrix",
  method = "DD",
  cause_orientation = "row",
  DD_kind = "all",
  DD_weight = 1,
  max_norm = FALSE,
  size_different = FALSE,
  cores = 1,
  diffusion_sampling = 2,
  diffusion_limit = 10,
  verbose = FALSE
)

Arguments

networks

The networks being compared to the target network

net_kind

If the network is an adjacency matrix ("matrix") or an edge list ("list"). Defaults to "matrix".

method

This determines the method used to compare networks at the heart of the classification. Currently "DD" (Degree Distribution) and "align" (the align function which compares networks by the entropy of diffusion on them) are supported. Future versions will allow user-defined methods. Defaults to "DD".

cause_orientation

= The orientation of directed adjacency matrices. Defaults to "row".

DD_kind

= A vector of network properties to be used to compare networks. Defaults to "all", which is the average of the in- and out-degrees.

DD_weight

= Weights of each network property in DD_kind. Defaults to 1, which is equal weighting for each property.

max_norm

Binary variable indicating if each network property should be normalized so its max value (if a node-level property) is one. Defaults to FALSE.

size_different

Defaults to FALSE. If TRUE, will ensure the node-level properties being compared are vectors of the same length, which is accomplished using splines.

cores

Defaults to 1. The number of cores to run the classification on. When set to 1 parallelization will be ignored.

diffusion_sampling

Base of the power to use to nonlinearly sample the diffusion kernels if method = "align". Defaults to 2.

diffusion_limit

Number of markov steps in the diffusion kernels if method = "align". Defaults to 10.

verbose

Defaults to TRUE. Whether to print all messages.

Details

Note: Currently each process is assumed to have a single governing parameter.

Value

A square matrix with dimensions equal to the number of networks being compared, where the ij element is the comparison of networks i and j.

References

Langendorf, R. E., & Burgess, M. G. (2020). Empirically Classifying Network Mechanisms. arXiv preprint arXiv:2012.15863.

Examples

# Import netcom
library(netcom)

# Adjacency matrix
size <- 10
comparisons <- 50
networks <- list()
for (net in 1:comparisons) {
     networks[[net]] = matrix(
         sample(
             c(0,1), 
             size = size^2, 
             replace = TRUE), 
         nrow = size,
         ncol = size)
}
compare(networks = networks)


langendorfr/netcom documentation built on July 23, 2022, 5:19 p.m.