Learn R Programming

statGraph (version 0.5.1)

fast.spectral.density: Degree-based spectral density

Description

fast.spectral.density returns the degree-based spectral density in the interval <from,to> by using npoints discretization points.

Usage

fast.spectral.density(G, from = NULL, to = NULL, npoints = 2000, numCores = 1)

Value

Returns the degree-based spectral density of the graph in the

Arguments

G

The undirected unweighted graph (igraph type) whose spectral density we want to obtain.

from

Lower end of the interval that contain the eigenvalues or smallest eigenvalue of the adjacency matrix of the graph. The smallest eigenvalue is used if the value is not given.

to

Upper end of the interval that contain the eigenvalues or largest eigenvalue of the adjacency matrix of the graph. The largest eigenvalue is used if the value is not given.

npoints

Number of discretization points of the interval <from,to>.

numCores

Number of cores to use for parallelization.

References

Newman, M. E. J., Zhang, X., & Nadakuditi, R. R. (2019). Spectra of random networks with arbitrary degrees. Physical Review E, 99(4), 042309.

Examples

Run this code
set.seed(42)
G <- igraph::sample_smallworld(dim = 1, size = 100, nei = 2, p = 0.2)

# Obtain the degree-based spectral density
density <- fast.spectral.density(G = G, npoints = 80, numCores = 1)
density

Run the code above in your browser using DataLab