-
Notifications
You must be signed in to change notification settings - Fork 0
/
ScriptPoweRlaw.txt
91 lines (78 loc) · 2.05 KB
/
ScriptPoweRlaw.txt
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
b <- bet[bet>0]
c <- close[close>0]
e <- eig[eig>1e-09]
i <- indegree[indegree>0]
o <- outdegree[outdegree>0]
k <- katz[katz>0]
p <- page[page>0]
library("poweRlaw")
m_pl = conpl$new(b)
m_ln = conlnorm$new(b)
est = estimate_xmin(m_pl)
m_pl$setXmin(est)
est = estimate_xmin(m_ln)
m_ln$setXmin(est)
pdf("PowerlawBet.pdf")
plot(m_pl,xlab="Betweeness",ylab="CDF",main="Betweeness - CDF")
lines(m_pl, col = 2, lwd=3)
lines(m_ln, col = 3, lwd=3)
dev.off()
m_pl = conpl$new(c)
m_ln = conlnorm$new(c)
est = estimate_xmin(m_pl)
m_pl$setXmin(est)
est = estimate_xmin(m_ln)
m_ln$setXmin(est)
pdf("PowerlawClose.pdf")
plot(m_ln,xlab="Closeness",ylab="CDF",main="Closeness - CDF")
lines(m_pl, col = 2, lwd=3)
lines(m_ln, col = 3, lwd=3)
dev.off()
m_ln = conlnorm$new(e)
est = estimate_xmin(m_ln)
m_ln$setXmin(est)
pdf("PowerlawEig.pdf")
plot(m_ln,xlab="Eigenvector",ylab="CDF",main="Eigenvector - CDF")
lines(m_pl, col = 2, lwd=3)
lines(m_ln, col = 3, lwd=3)
dev.off()
m_pl = conpl$new(i)
m_ln = conlnorm$new(i)
est = estimate_xmin(m_pl)
m_pl$setXmin(est)
est = estimate_xmin(m_ln)
m_ln$setXmin(est)
pdf("PowerlawIndegree.pdf")
plot(m_pl,xlab="In-degree",ylab="CDF",main="In_degree - CDF")
lines(m_pl, col = 2, lwd=3)
lines(m_ln, col = 3, lwd=3)
dev.off()
m_pl = conpl$new(o)
m_ln = conlnorm$new(o)
est = estimate_xmin(m_pl)
m_pl$setXmin(est)
est = estimate_xmin(m_ln)
m_ln$setXmin(est)
pdf("PowerlawOutdegree.pdf")
plot(m_pl,xlab="Out-degree",ylab="CDF",main="Out_degree - CDF")
lines(m_pl, col = 2, lwd=3)
lines(m_ln, col = 3, lwd=3)
dev.off()
m_pl = conpl$new(k)
m_ln = conlnorm$new(k)
est = estimate_xmin(m_pl)
m_pl$setXmin(est)
est = estimate_xmin(m_ln)
m_ln$setXmin(est)
pdf("PowerlawKatz.pdf")
plot(m_pl,xlab="Katz",ylab="CDF",main="Katz - CDF")
lines(m_pl, col = 2, lwd=3)
lines(m_ln, col = 3, lwd=3)
dev.off()
m_pl = conpl$new(p)
est = estimate_xmin(m_pl)
m_pl$setXmin(est)
pdf("PowerlawPagerank.pdf")
plot(m_pl,xlab="Pagerank",ylab="CDF",main="Page-Rank - CDF")
lines(m_pl, col = 2, lwd=3)
dev.off()