跳到内容

predict_edges() 使用分层随机图模型来预测网络中缺失的边。这是通过对最优模型周围的分层模型进行抽样,并按其可能性比例进行抽样来实现的。如果给定 hrg()start 参数设置为 TRUE,则 MCMC 抽样从 hrg() 开始。否则,首先将 HRG 拟合到图中。

用法

predict_edges(
  graph,
  hrg = NULL,
  start = FALSE,
  num.samples = 10000,
  num.bins = 25
)

参数

graph

用于拟合模型的图。在有向图中,边方向将被忽略。

hrg

分层随机图模型,形式为 igraphHRG 对象。predict_edges() 允许此值为 NULL,然后首先从随机起点将 HRG 拟合到图中。

start

逻辑值,是否从提供的 igraphHRG 对象或从随机起点开始拟合/采样。

num.samples

用于共识生成或缺失边预测的样本数。

num.bins

边概率的箱数。提供更高的数字以获得更准确的预测。

一个包含以下条目的列表

edges

预测的边,以顶点 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).

参见

示例

if (FALSE) { # rlang::is_interactive()

## 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)
}