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

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

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

                                         Butts' (Hierarchical) Bayesian Network Accuracy Model
                                         巴茨(分层)贝叶斯网络精度模型

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

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

Takes posterior draws from Butts' bayesian network accuracy/estimation model for multiple participant/observers (conditional on observed data and priors), using a Gibbs sampler.
采取后吸引了来自巴茨的多个参加者/观察员有条件的观测数据和先验的贝叶斯网络的精确度/估算模型,使用Gibbs采样。


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


bbnam(dat, model="actor", ...)
bbnam.fixed(dat, nprior=0.5, em=0.25, ep=0.25, diag=FALSE,
    mode="digraph", draws=1500, outmode="draws", anames=NULL,
    onames=NULL)
bbnam.pooled(dat, nprior=0.5, emprior=c(1,11), epprior=c(1,11),
    diag=FALSE, mode="digraph", reps=5, draws=1500, burntime=500,
    quiet=TRUE, anames=NULL, onames=NULL, compute.sqrtrhat=TRUE)
bbnam.actor(dat, nprior=0.5, emprior=c(1,11), epprior=c(1,11),
    diag=FALSE, mode="digraph", reps=5, draws=1500, burntime=500,
    quiet=TRUE, anames=NULL, onames=NULL, compute.sqrtrhat=TRUE)



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

参数:dat
Input networks to be analyzed.  This may be supplied in any reasonable form, but must be reducible to an array of dimension m x n x n, where n is |V(G)|, the first dimension indexes the observer (or information source), the second indexes the sender of the relation, and the third dimension indexes the recipient of the relation.  (E.g., dat[i,j,k]==1 implies that i observed j sending the relation in question to k.)  Note that only dichotomous data is supported at present, and missing values are permitted; the data collection pattern, however, is assumed to be ignorable, and hence the posterior draws are implicitly conditional on the observation pattern.
输入网络,以进行分析。这可以在任何合理的方式提供,但必须还原到一个数组的尺寸m x n x n,这里n是|V(G)|,第一个维度指标观察者(或信息源),第二索引的发送者的关系,和在第三个维度指标的关系的收件人。 (例如,dat[i,j,k]==1意味着我观察发送问题到k的关系,在Ĵ。)注意,只有二分数据的支持,目前,失踪的允许值的数据收集模式,但是,被认为是忽略不计,因此,后路绘制是隐式条件的观察模式。


参数:model
String containing the error model to use; options are "actor", "pooled", and "fixed".
String,其中包含的误差模型使用;选项"actor","pooled"和"fixed"。


参数:...
Arguments to be passed by bbnam to the particular model method.
通过bbnam的特定模型的方法的参数。


参数:nprior
Network prior matrix.  This must be a matrix of dimension n x n, containing the arc/edge priors for the criterion network.  (E.g., nprior[i,j] gives the prior probability of i sending the relation to j in the criterion graph.)  Non-matrix values will be coerced/expanded to matrix form as appropriate.  If no network prior is provided, an uninformative prior on the space of networks will be assumed (i.e., Pr(i->j)=0.5).  Missing values are not allowed.
之前网络矩阵。这必须是一个矩阵的维nXn,包含弧/边缘先验的标准网络。 (例如,nprior[i,j]的i发送的关系j,的标准图中给出的先验概率。),非矩阵值将被强制转换/扩展到适当的矩阵形式。如果没有网络之前,网络空间的无信息先验的假设(即,Pr(i->j)=0.5)。遗漏值是不允许的。


参数:em
Probability of a false negative; this may be in the form of a single number, one number per observation slice, one number per (directed) dyad, or one number per dyadic observation (fixed model only).
概率的假阴性,这可能是一个单一的数字的形式,观察切片的每一个数字,每一个数字(定向)对子,或一个数字每矢观察(固定的模式)。


参数:ep
Probability of a false positive; this may be in the form of a single number, one number per observation slice, one number per (directed) dyad, or one number per dyadic observation (fixed model only).
概率的假阳性,这可能是一个单一的数字的形式,观察切片的每一个数字,每一个数字(定向)对子,或一个数字每矢观察(固定的模式)。


参数:emprior
Parameters for the (Beta) false negative prior; these should be in the form of an (alpha,beta) pair for the pooled model, and of an n x 2 matrix of (alpha,beta) pairs for the actor model (or something which can be coerced to this form). If no emprior is given, a weakly informative prior (1,11) will be assumed; note that this may be inappropriate, as described below.  Missing values are not allowed.
(测试版)假阴性之前,这些应该是一个(alpha,beta)的集中模式对的形式,和n x 2矩阵(alpha,beta)对角色的模型(参数或可以强制转换为这种形式的东西)。如果没有emprior给出,弱信息先验(1,11)将假设注意,这可能是不适当的,如下所述。遗漏值是不允许的。


参数:epprior
Parameters for the (Beta) false positive prior; these should be in the form of an (alpha,beta) pair for the pooled model, and of an n x 2 matrix of (alpha,beta) pairs for the actor model (or something which can be coerced to this form). If no epprior is given, a weakly informative prior (1,11) will be assumed; note that this may be inappropriate, as described below.  Missing values are not allowed.
(测试版)假阳性前,这应该是一个(alpha,beta)的集中模式对的形式,和n x 2矩阵(alpha,beta)对角色的模型(参数或可以强制转换为这种形式的东西)。如果没有epprior给出,弱信息先验(1,11)将假设注意,这可能是不适当的,如下所述。遗漏值是不允许的。


参数:diag
Boolean indicating whether loops (matrix diagonals) should be counted as data.
布尔值,指示是否循环(矩阵对角线),应算作数据。


参数:mode
A string indicating whether the data in question forms a "graph" or a "digraph"
一个字符串,指示是否有问题的数据,形成一个"graph"或"digraph"


参数:reps
Number of replicate chains for the Gibbs sampler (pooled and actor models only).
Gibbs抽样的复制链(池和演员机型)。


参数:draws
Integer indicating the total number of draws to take from the posterior distribution.  Draws are taken evenly from each replication (thus, the number of draws from a given chain is draws/reps).
总数的整数,表示即将采取的后验分布。绘制被均匀地从每个复制(因此,利用从一个给定的链的数目是借助/销售代表)。


参数:burntime
Integer indicating the burn-in time for the Markov Chain.  Each replication is iterated burntime times before taking draws (with these initial iterations being discarded); hence, one should realize that each increment to burntime increases execution time by a quantity proportional to reps. (pooled and actor models only)
整数,表示燃烧时间的马尔可夫链。 ,每个复制迭代burntime前以期(这些被丢弃的初始迭代),因此,我们应该认识到,每个增量到burntime增加了执行时间的数量比例代表。 (汇集和演员机型)


参数:quiet
Boolean indicating whether MCMC diagnostics should be displayed (pooled and actor models only).
布尔值,指示是否MCMC的诊断应显示(汇集和演员机型)。


参数:outmode
posterior indicates that the exact posterior probability matrix for the criterion graph should be returned; otherwise draws from the joint posterior are returned instead (fixed model only).
posterior表示,确切的后验概率矩阵的标准图,应返回,否则吸引了来自联合后返回,而不是(只有固定的模式)。


参数:anames
A vector of names for the actors (vertices) in the graph.
一个向量的演员(顶点),图中的名称。


参数:onames
A vector of names for the observers (possibly the actors themselves) whose reports are contained in the input data.
观察员(可能演员本身),其都包含在所输入的数据的报告的名称的向量。


参数:compute.sqrtrhat
A boolean indicating whether or not Gelman et al.'s potential scale reduction measure (an MCMC convergence diagnostic) should be computed (pooled and actor models only).
应计算一个布尔值,指示是否吉尔曼等。的潜在规模削减措施(MCMC的收敛诊断)(汇集和演员机型)。


Details

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

The bbnam models a set of network data as reflecting a series of (noisy) observations by a set of participants/observers regarding an uncertain criterion structure.  Each observer is assumed to send false positives (i.e., reporting a tie when none exists in the criterion structure) with probability e^+, and false negatives (i.e., reporting that no tie exists when one does in fact exist in the criterion structure) with probability e^-.  The criterion network itself is taken to be a Bernoulli (di)graph.  Note that the present model includes three variants:
bbnam一组网络数据模型反映了一系列的(噪音)观察一组参加者/观察员就一个不确定的标准结构。每一个观察员,假定发送误报(即,报告打领带的时候没有存在的标准结构)的概率e^+,和假阴性(即报告说,不打领带时的确存在的标准结构)的概率e^-。采取标准网络本身是一个伯努利(二)图。请注意,该模型包括三个变种:

<ol> Fixed error probabilities: Each edge is associated with a known pair of false negative/false positive error probabilities (provided by the researcher).  In this case, the posterior for the criterion graph takes the form of a matrix of Bernoulli parameters, with each edge being independent conditional on the parameter matrix.
<OL>固定误差概率:与公知的假阴性/假阳性错误的概率(研究者提供的)对每个边缘关联。在这种情况下,后侧为标准图伯努利参数的矩阵的形式,与每个边缘是独立条件参数矩阵。




Pooled error probabilities: One pair of (uncertain) false negative/false positive error probabilities is assumed to hold for all observations.  Here, we assume that the researcher's prior information regarding these parameters can be expressed as a pair of Beta distributions, with the additional assumption of independence in the prior distribution.  Note that error rates and edge probabilities are not independent in the joint posterior, but the posterior marginals take the form of Beta mixtures and Bernoulli parameters, respectively.
汇集错误概率:一对(不确定)的假阴性/假阳性错误的概率假定持有的所有观测值。在这里,我们假设研究者的先验信息,对于这些参数可以被表示为一个对beta版,额外的独立性假设的先验分布。请注意,错误率和边缘概率不是独立的联合后验,但后的勉强采取的Beta混合物的形式和伯努利参数,分别为。




Per observer (``actor'') error probabilities: One pair of (uncertain) false negative/false positive error probabilities is assumed to hold for each observation slice.  Again, we assume that prior knowledge can be expressed in terms of independent Beta distributions (along with the Bernoulli prior for the criterion graph) and the resulting posterior marginals are Beta mixtures and a Bernoulli graph.  (Again, it should be noted that independence in the priors does not imply independence in the joint posterior!) </ol>
每观察员(“演员”)的错误概率:一对(不确定)的假阴性/假阳性错误的概率被假定为保持每观察切片。同样,我们假定先验知识可以表示在独立Beta值分布(沿与伯努利之前的标准图)和所得后的勉强Beta值的混合物和一个伯努利图。 (同样,应注意的是,独立先验并不意味着独立的联合后验!)</醇>

By default, the bbnam routine returns (approximately) independent draws from the joint posterior distribution, each draw yielding one realization of the criterion network and one collection of accuracy parameters (i.e., probabilities of false positives/negatives).  This is accomplished via a Gibbs sampler in the case of the pooled/actor model, and by direct sampling for the fixed probability model. In the special case of the fixed probability model, it is also possible to obtain directly the posterior for the criterion graph (expressed as a matrix of Bernoulli parameters); this can be controlled by the outmode parameter.
默认情况下,bbnam例程返回(大约)独立吸引了来自联合后验分布,每次抽奖产生一个实现标准网络和精度参数(即假阳性/阴性的概率)的一个集合。这是通过一个Gibbs采样的情况下,汇集/演员模型,并通过直接采样固定的概率模型。在固定的概率模型的特殊情况下,它也可以直接获得的标准曲线图(伯努利参数作为一个矩阵来表示)的后验,这可以通过以下来控制outmode参数。

As noted, the taking of posterior draws in the nontrivial case is accomplished via a Markov Chain Monte Carlo method, in particular the Gibbs sampler; the high dimensionality of the problem (O(n^2+2n)) tends to preclude more direct approaches.  At present, chain burn-in is determined ex ante on a more or less arbitrary basis by specification of the burntime parameter.  Eventually, a more systematic approach will be utilized.  Note that insufficient burn-in will result in inaccurate posterior sampling, so it's not wise to skimp on burn time where otherwise possible.  Similarly, it is wise to employ more than one Markov Chain (set by reps), since it is possible for trajectories to become &ldquo;trapped&rdquo; in metastable regions of the state space.  Number of draws per chain being equal, more replications are usually better than few; consult Gelman et al. for details.  A useful measure of chain convergence, Gelman and Rubin's potential scale reduction (&radic;{\hat{R}}), can be computed using the compute.sqrtrhat parameter.  The potential scale reduction measure is an ANOVA-like comparison of within-chain versus between-chain variance; it approaches 1 (from above) as the chain converges, and longer burn-in times are strongly recommended for chains with scale reductions in excess of 1.2 or thereabouts.  
如前所述,录取后得出的马尔可夫链蒙特卡罗方法,特别是Gibbs采样的高维数问题(O(n^2+2n))倾向于排除更多直接的方法是通过在平凡的情况下。目前,链燃烧中被确定事前burntime参数规范上的更多或更少的任意的基础。最后,更系统的方法予以确认。请注意,没有足够的老化会导致后采样不准确,所以它不是明智的,吝啬的燃烧时间,否则可能。同样,明智的做法是采用一个以上的马尔可夫链(在reps),因为它有可能成为“困”在亚稳区的状态空间轨迹。的绘制都是平等的,每个链的复制通常比一些咨询吉尔曼等。了解详细信息。一个有用的方法,链衔接,Gelman和鲁宾的潜在规模减少(&radic;{\hat{R}}),可以计算出使用compute.sqrtrhat参数。的潜在规模,减少测量的内链与链之间的方差是方差分析的比较接近1(以上)的链收敛,以及更长的老化时间,强烈建议链规模减少超过1.2左右。

Finally, a cautionary concerning prior distributions: it is important that the specified priors actually reflect the prior knowledge of the researcher; otherwise, the posterior will be inadequately informed.  In particular, note that an uninformative prior on the accuracy probabilities implies that it is a priori equally probable that any given actor's observations will be informative or negatively informative (i.e., that i observing j sending a tie to k reduces Pr(j->k)).  This is a highly unrealistic assumption, and it will tend to produce posteriors which are bimodal (one mode being related to the &ldquo;informative&rdquo; solution, the other to the &ldquo;negatively informative&rdquo; solution).  Currently, the default error parameter prior is Beta(1,11), which is both diffuse and which renders negatively informative observers extremely improbable (i.e., on the order of 1e-6).  Another plausible but still fairly diffuse prior would be Beta(3,5), which reduces the prior probability of an actor's being negatively informative to 0.16, and the prior probability of any given actor's being more than 50% likely to make a particular error (on average) to around 0.22.  (This prior also puts substantial mass near the 0.5 point, which would seem consonant with the BKS studies.)  For network priors, a reasonable starting point can often be derived by considering the expected mean degree of the criterion graph: if d represents the user's prior expectation for the mean degree, then d/(N-1) is a natural starting point for the cell values of nprior.  Butts (2003) discusses a number of issues related to choice of priors for the bbnam model, and users should consult this reference if matters are unclear before defaulting to the uninformative solution.
最后,告诫有关先验分布:重要的是,指定的先验实际上反映了研究者的先验知识,否则,后不足通知。特别要注意的无信息先验的准确性概率意味着它是一个先验同样可能是任何演员的意见将信息或负面的信息(即,i观察j发送领带k降低Pr(j->k))。这是一个非常不现实的假设,它往往会产生后验概率,这是双峰(一种模式相关的“信息”的解决方案,其他的“消极的信息”的解决方案)。目前,之前默认的错误参数是Beta(1,11),这既是弥漫,使得极不可能产生负面的信息观察员(即,为1e-6)的顺序。另一种可行的,但仍然相当扩散之前将β(3,5),从而降低任何给定的演员是超过50%,可能使一个特定的错误(一个演员被负面信息0.16的先验概率,先验概率平均)至约0.22。 (这之前也使近0.5点,这似乎辅音的BKS研究的实质性肿块。)对于网络的先验,一个合理的起点往往可以得到考虑到预期的平均程度的标准图:如果d代表用户的事先预期的平均程度,那么d/(N-1)是一个自然的起点的单元格的值nprior。巴茨(2003)讨论了一些相关的问题为bbnam模型的先验的选择,用户应咨询参考,如果默认为无信息解决方案之前,目前还不清楚。


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

An object of class bbnam, containing the posterior draws.  The components of the output are as follows:
一个对象的类bbnam的,后平。该元件的输出如下所示:

<table summary="R valueblock"> <tr valign="top"><td>anames</td> <td>  A vector of actor names. </td></tr> <tr valign="top"><td>draws</td> <td>  An integer containing the number of draws. </td></tr> <tr valign="top"><td>em</td> <td>  A matrix containing the posterior draws for probability of producing false negatives, by actor. </td></tr> <tr valign="top"><td>ep</td> <td>  A matrix containing the posterior draws for probability of producing false positives, by actor. </td></tr> <tr valign="top"><td>nactors</td> <td>  An integer containing the number of actors. </td></tr> <tr valign="top"><td>net</td> <td>  An array containing the posterior draws for the criterion network. </td></tr> <tr valign="top"><td>reps</td> <td>  An integer indicating the number of replicate chains used by the Gibbs sampler. </td></tr> </table>
<table summary="R valueblock"> <tr valign="top"> <TD>anames</ TD> <td>一个矢量的演员名。 </ TD> </ TR> <tr valign="top"> <TD> draws</ TD> <TD>的绘制包含一个整数。 </ TD> </ TR> <tr valign="top"> <TD>em</ TD> <TD>的矩阵后利用假阴性的概率,由演员。 </ TD> </ TR> <tr valign="top"> <TD>ep</ TD> <TD>后绘制的矩阵产生误报的概率,由演员。 </ TD> </ TR> <tr valign="top"> <TD>nactors</ TD> <TD>整数,包含演员的数量。 </ TD> </ TR> <tr valign="top"> <TD>net</ TD> <TD>一个数组,包含后绘制的标准网络。 </ TD> </ TR> <tr valign="top"> <TD>reps</ TD> <TD>一个整数,指示Gibbs抽样复制链的数量。 </ TD> </ TR> </ TABLE>


注意----------Note----------

As indicated, the posterior draws are conditional on the observed data, and hence on the data collection mechanism if the collection design is non-ignorable.  Complete data (e.g., a CSS) and random tie samples are examples of ignorable designs; see Gelman et al. for more information concerning ignorability.
正如所指出的,后绘制的观测数据是有条件的,因此数据收集机制上,如果集设计是不可忽略的。完整的数据(例如,CSS)和随机领带样品的例子忽略不计的设计;吉尔曼等。更多信息有关ignorability。


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


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



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

Butts, C. T.  (2003).  &ldquo;Network Inference, Error, and Informant (In)Accuracy: A Bayesian Approach.&rdquo;  Social Networks, 25(2), 103-140.
Gelman, A.; Carlin, J.B.; Stern, H.S.; and Rubin, D.B.  (1995).  Bayesian Data Analysis.  London: Chapman and Hall.
Gelman, A., and Rubin, D.B.  (1992).  &ldquo;Inference from Iterative Simulation Using Multiple Sequences.&rdquo;  Statistical Science, 7, 457-511.
Krackhardt, D.  (1987).  &ldquo;Cognitive Social Structures.&rdquo; Social Networks, 9, 109-134.

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

npostpred, event2dichot, bbnam.bf
npostpred,event2dichot,bbnam.bf


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


#Create some random data[创建一些随机数据]
g<-rgraph(5)
g.p<-0.8*g+0.2*(1-g)
dat<-rgraph(5,5,tprob=g.p)

#Define a network prior[定义一个网络前]
pnet<-matrix(ncol=5,nrow=5)
pnet[,]<-0.5
#Define em and ep priors[定义时间和EP先验]
pem<-matrix(nrow=5,ncol=2)
pem[,1]<-3
pem[,2]<-5
pep<-matrix(nrow=5,ncol=2)
pep[,1]<-3
pep[,2]<-5

#Draw from the posterior[绘制从后]
b<-bbnam(dat,model="actor",nprior=pnet,emprior=pem,epprior=pep,
    burntime=100,draws=100)
#Print a summary of the posterior draws[打印后绘制的总结]
summary(b)

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-7 08:04 , Processed in 0.031815 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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