graph.model.selection {statGraph}R Documentation

Graph Model Selection

Description

graph.model.selection selects the graph model that best approximates the observed graph according to the Graph Information Criterion (GIC).

Usage

graph.model.selection(Graph, models = NULL, parameters = NULL, ...)

Arguments

Graph

the undirected graph (igraph object). If Graph has the attribute eigenvalues containing the eigenvalues of Graph, such values will be used to compute its spectral density.

models

either a vector of strings, or a list of functions:

A vector of strings containing some of the following models: 'ER' (Erdos-Renyi random graph), 'GRG' (geometric random graph), 'KR' (k regular random graph), 'WS' (Watts-Strogatz model), and 'BA' (Barabási-Albert model).

A list of functions. Each function returns a graph (igraph object) generated by a graph model and has two arguments: the graph size and the model parameter, in this order.

If the argument models is NULL, then the 'ER', 'WS', and 'BA' models will be considered for the model selection.

parameters

list of numeric vectors or list of lists. If a list of numeric vectors is given, then each vector contains the values that will be considered for the parameter estimation of the corresponding model. If a list of lists is given, then each list contains lo and hi elements that indicate the model's parameter search interval <lo,hi>. If the user does not provide the argument parameters, then default values are used for the predefined models ('ER', 'GRG', 'KR', 'WS', and 'BA') as done in graph.param.estimator.

...

Other relevant parameters for graph.param.estimator.

Value

A list with class 'statGraph' containing the following components:

method:

a string indicating the used method.

info:

a string showing details about the method.

model:

the indice(s) or name(s) of the selected model(s), i. e. the model(s) that minimize(s) the Graph Information Criterion (GIC).

estimates:

a matrix in which each row corresponds to a model, the column 'param' corresponds to the parameter estimate, and the column 'GIC' corresponds to the Graph Information Criterion (GIC), i. e. the distance measure (Kullback-Leibler divergence by default) between the observed graph and the model.

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.

Sheather, S. J. and Jones, M. C. (1991). A reliable data-based bandwidth selection method for kernel density estimation. _Journal of the Royal Statistical Society series B_, 53, 683-690. http://www.jstor.org/stable/2345597.

Examples


## Example using an igraph object as input data
set.seed(1)
G <- igraph::sample_gnp(n=30, p=0.5)

# Using strings to indicate the graph models
result1 <- graph.model.selection(G, models=c('ER', 'WS'), eps = 0.5)
result1


## Using functions to describe the graph models
# Erdos-Renyi graph
model1 <- function(n, p) {
  return(igraph::sample_gnp(n, p))
}
# Watts-Strogatz small-world graph
model2 <- function(n, pr, K=8) {
  return(igraph::sample_smallworld(1, n, K, pr))
}
parameters <- list(seq(0.01, 0.99, 0.49), seq(0.01, 0.99, 0.49))
result2 <- graph.model.selection(G, list(model1, model2), parameters)
result2



[Package statGraph version 1.0.3 Index]