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

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

[复制链接]
发表于 2012-10-1 15:27:54 | 显示全部楼层 |阅读模式
bratt(VGAM)
bratt()所属R语言包:VGAM

                                         Bradley Terry Model With Ties
                                         布拉德利特里模型的关系

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

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

Fits a Bradley Terry model with ties (intercept-only model) by maximum likelihood estimation.
适合布拉德利的特里模型与关系(仅截距模型)的最大似然估计。


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


bratt(refgp = "last", refvalue = 1, init.alpha = 1, i0 = 0.01)



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

参数:refgp
Integer whose value must be from the set {1,...,M}, where there are M competitors. The default value indicates the last competitor is used—but don't input a character string, in general.  
整数,其值必须是从集合{1,...,M},那里有M竞争对手。使用默认值,表示在过去的竞争对手,但请不要输入一个字符串,在一般情况。


参数:refvalue
Numeric. A positive value for the reference group.  
数字。参照组为正值。


参数:init.alpha
Initial values for the alphas.  These are recycled to the appropriate length.  
alphaS的初始值。这些被回收到合适的长度。


参数:i0
Initial value for alpha_0.  If convergence fails, try another positive value.  
初始值alpha_0。如果收敛失败,再尝试另一种积极的价值。


Details

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

There are several models that extend the ordinary Bradley Terry model to handle ties. This family function implements one of these models.  It involves M competitors who either win or lose or tie against each other.  (If there are no draws/ties then use brat).  The probability that Competitor i beats Competitor j is alpha_i / (alpha_i +   alpha_j + alpha_0), where all the alphas are positive.  The probability that Competitor i ties with Competitor j is alpha_0 / (alpha_i +   alpha_j + alpha_0).  Loosely, the alphas can be thought of as the competitors' "abilities", and alpha_0 is an added parameter to model ties.  For identifiability, one of the alpha_i is set to a known value refvalue, e.g., 1.  By default, this function chooses the last competitor to have this reference value. The data can be represented in the form of a M by M matrix of counts, where winners are the rows and losers are the columns.  However, this is not the way the data should be inputted (see below).
有几种型号,扩展了普通的布拉德利特里模型来处理关系。这间家庭功能实现这些车型之一。它涉及到M谁输或赢或互相配合的竞争对手。 (如果没有绘制/的关系,然后使用brat“)。的概率,它的竞争对手i击败竞争对手j是alpha_i / (alpha_i +   alpha_j + alpha_0),所有的alphas为正。的概率,它的竞争对手i关系与竞争对手j是alpha_0 / (alpha_i +   alpha_j + alpha_0)。严格地说,alphas可以被认为是作为竞争对手的能力,和alpha_0是一个额外的参数,模型关系。可辨识性,其中的alpha_i设置为一个已知的值refvalue,例如,1。默认情况下,此功能选择上的竞争对手有这样的参考价值。这些数据可以代表的在的M矩阵的计数,其中的赢家是行和输家是列M的形式。然而,这不应当被输入数据的方式(见下文)。

Excluding the reference value/group, this function chooses log(alpha_j) as the first M-1 linear predictors.  The log link ensures that the alphas are positive.  The last linear predictor is log(alpha_0).
此功能不计的参考值/组,选择log(alpha_j)的第一个M-1线性预测。log链接,确保alphas为正。最后一个线性预测是log(alpha_0)。

The Bradley Terry model can be fitted with covariates, e.g., a home advantage variable, but unfortunately, this lies outside the VGLM theoretical framework and therefore cannot be handled with this code.
布拉德利特里模型可以配备协变量,例如,一个主场优势变数,但不幸的是,这在于外的VGLM的理论框架,因此不能使用此代码来处理。


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

An object of class "vglmff" (see vglmff-class). The object is used by modelling functions such as vglm.
类的一个对象"vglmff"(见vglmff-class)。该对象被用于建模功能如vglm。


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

The function Brat is useful for coercing a M by M matrix of counts into a one-row matrix suitable for bratt.  Diagonal elements are skipped, and the usual S order of c(a.matrix) of elements is used. There should be no missing values apart from the diagonal elements of the square matrix. The matrix should have winners as the rows, and losers as the columns.  In general, the response should be a matrix with M(M-1) columns.
函数Brat是可强迫一个M M数矩阵的一列矩阵适合bratt。对角线上的元素被跳过,通常的命令c(a.matrix)的元素。不应该有任何缺失值,除了正方形矩阵的对角线元素。矩阵的行,列和输家赢家。在一般情况下,响应应该是一个M(M-1)列的矩阵。

Also, a symmetric matrix of ties should be passed into Brat. The diagonal of this matrix should be all NAs.
此外,对称矩阵的关系应该被传递到Brat。这个矩阵对角线应该是所有的NA的。

Only an intercept model is recommended with bratt. It doesn't make sense really to include covariates because of the limited VGLM framework.
建议bratt只有一个截距模型。它真的没有任何意义,因为有限的VGLM框架,包括协变量。

Notationally, note that the VGAM family function brat has M+1 contestants, while bratt has M contestants.
符号的,请注意,VGAM家庭功能bratM+1参赛者,而brattM参赛者的。


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


T. W. Yee



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

Fitting Bradley Terry models using a multiplicative algorithm. In: Antoch, J. (ed.) Proceedings in Computational Statistics COMPSTAT 2004, Physica-Verlag: Heidelberg. Pages 513–526.

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

brat, Brat, binomialff.
brat,Brat,binomialff。


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


# citation statistics: being cited is a 'win'; citing is a 'loss'[引文统计:被引用的是一个“双赢”的引用是一个“损失”]
journal = c("Biometrika", "Comm.Statist", "JASA", "JRSS-B")
mat = matrix(c( NA, 33, 320, 284,
             730, NA, 813, 276,
             498, 68,  NA, 325,
             221, 17, 142,  NA), 4,4)
dimnames(mat) = list(winner = journal, loser = journal)

# Add some ties. This is fictitional data.[添加一定的关系。这是fictitional的数据。]
ties = 5 + 0*mat
ties[2,1] = ties[1,2] = 9

# Now fit the model[现在拟合模型]
fit = vglm(Brat(mat, ties) ~ 1, bratt(refgp = 1), trace = TRUE)
fit = vglm(Brat(mat, ties) ~ 1, bratt(refgp = 1), trace = TRUE, crit = "coef")

summary(fit)
c(0, coef(fit)) # Log-abilities (in order of "journal"); last is log(alpha0)[登录能力,以“日记”,最后是log(alpha0)]
c(1, Coef(fit)) # Abilities (in order of "journal"); last is alpha0[技能(在“日记”的顺序),最后是alpha0]

fit@misc$alpha  # alpha_1,...,alpha_M[alpha_1,...,alpha_M]
fit@misc$alpha0 # alpha_0[alpha_0]

fitted(fit)  # Probabilities of winning and tying, in awkward form[概率的胜利和尴尬的形式搭售,]
predict(fit)
(check = InverseBrat(fitted(fit)))    # Probabilities of winning [中奖概率]
qprob = attr(fitted(fit), "probtie")  # Probabilities of a tie [领带的概率]
qprobmat = InverseBrat(c(qprob), NCo=nrow(ties))  # Probabilities of a tie [领带的概率]
check + t(check) + qprobmat    # Should be 1's in the off-diagonals [应该是1的对角线]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-26 22:28 , Processed in 0.023870 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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