-
Notifications
You must be signed in to change notification settings - Fork 0
/
gmeasure.m
39 lines (31 loc) · 1.24 KB
/
gmeasure.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
%Used in GrowMeasures
x=1;%just one subject for now
%calculate measures
%%%%%%%%%%% Degrees
deg=degrees_und(A);
degr=degrees_und(R);
s.k(x,g)=mean(deg);
%%%%%%%%%%%% Assortativity
s.a(x,g)=assortativity_bin(A,0); %weights are discarded even if they exist
s.arand(x,g)=assortativity_bin(R,0);
%%%%%%%%%%%% Modularity
[Com s.M(x,g)]=modularity_und(A);
[Comr s.Mrand(x,g)]=modularity_und(R);
%%%%%%%%%%%% Clustering
s.C(x,g)=mean(clustering_coef_bu(A));
s.Crand(x,g)=mean(clustering_coef_bu(R));
%%%%%%%%%%%% Distance matrix
Dist=distance_bin(A);
DistRand=distance_bin(R);
%%%%%%%%%%%% Path Length
s.L(x,g)=mean(mean(Dist))*n/(n-1);
s.Lrand(x,g)=mean(mean(DistRand))*n/(n-1);
%%%%%%%%%%%%% Small-World Coefficient
s.Sigma(x,g)=(s.C(x,g)./s.Crand(x,g))./(s.L(x,g)./s.Lrand(x,g));
%%%%%%%%%%%%% Efficiency
s.E(x,g)=efficiency_bin(A);
s.Erand(x,g)=efficiency_bin(R);
%%%%%%%%%%%% Cost-Efficiency
s.CE(x,g)=s.E(x,g)-s.cost(g);
s.CErand(x,g)=s.Erand(x,g)-s.cost(g);
%%%%%%%%%%%%