[英]Plot power law fit to degree distribution in igraph
I created a directed graph 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)
This is four years after the fact, but I think this is probably what you want:这是事实发生四年后,但我认为这可能是你想要的:
# 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")
Created on 2022-01-29 by the reprex package (v2.0.0)由reprex 包于 2022-01-29 创建 (v2.0.0)
Given the p-value (in the list produced by the power.law.fit() function), the model is a plausible fit to the data.给定 p 值(在 power.law.fit() 函数生成的列表中),该模型对数据的拟合是合理的。 But, if I understand things correctly, you'd need to confirm this by comparing the fit to other kinds of distributions which might be a better fit.
但是,如果我理解正确,您需要通过将拟合与其他可能更合适的分布进行比较来确认这一点。 Not sure how to do this--but maybe this gets you a bit closer.
不知道该怎么做——但也许这会让你更接近一点。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.