Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 将幂律拟合到网络度分布的输入_R_Igraph_Ecdf_Power Law - Fatal编程技术网

R 将幂律拟合到网络度分布的输入

R 将幂律拟合到网络度分布的输入,r,igraph,ecdf,power-law,R,Igraph,Ecdf,Power Law,我想使用R来测试网络的度分布是否表现为具有无标度特性的幂律。尽管如此,我读过很多不同的人以不同的方式做这件事,一个令人困惑的问题是模型中应该使用的输入 例如,Barabasi建议将幂律与度的“互补累积分布”相匹配()。然而,我见过人们将幂律与图的度数相匹配(通过igraph::degree(g)获得),我也见过其他人将幂律与度分布相匹配,通过igraph::degree_分布(g,累计=T) 正如您在下面的可复制示例中所看到的,这些选项给出了非常不同的结果。哪一个是正确的?我怎样才能从一张图中得

我想使用
R
来测试网络的度分布是否表现为具有无标度特性的幂律。尽管如此,我读过很多不同的人以不同的方式做这件事,一个令人困惑的问题是模型中应该使用的输入

例如,Barabasi建议将幂律与度的“互补累积分布”相匹配()。然而,我见过人们将幂律与图的度数相匹配(通过
igraph::degree(g)
获得),我也见过其他人将幂律与度分布相匹配,通过
igraph::degree_分布(g,累计=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")
库(igraph)
#创建图形
种子集(202)

问题是这里有两种不同的统计数据。 节点的阶数显示它与其他节点的连接数。 度分布是这些度在网络上的概率分布

对我来说,在学位分布上应用
igraph::fit_power_law
没有多大意义,因为学位分布在某种程度上已经是幂律了

但是,不要忘记,
igraph::fit\u power\u law
比implementation参数有更多的选项,这将导致不同的结果,这取决于您“给它喂食”的内容