
Last chance! 50% off unlimited learning
Sale ends in
global.efficiency(adj.mat, weight.mat)
local.efficiency(adj.mat, weight.mat)
global.cost(adj.mat, weight.mat)
cost.evaluator(x)
Formula for the nodal efficiency for the node $i$:
Formula for the local efficiency for node $i$:
The computation of the cost requires the definition of an internal function, called cost.evaluator
. For the moment, the cost.evaluator
is the identity. Refer to Latora (2001) for
the exact definition and usage of this function.
V. Latora, and M. Marchiori (2003) Economic Small-World Behavior in Weighted Networks. Europ. Phys. Journ. B, Vol. 32, pages 249-263.
S. Achard, R. Salvador, B. Whitcher, J. Suckling, Ed Bullmore (2006) A Resilient, Low-Frequency, Small-World Human Brain Functional Network with Highly Connected Association Cortical Hubs. Journal of Neuroscience, Vol. 26, N. 1, pages 63-72.
const.adj.list
, small.world
data(brain)
brain<-as.matrix(brain)
# WARNING : To process only the first five regions
brain<-brain[,1:5]
n.regions<-dim(brain)[2]
#Construction of the correlation matrices for each level of the wavelet decomposition
wave.cor.list<-const.cor.list(brain, method = "modwt" ,wf = "la8", n.levels = 6,
boundary = "periodic", p.corr = 0.975)
sup.seq<-((1:10)/10) #sequence of the correlation threshold
nmax<-length(sup.seq)
Eglob<-matrix(0,6,nmax)
Eloc<-matrix(0,6,nmax)
Cost<-matrix(0,6,nmax)
n.levels<-6
#For each value of the correlation thrashold
for(i in 1:nmax){
n.sup<-sup.seq[i]
#Construction of the adjacency matrices associated to each level of the wavelet decomposition
wave.adj.list<-const.adj.list(wave.cor.list, sup = n.sup)
#For each level of the wavelet decomposition
for(j in 1:n.levels){
Eglob.brain<-global.efficiency(wave.adj.list[[j]],
weight.mat=matrix(1,n.regions,n.regions))
Eglob[j,i]<-Eglob.brain$eff
Eloc.brain<-local.efficiency(wave.adj.list[[j]],
weight.mat=matrix(1,n.regions,n.regions))
Eloc[j,i]<-Eloc.brain$eff
Cost.brain<-global.cost(wave.adj.list[[j]],
weight.mat=matrix(1,n.regions,n.regions))
Cost[j,i]<-Cost.brain
}}
plot(sup.seq,(1:nmax)/2,type='n',xlab='Correlation threshold, R',ylab='Global efficiency',
cex.axis=2,cex.lab=2,xlim=c(0,1),ylim=c(0,1))
for(i in 1:n.levels){
lines(sup.seq,Eglob[i,],type='l',col=i,lwd=2)
}
legend(x="topright",legend=c("Level 1","Level 2","Level 3","Level 4",
"Level 5","Level 6"),fill=TRUE,col=(1:n.levels),lwd=2)
Run the code above in your browser using DataLab