GIC
returns the Kullback-Leibler divergence, L1 or L2 distance between an
undirected graph and a given graph model using the exact or degree-based spectral densities.
GIC(Graph, model, p = NULL, dist = "KL", ...)
A list with class 'statGraph' containing the following components:
method:
a string indicating the used method.
info:
a string showing details about the method.
data.name:
a string with the data's name(s).
value:
a real number corresponding to the Kullback-Leibler divergence, L1, or L2 distance between the observed graph and the graph model.
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.
either a list, a string, or a function describing a graph model:
A list that represents the spectral density of a model. It contains the components 'x' and 'y', which are numeric vectors of the same size. The 'x' component contains the points at which the density was computed and the 'y' component contains the observed density.
A string that indicates one 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). When the argument
model
is a string, the user must also provide the model parameter by using
the argument p
.
A function that returns a graph (igraph object)
generated by a graph model. It must contain two arguments: the first one
corresponds to the graph size and the second to the parameter of the model.
The model parameter will be provided by the argument p
of the GIC
function.
the model parameter. The user must provide a valid parameter if the
argument model
is a string or a function.
For the predefined models ('ER', 'GRG', 'KR', 'WS', and 'BA'), the parameter
the probability to connect a pair of vertices, for the 'ER' model
(Erdos-Renyi random graph);
the radius used to construct the geometric graph in a unit square, for the 'GRG' model (geometric random graph);
the degree k
of a regular graph, for the 'KR' model (k regular random
graph);
the probability to reconnect a vertex, for the 'WS' model (Watts-Strogatz model);
and the scaling exponent, for the 'BA' model (Barabási-Albert model).
string indicating if you want to use the 'KL' (default), 'L1' or 'L2' distances. 'KL' means Kullback-Leibler divergence.
Other relevant parameters for graph.spectral.density
.
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.
set.seed(1)
G <- igraph::sample_gnp(n=50, p=0.5)
# Using a string to indicate the graph model
result1 <- GIC(G, 'ER', 0.5)
result1
# Using a function to describe the graph model
# Erdos-Renyi graph
model <- function(n, p) {
return (igraph::sample_gnp(n, p))
}
result2 <- GIC(G, model, 0.5)
result2
Run the code above in your browser using DataLab