如果您从 R 中使用 igraph,请使用此选项
predict_edges {igraph} | R 文档 |
predict_edges
使用分层随机图模型来预测网络中缺失的边。这是通过对最优模型周围的分层模型进行抽样,并按其似然性成比例地进行抽样来实现的。如果给定了 hrg
且 start
参数设置为 TRUE
,则从 hrg
开始 MCMC 抽样。否则,首先将 HRG 拟合到图中。
predict_edges(
graph,
hrg = NULL,
start = FALSE,
num.samples = 10000,
num.bins = 25
)
图 |
拟合模型的图。在有向图中,边方向将被忽略。 |
hrg |
分层随机图模型,以 |
开始 |
逻辑值,指示是否从提供的 |
num.samples |
用于共识生成或缺失边预测的样本数量。 |
num.bins |
边概率的箱子数量。为了获得更准确的预测,请提供更高的数字。 |
包含以下条目的列表
边 |
预测的边,以顶点 ID 的两列矩阵形式。 |
prob |
根据拟合模型,这些边的概率。 |
hrg |
(提供或拟合的)分层随机图模型。 |
A. Clauset, C. Moore, and M.E.J. Newman. Hierarchical structure and the prediction of missing links in networks. Nature 453, 98–101 (2008);
A. Clauset, C. Moore, and M.E.J. Newman. Structural Inference of Hierarchies in Networks. In E. M. Airoldi et al. (Eds.): ICML 2006 Ws, Lecture Notes in Computer Science 4503, 1–13. Springer-Verlag, Berlin Heidelberg (2007).
其他分层随机图函数:consensus_tree()
, fit_hrg()
, hrg-methods
, hrg_tree()
, hrg()
, print.igraphHRGConsensus()
, print.igraphHRG()
, sample_hrg()
## We are not running these examples any more, because they
## take a long time (~15 seconds) to run and this is against the CRAN
## repository policy. Copy and paste them by hand to your R prompt if
## you want to run them.
## Not run:
## A graph with two dense groups
g <- sample_gnp(10, p=1/2) + sample_gnp(10, p=1/2)
hrg <- fit_hrg(g)
hrg
## The consensus tree for it
consensus_tree(g, hrg=hrg, start=TRUE)
## Prediction of missing edges
g2 <- make_full_graph(4) + (make_full_graph(4) - path(1,2))
predict_edges(g2)
## End(Not run)