nSpectralDensities: Spectral Density functions of n graphs

Description Usage Arguments Value See Also Examples

Description

Returns the spectral densities for a list of adjacency matrices at the same points

Usage

1
nSpectralDensities(A, from = NULL, to = NULL, bandwidth = "Silverman")

Arguments

A

a list of adjacency matrices

from

the lower value used to build the distribution

to

the higher value used to build the distribution

bandwidth

a parameters. It can be set to either "Sturges" or "Silverman".

Value

a list containing the components 'x' and 'densities'. The first element is the vector 'x' of 'npoints' coordinates of the points where the density function i estimated, and the second is a vector 'y' of the estimated density values.

See Also

KLdegree

density

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
A<-list()
A[[1]]<-as.matrix(as_adj(erdos.renyi.game(30,0.6,directed = FALSE)))
A[[2]]<-as.matrix(as_adj(barabasi.game(30,power = 1,directed = FALSE)))
A[[3]]<-as.matrix(as_adj(watts.strogatz.game(1,30,2,0.3)))
d<-nSpectralDensities(A, bandwidth="Sturges")
par(mfrow=c(1,3))
plot(d$x,d$densities[,1],main="Erdos-Renyi\n Spectral distribution",
xlab="Eigenvalue",ylab="Frequency")
plot(d$x,d$densities[,2],main="Barabasi\n Spectral distribution",
xlab="Eigenvalue",ylab="Frequency")
plot(d$x,d$densities[,3],main="Watts-Strogatz\n Spectral distribution",
xlab="Eigenvalue",ylab="Frequency")

BioNetStat documentation built on Feb. 3, 2021, 2:01 a.m.