Posbinom(VGAM)
Posbinom()所属R语言包:VGAM
Positive-Binomial Distribution
正二项分布
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Density, distribution function, quantile function and random generation for the positive-binomial distribution.
密度,分布函数,为正二项式分布的分位数的功能和随机生成。
用法----------Usage----------
dposbinom(x, size, prob, log = FALSE)
pposbinom(q, size, prob)
qposbinom(p, size, prob)
rposbinom(n, size, prob)
参数----------Arguments----------
参数:x, q
vector of quantiles.
向量的位数。
参数:p
vector of probabilities.
向量的概率。
参数:n
number of observations. Fed into runif.
若干意见。送入runif。
参数:size
number of trials. It is the N symbol in the formula given in posbinomial.
试验次数。这是N符号中给出的公式中posbinomial。
参数:prob
probability of success on each trial.
每次试验的成功概率。
参数:log
See dbinom.
见dbinom。
Details
详细信息----------Details----------
The positive-binomial distribution is a 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 mu is the argument prob above. As mu increases, the positive-binomial and binomial distributions become more similar. Unlike similar functions for the binomial distribution, a zero value of prob is not permitted here.
mu参数prob以上。 mu增加,正二项式分布和二项式分布更加相似。与二项分布类似的功能,零值prob不允许在这里。
值----------Value----------
dposbinom gives the density, pposbinom gives the distribution function, qposbinom gives the quantile function, and rposbinom generates random deviates.
dposbinom给出了密度,pposbinom给出了分布函数,qposbinom给出了分位数的功能,和rposbinom随机产生的偏离。
注意----------Note----------
For dposbinom(), if arguments size or prob equal 0 then a NaN is returned.
对于dposbinom(),如果参数size或prob等于0,然后NaN返回。
The family function posbinomial estimates the parameters by maximum likelihood estimation.
家庭功能posbinomial估计参数的最大似然估计。
(作者)----------Author(s)----------
T. W. Yee
参见----------See Also----------
posbinomial, zabinomial, zibinomial, rbinom.
posbinomial,zabinomial,zibinomial,rbinom。
实例----------Examples----------
prob = 0.2; size = 10
table(y <- rposbinom(n = 1000, size, prob))
mean(y) # Sample mean[样本平均值]
size * prob / (1-(1-prob)^size) # Population mean[总体均值]
(ii = dposbinom(0:size, size, prob))
cumsum(ii) - pposbinom(0:size, size, prob) # Should be 0s[应该是0]
table(rposbinom(100, size, prob))
table(qposbinom(runif(1000), size, prob))
round(dposbinom(1:10, size, prob) * 1000) # Should be similar[应该是相似的]
## Not run: barplot(rbind(dposbinom(x = 0:size, size, prob),[#不运行:barplot(rbind(dposbinom(X = 0:大小,尺寸,概率),]
dbinom(x = 0:size, size, prob)),
beside = TRUE, col = c("blue", "green"),
main=paste("Positive-binomial(", size, ",", prob, ") (blue) vs",
" Binomial(", size, ",", prob, ") (green)", sep = ""),
names.arg = as.character(0:size), las = 1)
## End(Not run)[#(不执行)]
# Simulated data example[模拟数据的例子]
nn = 1000; sizeval1 = 10; sizeval2 = 20
pdat <- data.frame(x2 = seq(0, 1, length = nn))
pdat <- transform(pdat, prob1 = logit(-2 + 2 * x2, inverse = TRUE),
prob2 = logit(-1 + 1 * x2, inverse = TRUE),
sizev1 = rep(sizeval1, len = nn),
sizev2 = rep(sizeval2, len = nn))
pdat <- transform(pdat, y1 = rposbinom(nn, size = sizev1, prob = prob1),
y2 = rposbinom(nn, size = sizev2, prob = prob2))
with(pdat, table(y1))
with(pdat, table(y2))
# Multivariate response[多变量响应]
fit2 = vglm(cbind(y1, y2) ~ x2, posbinomial(mv = TRUE),
trace = TRUE, pdat, weight = cbind(sizev1, sizev2))
coef(fit2, matrix = TRUE)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|