rperm(sna)
rperm()所属R语言包:sna
Draw a Random Permutation Vector with Exchangeability Constraints
绘制一个随机置换向量的互换性约束
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Draws a random permutation on 1:length(exchange.list) such that no two elements whose corresponding exchange.list values are different are interchanged.
绘制一个随机置换1:length(exchange.list)如exchange.list的值是不同的,其相应的没有两个元素互换。
用法----------Usage----------
rperm(exchange.list)
参数----------Arguments----------
参数:exchange.list
A vector such that the permutation vector may exchange the ith and jth positions iff exchange.list[i]==exchange.list[j]
这样一个向量,置换矢量可以交换第i个和第j个位置,当且仅当exchange.list[i]==exchange.list[j]
Details
详细信息----------Details----------
rperm draws random permutation vectors given the constraints of exchangeability described above. Thus, rperm(c(0,0,0,0)) returns a random permutation of four elements in which all exchanges are allowed, while rperm(c(1,1,"a","a") (or similar) returns a random permutation of four elements in which only the first/second and third/fourth elements may be exchanged. This turns out to be quite useful for searching permutation spaces with exchangeability constraints (e.g., for structural distance estimation).
rperm绘制给定的约束上述的可交换性的随机排列向量。因此,rperm(c(0,0,0,0))返回一个随机排列的四个要素中,允许所有交易所,而rperm(c(1,1,"a","a")(或类似)返回一个随机排列的四个要素中,只有第一/第二和第三/第四个元素可以交换。这将是非常有用的搜索排列空间的可交换性约束(例如,结构距离估计)。
值----------Value----------
A random permutation vector satisfying the given constraints
随机置换矢量满足给定的约束条件
(作者)----------Author(s)----------
Carter T. Butts <a href="mailto:buttsc@uci.edu">buttsc@uci.edu</a>
参见----------See Also----------
rmperm
rmperm
实例----------Examples----------
rperm(c(0,0,0,0)) #All elements may be exchanged[可以交换的所有元素]
rperm(c(0,0,0,1)) #Fix the fourth element[修正的第四个元素]
rperm(c(0,0,1,1)) #Allow {1,2} and {3,4} to be swapped[允许{1,2},{3,4}被换]
rperm(c("a",4,"x",2)) #Fix all elements (the identity permutation)[修复所有元素(身份置换)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|