hdist(sna)
hdist()所属R语言包:sna
Find the Hamming Distances Between Two or More Graphs
查找两个或多个图形之间的海明距离
译者:生物统计家园网 机器人LoveR
描述----------Description----------
hdist returns the Hamming distance between the labeled graphs g1 and g2 in set dat for dichotomous data, or else the absolute (manhattan) distance. If normalize is true, this distance is divided by its dichotomous theoretical maximum (conditional on |V(G)|).
hdist返回标记图形之间的海明距离g1和g2中集dat二分类数据,否则绝对(曼哈顿)的距离。 normalize如果是真实的,这个距离除以它的二分理论最大值(条件| V(G)|)。
用法----------Usage----------
hdist(dat, dat2=NULL, g1=NULL, g2=NULL, normalize=FALSE,
diag=FALSE, mode="digraph")
参数----------Arguments----------
参数:dat
a stack of input graphs.
输入图堆栈。
参数:dat2
a second graph stack (optional).
第二个图形堆栈(可选)。
参数:g1
a vector indicating which graphs to compare (by default, all elements of dat).
向量图来比较(默认情况下,所有的元素dat)。
参数:g2
a vector indicating against which the graphs of g1 should be compared (by default, all graphs).
一个矢量的图形g1应比较(默认情况下,所有的图形)。
参数:normalize
divide by the number of available dyads?
可用的二价基的数目除以?
参数:diag
boolean indicating whether or not the diagonal should be treated as valid data. Set this true if and only if the data can contain loops. diag is FALSE by default.
布尔值,表示是否对角线应被视为有效的数据。设置这是真的,当且仅当数据可以包含循环。 diag是FALSE默认情况下。
参数:mode
string indicating the type of graph being evaluated. "digraph" indicates that edges should be interpreted as directed; "graph" indicates that edges are undirected. mode is set to "digraph" by default.
的图表类型的字符串,表示正在评估中。表明边缘应被解释为指示“有向图”,“图形”表明边缘是无向。 mode设置为默认情况下,“有向图”。
Details
详细信息----------Details----------
The Hamming distance between two labeled graphs G_1 and G_2 is equal to |{e : (e in E(G_1) and e not in E(G_2)) or (e not in E(G_1) and e in E(G_2))}|. In more prosaic terms, this may be thought of as the number of addition/deletion operations required to turn the edge set of G_1 into that of G_2. The Hamming distance is a highly general measure of structural similarity, and forms a metric on the space of graphs (simple or directed). Users should be reminded, however, that the Hamming distance is extremely sensitive to nodal labeling, and should not be employed directly when nodes are interchangeable. The structural distance (Butts and Carley (2001)), implemented in structdist, provides a natural generalization of the Hamming distance to the more general case of unlabeled graphs.
之间的海明距离两个标记图形G_1和G_2等于|{e : (e in E(G_1) and e not in E(G_2)) or (e not in E(G_1) and e in E(G_2))}|。更平淡的条件,这可以被认为是所需的添加/删除操作的数目转动的边缘设置G_1到G_2。的汉明距离是一个高度的通用性的措施的结构相似性,并形成了一个度量的空间上的曲线图(简单或定向)。然而,用户应该被提醒,的汉明距离是极为敏感的节点的标记,并且不应该被直接聘用当节点是可以互换的。的结构的距离(Butts和卡利(2001)),实现在structdist,提供了一种自然的泛化的汉明距离的更一般的情况下的未标记的图。
Null hypothesis testing for Hamming distances is available via cugtest, and qaptest; graphs which minimize the Hamming distances to all members of a graph set can be found by centralgraph. For an alternative means of comparing the similarity of graphs, consider gcor.
海明距离的零假设测试是可以通过cugtest,qaptest图的海明距离最小化的图形组的所有成员,可以发现centralgraph。图的相似性比较的另一途径,考虑gcor。
值----------Value----------
A matrix of Hamming distances
海明距离的矩阵
注意----------Note----------
For non-dichotomous data, the distance which is returned is simply the sum of the absolute edge-wise differences.
对于非二分数据,则返回的距离,该距离仅仅是边缘方向的绝对差异的总和。
(作者)----------Author(s)----------
Carter T. Butts <a href="mailto:buttsc@uci.edu">buttsc@uci.edu</a>
参考文献----------References----------
Banks, D., and Carley, K.M. (1994). “Metric Inference for Social Networks.” Journal of Classification, 11(1), 121-49.
Butts, C.T. and Carley, K.M. (2005). “Some Simple Algorithms for Structural Comparison.” Computational and Mathematical Organization Theory, 11(4), 291-305.
Butts, C.T., and Carley, K.M. (2001). “Multivariate Methods for Interstructural Analysis.” CASOS Working Paper, Carnegie Mellon University.
Hamming, R.W. (1950). “Error Detecting and Error Correcting Codes.” Bell System Technical Journal, 29, 147-160.
参见----------See Also----------
sdmat, structdist
sdmat,structdist
实例----------Examples----------
#Get some random graphs[一些随机图]
g<-rgraph(5,5,tprob=runif(5,0,1))
#Find the Hamming distances[汉明距]
hdist(g)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|