繁体   English   中英

在 igraph 中绘制幂律拟合度分布

[英]Plot power law fit to degree distribution in igraph

我在 igraph 中创建了一个有向图,

ba_game_graph <- sample_pa(10000, power = 1, m = NULL, out.dist = NULL, out.seq = NULL,
  out.pref = FALSE, zero.appeal = 1, directed = TRUE,
  algorithm = c("psumtree"), start.graph = NULL)

这是事实发生四年后,但我认为这可能是你想要的:

# plot the degree distribution on a log-log plot
plot(ba_game_deg_dist_tot,
     log = "xy",
     xlab = "Node Degree",
     ylab = "Probability")

# add the fitted power law line; the exponent value comes from alpha, part of
# the output of the fit.power.law() function. 
lines(seq(ba_game_deg_dist_tot), 
      seq(ba_game_deg_dist_tot)^-ba_game_plaw$alpha, 
      col="#b00606")

reprex 包于 2022-01-29 创建 (v2.0.0)

给定 p 值(在 power.law.fit() 函数生成的列表中),该模型对数据的拟合是合理的。 但是,如果我理解正确,您需要通过将拟合与其他可能更合适的分布进行比较来确认这一点。 不知道该怎么做——但也许这会让你更接近一点。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM