Posnegbin(VGAM)
Posnegbin()所属R语言包:VGAM
Positive-Negative Binomial Distribution
正,负二项分布
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Density, distribution function, quantile function and random generation for the positive-negative binomial distribution.
密度,分布函数,为正负的二项式分布的分位数的功能和随机生成。
用法----------Usage----------
dposnegbin(x, size, prob = NULL, munb = NULL, log = FALSE)
pposnegbin(q, size, prob = NULL, munb = NULL)
qposnegbin(p, size, prob = NULL, munb = NULL)
rposnegbin(n, size, prob = NULL, munb = NULL)
参数----------Arguments----------
参数:x, q
vector of quantiles.
向量的位数。
参数:p
vector of probabilities.
向量的概率。
参数:n
number of observations. Fed into runif.
若干意见。送入runif。
参数:size, prob, munb, log
Same arguments as that of an ordinary negative binomial distribution (see dnbinom). Some arguments have been renamed slightly. Short vectors are recycled. The parameter 1/size is known as a dispersion parameter; as size approaches infinity, the negative binomial distribution approaches a Poisson distribution.
相同的参数,一个普通的负二项分布(见dnbinom“)。稍微有些参数已被重命名。短向量的回收再利用。参数1/size被称为分散参数; size趋近于无穷大,负二项式分布接近泊松分布。
Details
详细信息----------Details----------
The positive-negative binomial distribution is a negative binomial distribution but with the probability of a zero being zero. The other probabilities are scaled to add to unity. The mean therefore is
正负二项分布是一种负二项式分布,但零是零的概率。其他的概率按比例添加到团结。因此,平均是
where munb the mean of an ordinary negative binomial distribution.
munb一个普通的负二项分布的平均值。
值----------Value----------
dposnegbin gives the density, pposnegbin gives the distribution function, qposnegbin gives the quantile function, and rposnegbin generates n random deviates.
dposnegbin给出了密度,pposnegbin给出了分布函数,qposnegbin给出了分位数的功能,和rposnegbin产生n随机偏离。
(作者)----------Author(s)----------
T. W. Yee
参考文献----------References----------
D. B. (1996) Modelling the abundances of rare species: statistical models for counts with extra zeros. Ecological Modelling, 88, 297–308.
参见----------See Also----------
posnegbinomial, zanegbinomial, zinegbinomial, rnbinom.
posnegbinomial,zanegbinomial,zinegbinomial,rnbinom。
实例----------Examples----------
munb <- 5; size <- 4; n <- 1000
table(y <- rposnegbin(n, munb = munb, size = size))
mean(y) # sample mean[样本均值]
munb / (1 - (size / (size + munb))^size) # population mean[人口平均]
munb / pnbinom(0, mu = munb, size = size, lower.tail = FALSE) # same as before[和以前一样]
x <- (-1):17
(ii <- dposnegbin(x, munb = munb, size = size))
max(abs(cumsum(ii) - pposnegbin(x, munb = munb, size = size))) # Should be 0[应为0]
## Not run: [#不运行:]
x <- 0:10
barplot(rbind(dposnegbin(x, munb = munb, size = size),
dnbinom(x, mu = munb, size = size)),
beside = TRUE, col = c("blue","green"),
main = paste("dposnegbin(munb = ", munb, ", size = ", size, ") (blue) vs",
" dnbinom(mu = ", munb, ", size = ", size, ") (green)", sep = ""),
names.arg = as.character(x))
## End(Not run)[#(不执行)]
# Another test for pposnegbin()[另一个测试pposnegbin()]
nn <- 5000
mytab <- cumsum(table(rposnegbin(nn, munb = munb, size = size))) / nn
myans <- pposnegbin(sort(as.numeric(names(mytab))), munb = munb, size = size)
max(abs(mytab - myans)) # Should be 0[应为0]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|