我想知道一个脚本的输出是否绘制分散度可以是正确的。
所以剧本(其中与度我所有的顶点的矢量存储在X):
x是
x
[1] 7 9 8 5 6 2 8 9 7 5 2 4 6 9 2 6 10 8
x是某一网络顶点度 - 等顶点1具有度7,顶点2具有9度等X < - V2摘要(x)的
library(igraph)
split.screen(c(1,2))
screen(1)
plot (tabulate(x), log = "xy", ylab = "Frequency (log scale)", xlab = "Degree (log scale)", main = "Log-log plot of degree distribution")
screen(2)
y <- (length(x) - rank(x, ties.method = "first"))/length(x)
plot(x, y, log = "xy", ylab = "Fraction with min. degree k (log scale)", xlab = "Degree (k) (log scale)", main = "Cumulative log-log plot of degree distribution")
close.screen(all = TRUE)
power.law.fit(x, xmin = 50)
我的问题是,数图似乎是不正确的 - 例如,我有度“7” 8次整体所以不应该在该点上的双对数坐标成为0.845(日志7)/ 0.903(日志( 8)如(X / Y)?
此外,有人可以告诉我如何适应线(上数坐标的幂律)在屏幕2的情节?