找回密码
 注册
查看: 326|回复: 0

R语言 sna包 kpath.census()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 10:55:35 | 显示全部楼层 |阅读模式
kpath.census(sna)
kpath.census()所属R语言包:sna

                                         Compute Path or Cycle Census Information
                                         计算路径或循环普查信息

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

kpath.census and kcycle.census compute k-path or k-cycle census statistics (respectively) on one or more input graphs.  In addition to aggregate counts of paths or cycles, results may be disaggregated by vertex and co-membership information may be computed.
kpath.census和kcycle.census计算k路径或k周期人口普查的统计数据(分别)在一个或多个输入图。除了聚集路径或循环计数,结果可能会分列的顶点,合作成员的信息,可以计算。


用法----------Usage----------


kcycle.census(dat, maxlen = 3, mode = "digraph",
    tabulate.by.vertex = TRUE, cycle.comembership = c("none", "sum",
    "bylength"))

kpath.census(dat, maxlen = 3, mode = "digraph",
    tabulate.by.vertex = TRUE, path.comembership = c("none", "sum",
    "bylength"), dyadic.tabulation = c("none", "sum", "bylength"))



参数----------Arguments----------

参数:cycle.comembership
the type of cycle co-membership information to be tabulated, if any.  "sum" returns a vertex by vertex matrix of cycle co-membership counts; these are disaggregated by cycle length if "bylength" is used.  If "none" is given, no co-membership information is computed.
循环合作的成员资格信息的类型被列成表格,如果有的话。 "sum"返回一个顶点顶点循环矩阵的会员数,这些分列"bylength"使用周期长。 "none"如果,没有合作成员的信息计算。


参数:dat
one or more input graphs.
一个或多个输入图表。


参数:maxlen
the maximum path/cycle length to evaluate.
最大路径/周期长度来评价。


参数:mode
"digraph" for directed graphs, or "graph" for undirected graphs.
"digraph"对于有向图,或"graph"无向图。


参数:tabulate.by.vertex
logical; should path or cycle incidence counts be tabulated by vertex?
逻辑,路径或周期的发病数列的顶点吗?


参数:path.comembership
as per cycle.comembership, for paths rather than cycles.  
每cycle.comembership,路径,而不是周期。


参数:dyadic.tabulation
the type of dyadic path count information to be tabulated, if any.  "sum" returns a vertex by vertex matrix of source/destination path counts, while "bylength" disaggregates these counts by path length.  Selecting "none" disables this computation.
二元路径数的类型信息的汇总,如果有的话。 "sum"返回一个顶点顶点矩阵源/目标路径计数,而"bylength"解体这些路径长度计数。选择"none"禁用此计算。


Details

详细信息----------Details----------

There are several equivalent characterizations of paths and cycles, of which the following is one example.  For an arbitrary graph G, a path is a sequence of distinct vertices v_1, v_2, .... v_n and included edges such that v_i is adjacent to v_{i+1} for all i in 1, 2, ... k-1 via the pair's included edge. (Contrast this with a walk, in which edges and/or vertices may be repeated.)  A cycle is the union of a path and an edge making v_n adjacent to v_i.  k-paths and k-cycles are respective paths and cycles having k edges (in the former case) or k vertices (in the latter).  The above definitions may be applied in both directed and undirected contexts, by substituting the appropriate notion of adjacency.  (Note that authors do not always employ the same terminology for these concepts, especially in older texts – it is wise to verify the definitions being used in any particular context.)
有几种等价刻画的路径和周期,其中以下是一个例子。对于任意一个图G,路径是不同的顶点序列v_1, v_2, .... v_n和这样的边缘v_i是毗邻v_{i+1}的为所有的i in 1, 2, ... k-1通过对包括边缘。 (与此相比,散步,边和/或顶点可能会重复。)周期是工会的路径和边缘v_nv_i附近。 k-路径和k周期是具有k边缘(在前者的情况下)或k顶点(在后者)的各自的路径和周期。上述定义中可以施加在定向和无向的情况下,通过代以相应的邻接的概念。 (请注意,作者不总是使用相同的术语,这些概念,尤其是在早期的文本 - 这是明智的做法,以验证在任何特定的情况下被使用的定义。)

A subgraph census statistic is a function which, for any given graph and subgraph, gives the number of copies of the latter contained in the former.  A collection of subgraph census statistics is referred to as a subgraph census; widely used examples include the dyad and triad censuses, implemented in sna by the dyad.census and triad.census functions (respectively).  kpath.census and kcycle.census compute a range of census statistics related to k-paths and k-cycles, including:
甲的子图人口普查统计是一个函数,其中,对于任何给定的图和子图,给出后者包含在前者的副本的数目。被称为集合的子人口普查统计作为子普查;广泛使用的例子包括对子和黑社会普查,实施的snadyad.census和triad.census函数(分别)。 kpath.census和kcycle.census计算范围的普查统计k路径和k周期,包括:




Aggregate counts of paths/cycles by length (i.e., k).  
总数的路径/周期长度(即k“)。

Counts of paths/cycles to which each vertex belongs (when tabulate.byvertex==TRUE).  
路径/周期计数,每个顶点属于(当tabulate.byvertex==TRUE)。

Counts of path/cycle co-memberships, potentially disaggregated by length (when the appropriate co-membership argument is set to bylength).  
计数的路径/周期合作会员资格,可能会分列的长度(当适当的合作成员的参数设置为bylength)。

For path.census, counts of the total number of paths from each vertex to each other vertex, possibly disaggregated by length (if dyadic.tabulation=="bylength"). </ul>
对于path.census,计数的总数的路径从每个顶点彼此的顶点,可能分列的长度(如果dyadic.tabulation=="bylength")。 </ ul>

The length of the maximum-length path/cycle to compute is given by maxlen.  These calculations are intrinsically expensive (path/cycle computation is NP complete in the general case), and users should hence be wary when increasing maxlen.  On the other hand, it may be possible to enumerate even long paths or cycles on a very sparse graph; scaling is approximately c^k, where k is given by maxlen and c is the size of the largest dense cluster.  
的长度的最大长度的路径/周期的计算由下式给出maxlen。这些计算本质上是价格昂贵的(路径/周期的计算是NP完全在一般情况下),用户应该因此增加maxlen警惕。另一方面,它可能是长的路径或循环一个非常稀疏图上可以列举比例是约c^k,其中kmaxlen和c的,是最大的致密星团的大小。

The paths or cycles computed by this function are directed if mode=="digraph", or undirected if mode=="graph".  Failing to set mode correctly may result in problematic behavior.
由这个函数计算的路径或循环指示如果如果mode=="digraph",或无向mode=="graph"。未按规定mode正确,可能会导致错误的行为。


值----------Value----------

For kpath.census, a list with the following elements: <table summary="R valueblock"> <tr valign="top"><td>path.count </td> <td> If tabulate.byvertex==FALSE, a vector of aggregate counts by path length.  Otherwise, a matrix whose first column is a vector of aggregate path counts, and whose succeeding columns contain vectors of path counts for each vertex.</td></tr> <tr valign="top"><td>path.comemb </td> <td> If path.comembership!="none", a matrix or array containing co-membership in paths by vertex pairs.  If path.comembership=="sum", only a matrix of co-memberships is returned; if bylength is used, however, co-memberships are returned in a maxlen by n by n array whose i,j,kth cell is the number of paths of length i containing j and k.</td></tr> <tr valign="top"><td>paths.bydyad </td> <td> If dyadic.tabulation!="none", a matrix or array containing the number of paths originating at a particular vertex and terminating.  If bylength is used, dyadic path counts are supplied via a maxlen by n by n array whose i,j,kth cell is the number of paths of length i starting at j and ending with k.  If sum is used instead, only a matrix whose i,j cell contains the total number of paths from i to j is returned.</td></tr>
对于kpath.census,列表中包含下列元素:<table summary="R valueblock"> <tr valign="top"> <TD> path.count  </ TD> <TD>如果<X >,一个向量的总路径长度计数。否则,一个矩阵,它的第一列是一个向量总路径计数,并且其随后的列包含为每个顶点的路径数的矢量。</ TD> </ TR> <tr valign="top"> <TD><X > </ TD> <TD>如果tabulate.byvertex==FALSE,矩阵或数组,包含路径中的顶点对合作成员。如果如果path.comemb ,只有一个矩阵返回的合作会籍; path.comembership!="none"使用,但是,合作成员身份返回在一个path.comembership=="sum"的bylength<X >数组,其maxlenTh单元的数量路径的长度n包含n和i,j,k。</ TD> </ TR> <TR VALIGN =“顶“> <TD>i</运输署”<td>如果j,一个矩阵或数组,包含在一个特定的顶点和终端始发的路径的数目。如果k使用,二元路径数是通过提供一个paths.bydyad dyadic.tabulation!="none"bylength阵列的maxlenTh单元路径的长度是多少nn和结束与i,j,k。如果i使用,而只是一个矩阵,它的j单元格包含的路径总数从ksum返回。</ TD> </ TR>

</table> For kcycle.census, a similar list: <table summary="R valueblock"> <tr valign="top"><td>cycle.count </td> <td> If tabulate.byvertex==FALSE, a vector of aggregate counts by cycle length.  Otherwise, a matrix whose first column is a vector of aggregate cycle counts, and whose succeeding columns contain vectors of cycle counts for each vertex.</td></tr> <tr valign="top"><td>cycle.comemb </td> <td> If cycle.comembership!="none", a matrix or array containing co-membership in cycles by vertex pairs.  If cycle.comembership=="sum", only a matrix of co-memberships is returned; if bylength is used, however, co-memberships are returned in a maxlen by n by n array whose i,j,kth cell is the number of cycles of length i containing j and k.</td></tr>
</ TABLE>kcycle.census,一个类似的列表:<table summary="R valueblock"> <tr valign="top"> <TD> cycle.count </ TD> <TD>如果tabulate.byvertex==FALSE,矢量总周期长度计数。否则,矩阵的第一列是一个向量,总的周期数,其成功的列中包含的周期计数为每个顶点的向量。</ TD> </ TR> <tr valign="top"> <TD><X > </ TD> <TD>如果cycle.comemb ,矩阵或数组,包含成员在周期顶点对。如果如果cycle.comembership!="none",只有一个矩阵返回的合作会籍; cycle.comembership=="sum"使用,但是,合作成员身份返回在一个bylength的maxlen<X >数组,其nTh单元周期的长度是多少n包含i,j,k和i。</ TD> </ TR>

</table>
</ TABLE>


警告----------Warning ----------

The computational cost of calculating paths and cycles grows very sharply in both maxlen and network density.  Be wary of setting maxlen greater than 5-6, unless you know what you are doing.  Otherwise, the expected completion time for your calculation may exceed your life expectancy (and those of subsequent generations).
在这两个maxlen和网络密度的计算成本,计算路径和周期的增长非常尖锐。小心设置maxlen大于5-6,除非你知道你在做什么。否则你的计算,预计竣工时间可能会超过你的预期寿命(后代)。


(作者)----------Author(s)----------


Carter T. Butts <a href="mailto:buttsc@uci.edu">buttsc@uci.edu</a>



参考文献----------References----------

Butts, C.T.  (2006).  &ldquo;Cycle Census Statistics for Exponential Random Graph Models.&rdquo;  IMBS Technical Report MBS 06-05, University of California, Irvine.
West, D.B.  (1996).  Introduction to Graph Theory.  Upper Saddle River, N.J.: Prentice Hall.

参见----------See Also----------

dyad.census, triad.census, clique.census, geodist
dyad.census,triad.census,clique.census,geodist


实例----------Examples----------


g<-rgraph(20,tp=1.5/19)

#Obtain paths by vertex, with dyadic path counts[获取路径的顶点,二元路径数]
pc<-kpath.census(g,maxlen=5,dyadic.tabulation="sum")
pc$path.count                                 #Examine path counts[检查路径计数]
pc$paths.bydyad                               #Examine dyadic paths[检查二元路径]

#Obtain aggregate cycle counts, with co-membership by length[获得总周期数,成员的长度与合作]
cc<-kcycle.census(g,maxlen=5,tabulate.by.vertex=FALSE,
    cycle.comembership="bylength")
cc$cycle.count                             #Examine cycle counts[检查的周期数]
cc$cycle.comemb[1,,]                       #Co-membership for 2-cycles[会员2周期]
cc$cycle.comemb[2,,]                       #Co-membership for 3-cycles[合作成员3周期]
cc$cycle.comemb[3,,]                       #Co-membership for 4-cycles[会员4周期]

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-6-8 13:12 , Processed in 0.051041 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表