rgraph(sna)
rgraph()所属R语言包:sna
Generate Bernoulli Random Graphs
生成伯努利随机图
译者:生物统计家园网 机器人LoveR
描述----------Description----------
rgraph generates random draws from a Bernoulli graph distribution, with various parameters for controlling the nature of the data so generated.
rgraph生成随机绘制从伯努利图分布,与各种参数的数据,以便生成用于控制的性质。
用法----------Usage----------
rgraph(n, m=1, tprob=0.5, mode="digraph", diag=FALSE, replace=FALSE,
tielist=NULL, return.as.edgelist=FALSE)
参数----------Arguments----------
参数:n
The size of the vertex set (|V(G)|) for the random graphs
随机图形的顶点集的大小(| V(G)|)
参数:m
The number of graphs to generate
的图形的数目,以产生
参数:tprob
Information regarding tie (edge) probabilities; see below
见下文有关领带(边缘)的概率;
参数:mode
“digraph” for directed data, “graph” for undirected data
定向数据“有向图”,“图”无向数据
参数:diag
Should the diagonal entries (loops) be set to zero?
如果对角线项(循环)设置为0?
参数:replace
Sample with or without replacement from a tie list (ignored if tielist==NULL
样品或不更换领带列表(如果tielist==NULL忽略
参数:tielist
A vector of edge values, from which the new graphs should be bootstrapped
的边缘值的向量,从该新的图表应自举
参数:return.as.edgelist
logical; should the resulting graphs be returned in edgelist form?
逻辑,生成的图表在EdgeList,在该列表的形式返回?
Details
详细信息----------Details----------
rgraph is a reasonably versatile routine for generating random network data. The graphs so generated are either Bernoulli graphs (graphs in which each edge is a Bernoulli trial, independent conditional on the Bernoulli parameters), or are bootstrapped from a user-provided edge distribution (very handy for CUG tests). In the latter case, edge data should be provided using the tielist argument; the exact form taken by the data is irrelevant, so long as it can be coerced to a vector. In the former case, Bernoulli graph probabilities are set by the tprob argument as follows: <ol> If tprob contains a single number, this number is used as the probability of all edges.
rgraph是一个合理的通用程序产生随机的网络数据。如此产生的图表是伯努利曲线图(图形中,每个边缘是一个伯努利试验的,独立的条件上的伯努利参数),或从一个用户提供的边缘分布(非常方便CUG测试)自举。在后者的情况下,边缘数据应提供使用tielist参数;数据所采取的确切形式是无关紧要的,只要它可以强制转换为一个向量。在前一种情况下,伯努利图概率tprob参数如下:<OL>如果tprob包含一个单一的数字,这个数字是所有边的概率。
If tprob contains a vector, each entry is assumed to correspond to a separate graph (in order). Thus, each entry is used as the probability of all edges within its corresponding graph.
如果tprob包含一个向量,每个条目都被假定为对应于一个单独的图形(按顺序)。因此,每个条目是用来作为其相应的曲线图内的所有边缘的概率。
If tprob contains a matrix, then each entry is assumed to correspond to a separate edge. Thus, each entry is used as the probability of its associated edge in each graph which is generated.
如果tprob包含一个矩阵,然后每个条目被假定为对应于一个单独的边缘。因此,每个条目被用作生成的每一个曲线图,这是在其相关联的边缘的概率。
Finally, if tprob contains a three-dimensional array, then each entry is assumed to correspond to a particular edge in a particular graph, and is used as the associated probability parameter. </ol>
最后,如果tprob包含的三维阵列,然后每个条目被假定为对应于在一个特定的图形的特定的边缘,并且被用作相关联的概率参数。 </ OL>
Finally, note that rgraph will symmetrize all generated networks if mode is set to “graph” by copying down the upper triangle. The lower half of tprob, where applicable, must still be specified, however.
最后,请注意,rgraph如果mode设置为“图”复制下来的上三角对称生成的所有网络。的下半部分tprob,在适用的情况下,仍然必须指定,但。
值----------Value----------
A graph stack
一个图形堆栈
注意----------Note----------
The famous mathematicians referenced in this man page now have misspelled names, due to R's difficulty with accent marks.
现在这名男子页面中引用的著名数学家有拼写错误的名字,由于R的带重音符号的难度。
(作者)----------Author(s)----------
Carter T. Butts <a href="mailto:buttsc@uci.edu">buttsc@uci.edu</a>
参考文献----------References----------
Erdos, P. and Renyi, A. (1960). “On the Evolution of Random Graphs.” Public Mathematical Institute of Hungary Academy of Sciences, 5:17-61.
Wasserman, S., and Faust, K. (1994). Social Network Analysis: Methods and Applications. Cambridge: Cambridge University Press.
参见----------See Also----------
rmperm, rgnm, rguman
rmperm,rgnm,rguman
实例----------Examples----------
#Generate three graphs with different densities[生成三个具有不同密度的图]
g<-rgraph(10,3,tprob=c(0.1,0.9,0.5))
#Generate from a matrix of Bernoulli parameters[从伯努利参数的矩阵生成]
g.p<-matrix(runif(25,0,1),nrow=5)
g<-rgraph(5,2,tprob=g.p)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|