我想用R
来测试网络的度数分布是否像无幂性的幂律一样。尽管如此,我读过不同的人以许多不同的方式来做这件事,一个令人困惑的地方是模型中应该使用的输入。用于拟合网络度数分布的幂律的输入
例如,我读过Barabasi,建议将幂律适合度为(see Advanced Topic 3.B of chapter 4, figure 4.22的'补充累积分布'。但是,我见过的人适合幂律的度(随igraph::degree(g)
获得),而我也看到其他拟合幂律向度分布,像这样获得的:igraph::degree_distribution(g, cumulative = T)
正如您在下面的可重现示例中所看到的,这两个选项给出了非常不同的结果。哪一个是正确的?换句话说,我怎样才能从图中得到“互补的累积分布度数”,这样我就可以适应幂律?
library(igraph)
# create a graph
set.seed(202)
g <- static.power.law.game(500, 1000, exponent.out= 2.2, exponent.in = 2.2, loops = FALSE, multiple = T)
# get input to fit power-law.
# 1) degrees of the nodes
d <- degree(g, v = V(g), mode ="all")
d <- d[ d > 0] # remove nodes with no connection
# OR ?
# 2) cumulative degree distribution
d <- degree_distribution(g, mode ="all", cumulative = T)
# Fit power law
fit <- fit_power_law(d, impelementation = "R.mle")