[英]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.