graph.test: Test for the Jensen-Shannon divergence between graphs

Description Usage Arguments Details Value References Examples

View source: R/statGraph.R

Description

'graph.test' tests whether two sets of graphs were generated by the same random graph model. This bootstrap test is based on the Jensen-Shannon (JS) divergence between graphs.

Usage

1
graph.test(x, y, numBoot = 1000, bandwidth = "Silverman")

Arguments

x

a list of adjacency matrices. For unweighted graphs, each matrix contains only 0s and 1s. For weighted graphs, each matrix may contain nonnegative real values that correspond to the weights of the edges.

y

a list of adjacency matrices. For unweighted graphs, each matrix contains only 0s and 1s. For weighted graphs, each matrix may contain nonnegative real values that correspond to the weights of the edges.

numBoot

integer indicating the number of bootstrap resamplings.

bandwidth

string indicating which criterion will be used to choose the bandwidth for the spectral density estimation. The available criteria are "Silverman" (default) and "Sturges".

Details

Given two lists of graphs, 'x' and 'y', 'graph.test' tests H0: "JS divergence between 'x' and 'y' is 0" against H1: "JS divergence between 'x' and 'y' is larger than 0".

Value

A list containing:

JS

the Jensen-Shannon divergence between 'x' and 'y'.

p.value

the p-value of the test.

References

Takahashi, D. Y., Sato, J. R., Ferreira, C. E. and Fujita A. (2012) Discriminating Different Classes of Biological Networks by Analyzing the Graph Spectra Distribution. _PLoS ONE_, *7*, e49949. doi:10.1371/journal.pone.0049949.

Silverman, B. W. (1986) _Density Estimation_. London: Chapman and Hall.

Sturges, H. A. The Choice of a Class Interval. _J. Am. Statist. Assoc._, *21*, 65-66.

Examples

1
2
3
4
5
6
7
8
9
library(igraph)
x <- y <- list()
for (i in 1:20)
   x[[i]] <- as.matrix(get.adjacency(erdos.renyi.game(50, p=0.5)))
for (i in 1:20)
   y[[i]] <- as.matrix(get.adjacency(erdos.renyi.game(50, p=0.51)))

result <- graph.test(x, y, numBoot=100)
result

statGraph documentation built on May 29, 2017, 9:08 a.m.