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

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

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

                                         Prior and Working Weights of a VGLM fit
                                         事先和工作的重量的一个VGLM的适合

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

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

Returns either the prior weights or working weights of a VGLM object.
返回无论是现有的权重或工作重量一个VGLM对象。


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


weightsvglm(object, type = c("prior", "working"),
            matrix.arg = TRUE, ignore.slot = FALSE,
            deriv.arg = FALSE, ...)



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

参数:object
a model object from the VGAM R package that inherits from a vector generalized linear model (VGLM), e.g., a model of class "vglm".  
从VGAMR封装,继承自一个向量广义线性模型(VGLM),例如,一个模型类"vglm"模型对象。


参数:type
Character, which type of weight is to be returned? The default is the first one.  
字符,它的重量要返回?在默认情况下是第一位的。


参数:matrix.arg
Logical, whether the answer is returned as a matrix. If not, it will be a vector.  
逻辑,答案是否被返回作为基质。如果不是,它是一个向量。


参数:ignore.slot
Logical. If TRUE then object@weights is ignored even if it has been assigned, and the long calculation for object@weights is repeated. This may give a slightly different answer because of the final IRLS step at convergence may or may not assign the latest value of quantities such as the mean and weights.  
逻辑。如果TRUE:object@weights忽略,即使它已经被分配,长计算object@weights重复。这可能会略有不同的答案,因为IRLS的最后一步收敛可能会或可能不会指定数量的最新值,如均值和重量。


参数:deriv.arg
Logical. If TRUE then a list with components deriv and weights is returned. See below for more details.  
逻辑。如果TRUE然后组件的列表deriv和weights返回。请参阅下面的更多细节。


参数:...
Currently ignored.  
目前忽略不计。


Details

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

Prior weights are usually inputted with the weights argument in functions such as vglm and vgam.  It may refer to frequencies of the individual data or be weight matrices specified beforehand.
以前的权重通常与weights如vglm和vgam在功能参数输入。它可指的个别数据的频率,或者是预先指定的权重矩阵。

Working weights are used by the IRLS algorithm. They correspond to the second derivatives of the log-likelihood function with respect to the linear predictors.  The working weights correspond to positive-definite weight matrices and are returned in matrix-band form, e.g., the first M columns correspond to the diagonals, etc.
工作权重由IRLS算法使用。它们对应于相对于线性预测的对数似然函数的二阶导数。工作的权重对应正定的权重矩阵和都是在矩阵带的形式,例如,第一个M列对应于对角线等返回的


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

If type = "working" and deriv = TRUE then a list is returned with the two components described below. Otherwise the prior or working weights are returned depending on the value of type.
如果type = "working"和deriv = TRUE然后返回一个列表下面描述的两个组成部分。否则,事前或工作重回到根据的价值type。


参数:deriv
Typically the first derivative of the log-likelihood with respect to the linear predictors. For example, this is the variable deriv.mu in vglm.fit(), or equivalently, the matrix returned in the "deriv" slot of a VGAM family function.  
通常情况下,一阶导数的对数似然相对于线性预测。例如,这是一个变量,deriv.muvglm.fit(),或等价地,返回的矩阵在"deriv"插槽的VGAM家庭功能。


参数:weights
The working weights.  
工作的权重。


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

This function is intended to be similar to weights.glm (see glm).
此功能的目的是类似weights.glm(见glm)。


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


Thomas W. Yee



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

Reduced-rank vector generalized linear models. Statistical Modelling, 3, 15–41.
Statistical Models in S. Wadsworth & Brooks/Cole.

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

glm, vglmff-class, vglm.
glm,vglmff-class,vglm。


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


pneumo = transform(pneumo, let = log(exposure.time))
(fit = vglm(cbind(normal, mild, severe) ~ let,
            cumulative(parallel = TRUE, reverse = TRUE), pneumo))
depvar(fit)       # These are sample proportions [这些样本比例]
weights(fit, type = "prior", matrix = FALSE) # Number of observations[若干意见]

# Look at the working residuals[在工作残差]
nn = nrow(model.matrix(fit, type = "lm"))
M = ncol(predict(fit))

temp = weights(fit, type = "working", deriv = TRUE)
wz = m2adefault(temp$weights, M = M)  # In array format[在阵列格式]
wzinv = array(apply(wz, 3, solve), c(M, M, nn))
wresid = matrix(NA, nn, M)  # Working residuals [工作残差]
for(ii in 1:nn)
    wresid[ii,] = wzinv[, , ii, drop = TRUE] %*% temp$deriv[ii, ]
max(abs(c(resid(fit, type = "w")) - c(wresid))) # Should be 0[应为0]

(z <- predict(fit) + wresid)  # Adjusted dependent vector[调整后的相关矢量]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-26 10:16 , Processed in 0.075938 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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