Skip to contents

Estimating network histogram and returning the indices of partitions.

Usage

nethist(A, h = NA, outfile, verbose = FALSE)

Arguments

A

An adjacency matrix or igraph object. It must be an undirected and simple graph.

h

A bandwidth parameter. If NA, selecting bandwidth by Olhede and Wolfe (2014). If specified, the user input value is used.

outfile

A filename for saving cluster indices. If it is missing, the results are not saved in a file.

verbose

logical value indicating whether verbose output is generated.

Value

An object of class nethist:

  • cluster a vector of partition indices.

  • p_mat a probability matrix from network histogram ordered by cluster labels.

  • rho_hat estimated sparsity parameter.

Details

Note that cluster only shows a partition of vertices, and the index labels is not an ordered variable. For example, nodes in cluster 1 do not have to more similar to nodes in cluster 2 than nodes in cluster 10. Hence, users would use a user-specified order in plot.nethist().

Network histogram values are computed by p_mat/rho_hat in nethist object.

nethist() runs the following two steps:

  • Initialization: With spectral clustering, find an initial partitions of vertices. If bandwidth h is not specified, automatic bandwidth selection is used.

  • Using a greedy search algorithm, find a (local) optima of normalized profile log-likelihood, which is cluster in the nethist object.

References

Olhede, S. C., & Wolfe, P. J. (2014). Network histograms and universality of blockmodel approximation. Proceedings of the National Academy of Sciences, 111(41), 14722-14727.

Wolfe, P. J., & Olhede, S. C. (2013). Nonparametric graphon estimation. arXiv preprint arXiv:1309.5936.

See also

Examples

if (FALSE) {
set.seed(2022)
#Generating Erdos-Renyi graph
A <- igraph::sample_gnp(100, 0.05)

#With automatic bandwidth selection
hist_A <- nethist(A) 

#with user-specified bandwidth
hist_A <- nethist(A, h = 20) 

#with adjancency matrix
hist_A <- nethist(igraph::as_adj(A)) 
}