2017-05-03 118 views
2

我想用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") 

回答

2

那么,这里的问题是,你有2个不同的统计在这里。 节点的程度显示它与其他节点有多少连接。 度分布是网络上那些度数的概率分布。

对我来说,把igraph::fit_power_law应用于学位分配上没什么意义,因为度分布在某种程度上已经是幂律。

但是,不要忘记,igraph::fit_power_law有比实现参数更多的选项,这将导致不同的事情,这取决于你“喂养它”。