mpnetdist: Distances between Multiplex-networks

Description Usage Arguments Details Value Author(s) References Examples

View source: R/mpnetdist.R

Description

This function computes the Ipsen-Mikhailov distance between two multiplex networks.

Usage

1
mpnetdist(x,y, d="HIM", ga=NULL, components=TRUE, ...)

Arguments

x

A list object, see Description for more details.

y

A list object, see Description for more details.

d

HIM (default), character string containing a valid method. Accepted values are: "IM", "ipsen", "Ipsen", "IpsenMikhailov", or "Ipsen-Mikhailov", for Ipsen-Mikhailov distance and "H", "hamming", or "Hamming" for Hamming distance.

ga

NULL (default), a numeric value for the gamma parameter. If ga=NULL an optimal value based on the number of nodes in the adjacency matrix is computed.

components

TRUE (default), to obtain the components (Hamming and Ipsen-Mikhailov) for method=HIM; otherwise the function returns only the HIM value. If method is set to hamming or ipsen it will be ignored.

...

Additional arguments to be passed to the downstream functions. Normally the argument passed through ... are processed by the functions which compute the distance. Not all parameters are used by all functions.

Details

mpnetdist is a high level function which provides an interface to the Ipsen-Mikhailov distance for multiplex-network. The network can have 1 or more layers with the same number of nodes per layer. Multiplex network can be represented using a list object, with two element I (interlayer adjacency matrix) and L (intralayer adjacency matrix). Given a network with l layers and n nodes per layer the object I of the list should be a matrix of dimension l \times l with no self-loops hence the diagonal should be a vector of zeros. The second element of the list (L) is a 3d array. The array should contain the adjacency matrix for each layer and should be a n \times n \times l array.

Parallel computation is provided automatically through the parallel package included by default from R 2.15. The computation can be automatically parallelized on a multi-cpu computer using the parameter n.cores.

We suggest not to change ga and use the automatic computation of the parameter based on the number of nodes in the network.

Value

The Ipsen-Mikhailov distance value between the input network.

Author(s)

M. Filosi

References

A. Sole-Ribalta, M. De Domenico, N. E. Kouvaris, A. Diaz-Guilera, S. gomez, A. Arenas Spectral Properties of the Laplacian of multiplex networks, 2013, arXiv:1307.2090v1

G. Jurman, R. Visintainer, M. Filosi, S. Riccadonna, C. Furlanello The HIM glocal metric and kernel for network comparison and classification arXiv 2013, arXiv:1201.2931v3

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Create toy dataset
a <- matrix(rnorm(1000),ncol=100)
b <- matrix(rnorm(1000),ncol=100)
cc <- matrix(rnorm(1000),ncol=100)

## Compute adjacency matrix!
## For different methods check the mat2adj help page!
aadj <- mat2adj(a, infer.method="MINE", n.cores=1)
badj <- mat2adj(b, infer.method="MINE", n.cores=1)
cadj <- mat2adj(cc, infer.method="MINE", n.cores=1)

myarr <- array(data=NA, c(100,100,3))
myarr[,,1] <- aadj
myarr[,,2] <- badj
myarr[,,3] <- cadj

iadj <- matrix(c(0,1,0,1,0,1,0,1,0), ncol=3, byrow=TRUE)

net1 <- list(I=iadj, L=myarr)
net2 <- net1

dd <- mpnetdist(net1, net2, n.cores=1)
## IM
## 0

filosi/nettools documentation built on May 28, 2019, 8:38 p.m.