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

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

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

                                         Positive Negative Binomial Distribution Family Function
                                         积极的负二项分布家庭的功能

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

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

Maximum likelihood estimation of the two parameters of a positive negative binomial distribution.
最大似然估计的正,负二项分布的两个参数。


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


posnegbinomial(lmunb = "loge", lsize = "loge", emunb = list(), esize = list(),
               isize = NULL, zero = -2, nsimEIM = 250,
               shrinkage.init = 0.95, imethod = 1)




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

参数:lmunb
Link function applied to the munb parameter, which is the mean munb of an ordinary negative binomial distribution. See Links for more choices.  
Link功能的munb参数,这是的平均munb一个普通的负二项分布。见Links更多的选择。


参数:lsize
Parameter link function applied to the dispersion parameter, called k. See Links for more choices.  
参数链接功能适用于分散参数,称为k。见Links更多的选择。


参数:emunb, esize
List. Extra argument for the respective links. See earg in Links for general information.  
列表。额外的参数,相应的链接。见earg中Links的一般信息。


参数:isize
Optional initial value for k, an index parameter. The value 1/k is known as a dispersion parameter. If failure to converge occurs try different values (and/or use imethod). If necessary this vector is recycled to length equal to the number of responses.  A value NULL means an initial value for each response is computed internally using a range of values.  
可选的k,索引参数的初始值。作为分散参数是已知的值1/k。如果收敛失败时尝试不同的值(和/或使用imethod)。如有必要,此向量循环长度相等的响应数。值NULL是指每个响应的计算在内部使用的值的范围的初始值。


参数:nsimEIM, zero
See CommonVGAMffArguments.  
见CommonVGAMffArguments。


参数:shrinkage.init, imethod
See negbinomial.  
见negbinomial。


Details

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

The positive negative binomial distribution is an ordinary negative binomial distribution but with the probability of a zero response being zero. The other probabilities are scaled to sum to unity.
阳性负二项式分布是一个普通的负二项式分布,但零响应为零的概率。扩展到其他的概率和为1。

This family function is based on negbinomial and most details can be found there. To avoid confusion, the parameter munb here corresponds to the mean of an ordinary negative binomial distribution negbinomial. The mean of posnegbinomial is
这间家庭功能的基础上negbinomial和最细节可以在那里找到。为了避免混淆,参数munb对应于一个普通的负二项分布negbinomial的平均值。平均posnegbinomial

where p(0) = (k/(k + munb))^k is the probability an ordinary negative binomial distribution has a zero value.
p(0) = (k/(k + munb))^k的概率是普通的负二项分布具有零值。

The parameters munb and k are not independent in the positive negative binomial distribution, whereas they are in the ordinary negative binomial distribution.
参数munb和k是不是独立的正,负二项分布,而他们是在普通的负二项分布。

This function handles multivariate responses, so that a matrix can be used as the response. The number of columns is the number of species, say, and setting zero = -2 means that all species have a k equalling a (different) intercept only.
此函数处理多变量的响应,因此,可以将一个矩阵作为响应使用。列数是物种的数量,也就是说,并设置zero = -2是指所有物种有一个k等于(不同的)拦截。


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

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


警告----------Warning----------

The Poisson model corresponds to k equalling infinity. If the data is Poisson or close to Poisson, numerical problems may occur. Possibly a loglog link could be added in the future to try help handle this problem.
的泊松模型对应于k的合计的无穷。如果该数据是泊松或接近泊松,数值的问题可能会发生。在未来可能是一个loglog可以添加链接,试图帮助处理这个问题。


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

This family function can handle a multivariate response.
这间家庭功能,可以处理多变量响应。


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


Thomas W. Yee



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

Generalized additive modelling and zero inflated count data.  Ecological Modelling, 157, 179–188.
Tables of the logarithmic series distribution. Annals of Mathematical Statistics, 35, 284–297.

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

rposnegbin, pospoisson, negbinomial, zanegbinomial,  rnbinom, CommonVGAMffArguments.
rposnegbin,pospoisson,negbinomial,zanegbinomial,rnbinom,CommonVGAMffArguments。


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


pdata <- data.frame(x = runif(nn <- 1000))
pdata <- transform(pdata, y1 = rposnegbin(nn, munb = exp(0+2*x), size = exp(1)),
                          y2 = rposnegbin(nn, munb = exp(1+2*x), size = exp(3)))
fit <- vglm(cbind(y1, y2) ~ x, posnegbinomial, pdata, trace = TRUE)
coef(fit, matrix = TRUE)
dim(depvar(fit)) # dim(fit@y) is not as good[DIM(适合@ Y)也没有那么好]


# Another artificial data example[另一种人工的数据的例子]
pdata2 <- data.frame(munb = exp(2), size = exp(3)); nn <- 1000
pdata2 <- transform(pdata2, y3 = rposnegbin(nn, munb = munb, size = size))
with(pdata2, table(y3))
fit <- vglm(y3 ~ 1, posnegbinomial, pdata2, trace = TRUE)
coef(fit, matrix = TRUE)
with(pdata2, mean(y3))    # Sample mean[样本平均值]
head(with(pdata2, munb/(1-(size/(size+munb))^size)), 1) # Population mean[总体均值]
head(fitted(fit), 3)
head(predict(fit), 3)


# Example: Corbet (1943) butterfly Malaya data[例:科比特(1943)蝴蝶马来亚数据]
corbet <- data.frame(nindiv = 1:24,
                     ofreq = c(118, 74, 44, 24, 29, 22, 20, 19, 20, 15, 12,
                               14, 6, 12, 6, 9, 9, 6, 10, 10, 11, 5, 3, 3))
fit <- vglm(nindiv ~ 1, posnegbinomial, weights = ofreq, data = corbet)
coef(fit, matrix = TRUE)
Coef(fit)
(khat <- Coef(fit)["size"])
pdf2 <- dposnegbin(x = with(corbet, nindiv), mu = fitted(fit), size = khat)
print( with(corbet, cbind(nindiv, ofreq, fitted = pdf2*sum(ofreq))), dig = 1)
## Not run:  with(corbet,[#不运行:(科比特,]
matplot(nindiv, cbind(ofreq, fitted = pdf2*sum(ofreq)), las = 1,
        type = "b", ylab = "Frequency", col = c("blue", "orange"),
        main = "blue 1s = observe; orange 2s = fitted"))
## End(Not run)[#(不执行)]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-26 14:59 , Processed in 0.024261 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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