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

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

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

                                         Zero-Inflated Poisson Distribution Family Function
                                         零膨胀泊松分布,家庭功能的

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

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

Fits a zero-inflated Poisson distribution by full maximum likelihood estimation.
适合一个完整的最大似然估计的零膨胀泊松分布。


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


zipoissonff(llambda = "loge", lprobp = "logit",
            elambda = list(), eprobp = list(),
            ilambda = NULL, iprobp = NULL, imethod = 1,
            shrinkage.init = 0.8, zero = -2)
zipoisson(lpstr0 = "logit", llambda = "loge",
          epstr0 = list(), elambda = list(),
          ipstr0 = NULL,   ilambda = NULL, imethod = 1,
          shrinkage.init = 0.8, zero = NULL)



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

参数:lpstr0, llambda, epstr0, elambda
Link function and extra argument for the parameter phi and the usual lambda parameter. See Links for more choices, and earg in Links for general information. See CommonVGAMffArguments for more information. For the zero-deflated model see below.  
Link功能和额外的参数的参数phi和通常的“lambda参数的。见Links更多的选择,earg在Links的一般信息。见CommonVGAMffArguments更多信息。对于零瘪的模型,请参阅下文。


参数:ipstr0, ilambda
Optional initial values for phi, whose values must lie between 0 and 1. Optional initial values for lambda, whose values must be positive. The defaults are to compute an initial value internally for each. If a vector then recycling is used.  
可选为的phi,必须位于0和1之间的值的初始值。可选的初始值,为的lambda,其值必须为正数。默认值是内部每个计算初始值。如果一个向量,然后再循环使用。


参数:lprobp, eprobp, iprobp
Corresponding arguments for the other parameterization. See details below.  
相应的参数,其他的参数。详见下文。


参数:imethod
An integer with value 1 or 2 which specifies the initialization method for lambda. If failure to converge occurs try another value and/or else specify a value for shrinkage.init and/or else specify a value for ipstr0. See CommonVGAMffArguments for more information.  
一个整数,值1或2指定初始化方法lambda,。如果出现收敛失败尝试另一个值和/或其他指定为shrinkage.init和/或其他指定的值ipstr0。见CommonVGAMffArguments更多信息。


参数:shrinkage.init
How much shrinkage is used when initializing lambda. The value must be between 0 and 1 inclusive, and  a value of 0 means the individual response values are used, and a value of 1 means the median or mean is used. This argument is used in conjunction with imethod. See CommonVGAMffArguments for more information.  
多少收缩是使用初始化lambda时。值必须介于0和1之间,0值是指个人的响应值,和值1中位数或平均数的。该参数用于结合与imethod。见CommonVGAMffArguments更多信息。


参数:zero
An integer specifying which linear/additive predictor is modelled as intercepts only.  If given, the value must be either 1 or 2, and the default is none of them. Setting zero = 1 makes phi a single parameter. See CommonVGAMffArguments for more information.  
一个整数,指定,其中线性/添加剂的预测中拦截只为蓝本。如果给定的值必须是1或2,默认情况下是没有的。设置zero = 1 phi一个单一的参数。见CommonVGAMffArguments更多信息。


Details

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

This model is a mixture of a Poisson distribution and the value 0; it has value 0 with probability phi else is Poisson(lambda) distributed. Thus there are two sources for zero values, and phi is the probability of a structural zero. The model for zipoisson() can be written
该模型是一个泊松分布的混合物,和值0;phi其他泊松(lambda)分布,它具有值0的概率。因此,有两种来源的零值,和phi是概率的结构零。该模型可以写为zipoisson()

and for y=1,2,…,
和y=1,2,…,

Here, the parameter phi satisfies 0 < phi < 1. The mean of Y is (1-phi)*lambda and these are returned as the fitted values. The variance of Y is    (1-phi)*lambda*(1 + phi lambda). By default, the two linear/additive predictors are (logit(phi), log(lambda))^T. This function implements Fisher scoring.
这里,参数phi满足0 < phi < 1。平均Y是(1-phi)*lambda和这些传回的拟合值。 Y的方差   (1-phi)*lambda*(1 + phi lambda)。默认情况下,两个线性/添加剂的预测是(logit(phi), log(lambda))^T。此功能实现费舍尔得分。

The VGAM family function zipoissonff() has a few changes compared to zipoisson(). These are: (i)   the order of the linear/additive predictors is switched so the Poisson mean comes first; (ii)  probp is now the probability of the Poisson component, i.e., probp is 1-pstr0; (iii) it can handle multiple responses; (iv)  argument zero has a new default so that the probp is an intercept-only  by default. Now zipoissonff() is generally recommended over zipoisson(), and definitely recommended over yip88.
VGAM有一些变化相比,zipoissonff()zipoisson()家庭功能。这些是:(i)的线性/添加剂预测因子的顺序被切换以便泊松平均至上;(ⅱ)probp的是现在的概率泊松分量,即,probp是1-pstr0;(三)它可以处理多个响应;(四)参数zero有一个新的默认,使probp默认情况下是仅截距。现在zipoissonff()一般推荐过zipoisson(),和,绝对推荐过yip88。


值----------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 ----------

Numerical problems can occur, e.g., when the probability of zero is actually less than, not more than, the nominal probability of zero. For example, in the Angers and Biswas (2003) data below, replacing 182 by 1 results in nonconvergence. Half-stepping is not uncommon. If failure to converge occurs, try using combinations of imethod, shrinkage.init, ipstr0, and/or zipoisson(zero = 1) if there are explanatory variables. The default for zipoissonff() is to model the structural zero probability as an intercept-only.
数值可能会发生问题,例如,当实际上是零的概率小于,不超过标称零概率。例如,在昂热和Biswas(2003)以下数据,取代182由1的结果中不收敛。半步的情况并不少见。如果收敛失败时,尝试使用组合imethod,shrinkage.init,ipstr0,和/或zipoisson(zero = 1),“如果有解释变量。 zipoissonff()的默认值是仅截距模型结构的概率为零。


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

For intercept-models, the misc slot has a component called p0 which is the estimate of P(Y = 0). Note that P(Y = 0) is not the parameter phi.  This family function currently cannot handle a multivariate response.
截距模型,misc插槽中有一种成分叫做p0这是估计P(Y = 0)。注意,P(Y = 0)是不是参数phi。这间家庭功能,目前还不能处理多变量的响应。

Although the functions in Zipois can handle the zero-deflated Poisson distribution, this family function cannot estimate this very well in general. One sets lpstr0 = identity, however, the iterations might fall outside the parameter space. Practically, it is restricted to intercept-models only (see example below). Also, one might need inputting good initial values or using a simpler model to obtain initial values.    A (somewhat) similar and more reliable method for zero-deflation is to try the zero-altered Poisson model (see zapoisson).
虽然功能Zipois可以处理零瘪的泊松分布,这间家庭功能无法估计这很好一般。一个设置lpstr0 = identity,然而,迭代可能范围外的参数空间。实际上,它被限制在截距模型(见下面的例子)。此外,用户可能需要输入良好的初始值或使用一个简单的模型来获得初始值。零通缩A()类似,更可靠的方法是尝试改变零泊松模型(见zapoisson“)。

The use of this VGAM family function with rrvglm can result in a so-called COZIGAM or COZIGLM. That is, a reduced-rank zero-inflated Poisson model (RR-ZIP) is a constrained zero-inflated generalized linear model. See COZIGAM. A RR-ZINB model can also be fitted easily; see zinegbinomial. Jargon-wise, a COZIGLM might be better described as a COZIVGLM-ZIP.
使用这个家庭功能VGAMrrvglm可能会导致一个所谓的COZIGAM的或COZIGLM。也就是说,一个降秩零膨胀泊松模型(RR-ZIP)是有约束的零膨胀广义线性模型。见COZIGAM。也可以安装一个RR-ZINB模式容易看到zinegbinomial。行话,明智的,一个COZIGLM可能更好地描述为一个COZIVGLM-ZIP。


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


T. W. Yee



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

Smooth tests for the zero-inflated Poisson distribution. Biometrics, 61, 808&ndash;815.
A Bayesian analysis of zero-inflated generalized Poisson model. Computational Statistics &amp; Data Analysis, 42, 37&ndash;46.
Regression Analysis of Count Data. Cambridge University Press: Cambridge.
Two-parameter reduced-rank vector generalized linear models. In preparation.

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

zapoisson, Zipois, yip88, rrvglm, zipebcom, rpois.
zapoisson,Zipois,yip88,rrvglm,zipebcom,rpois。


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


# Example 1: simulated ZIP data[例1:模拟ZIP数据]
zdata <- data.frame(x2 = runif(nn <- 2000))
zdata <- transform(zdata, pstr01  = logit(-0.5 + 1*x2, inverse = TRUE),
                          pstr02  = logit( 0.5 - 1*x2, inverse = TRUE),
                          Ps01    = logit(-0.5       , inverse = TRUE),
                          Ps02    = logit( 0.5       , inverse = TRUE),
                          lambda1 =  loge(-0.5 + 2*x2, inverse = TRUE),
                          lambda2 =  loge( 0.5 + 2*x2, inverse = TRUE))
zdata <- transform(zdata, y1 = rzipois(nn, lambda = lambda1, pstr0 = Ps01),
                          y2 = rzipois(nn, lambda = lambda2, pstr0 = Ps02))

with(zdata, table(y1)) # Eyeball the data[眼球的数据]
with(zdata, table(y2))
fit1 <- vglm(y1 ~ x2, zipoisson(zero = 1), zdata, crit = "coef")
fit2 <- vglm(y2 ~ x2, zipoisson(zero = 1), zdata, crit = "coef")
coef(fit1, matrix = TRUE)  # These should agree with the above values[这些应该同意上述值]
coef(fit2, matrix = TRUE)  # These should agree with the above values[这些应该同意上述值]

# Fit all two simultaneously, using a different parameterization:[适合所有的同时,使用不同的参数:]
fit12 <- vglm(cbind(y1, y2) ~ x2, zipoissonff, zdata, crit = "coef")
coef(fit12, matrix = TRUE)  # These should agree with the above values[这些应该同意上述值]

# Example 2: McKendrick (1926). Data from 223 Indian village households[实施例2:麦克德瑞克(1926)。印度从223户村的数据]
cholera &lt;- data.frame(ncases = 0:4, # Number of cholera cases,[霍乱病例数,]
                      wfreq = c(168, 32, 16, 6, 1)) # Frequencies[频率]
fit <- vglm(ncases ~ 1, zipoisson, wei = wfreq, cholera, trace = TRUE)
coef(fit, matrix = TRUE)
with(cholera, cbind(actual = wfreq,
                    fitted = round(dzipois(ncases, lambda = Coef(fit)[2],
                                           pstr0 = Coef(fit)[1]) *
                                   sum(wfreq), dig = 2)))

# Example 3: data from Angers and Biswas (2003)[例3:数据从昂热和比斯瓦斯(2003年)]
abdata <- data.frame(y = 0:7, w = c(182, 41, 12, 2, 2, 0, 0, 1))
abdata <- subset(abdata, w > 0)
fit <- vglm(y ~ 1, zipoisson(lpstr0 = probit, ipstr0 = 0.8),
            abdata, weight = w, trace = TRUE)
fit@misc$pobs0  # Estimate of P(Y = 0)[估计P(Y = 0)]
coef(fit, matrix = TRUE)
Coef(fit)  # Estimate of pstr0 and lambda[估计pstr0和lambda]
fitted(fit)
with(abdata, weighted.mean(y, w)) # Compare this with fitted(fit)[与此相比,与拟合(FIT)]
summary(fit)

# Example 4: zero-deflated model for an intercept-only data[示例4:零瘪仅截距模型数据]
zdata <- transform(zdata, lambda3 = loge( 0.0       , inverse = TRUE))
zdata &lt;- transform(zdata, deflat_limit = -1 / expm1(lambda3)) # Boundary[边界]
# The 'pstr0' parameter is negative and in parameter space:[pstr0参数是负的,在参数空间中:]
zdata <- transform(zdata, usepstr0 = deflat_limit / 1.5)
zdata <- transform(zdata, y3 = rzipois(nn, lambda3, pstr0 = usepstr0))
head(zdata)
with(zdata, table(y3)) # A lot of deflation[很多通缩]
fit3 <- vglm(y3 ~ 1, zipoisson(zero = -1, lpstr0 = identity),
             zdata, trace = TRUE, crit = "coef")
coef(fit3, matrix = TRUE)
# Check how accurate it was:[检查如何准确的是:]
zdata[1, 'usepstr0']      # Answer[回答]
coef(fit3)[1]             # Estimate[估计]
Coef(fit3)

# Example 5: This RR-ZIP is known as a COZIGAM or COZIVGLM-ZIP[例5:RR-ZIP被称为一个COZIGAM或COZIVGLM-ZIP]
set.seed(123)
rrzip <- rrvglm(Alopacce ~ bs(WaterCon, df = 3), zipoisson(zero = NULL),
                hspider, trace = TRUE, Index.corner = 2)
coef(rrzip, matrix = TRUE)
Coef(rrzip)
summary(rrzip)
## Not run: plotvgam(rrzip, lcol = "blue")[#不运行:plotvgam(rrzip,LCOL =“蓝”)]

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


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

使用道具 举报

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

本版积分规则

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

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

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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