Description Usage Arguments Value See Also Examples
Returns the spectral densities for a list of adjacency matrices at the same points
1 | nSpectralDensities(A, from = NULL, to = NULL, bandwidth = "Silverman")
|
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". |
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.
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.