fit_hrg()
将 HRG 拟合到给定的图。它执行指定的 steps
数量的 MCMC 步骤进行拟合,或者如果指定的步骤数为零,则使用收敛标准。如果 hrg()
参数中给定了 HRG,并且 start
参数为 TRUE
,则 fit_hrg()
可以从给定的 HRG 开始。它可以使用此包中提供的 as.hclust()
转换为 hclust
类。
值
fit_hrg()
返回一个 igraphHRG
对象。这是一个包含以下成员的列表
- left
包含内部树顶点的左子节点的向量。第一个顶点始终是根顶点,因此向量的第一个元素是根顶点的左子节点。内部顶点用负数表示,从 -1 开始并向下,即根顶点为 -1。叶顶点用非负数表示,从零开始并向上。
- right
包含顶点的右子节点的向量,编码方式与
left
向量相同。- prob
附加到内部顶点的连接概率,第一个数字属于根顶点(即内部顶点 -1),第二个数字属于内部顶点 -2,依此类推。
- edges
给定内部顶点下方子树中的边数。
- vertices
给定内部顶点下方子树中的顶点数,包括其自身。
参考文献
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()
, hrg()
, hrg-methods
, hrg_tree()
, predict_edges()
, print.igraphHRG()
, print.igraphHRGConsensus()
, sample_hrg()
示例
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
summary(as.hclust(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)
}