hyperg(VGAM)
hyperg()所属R语言包:VGAM
Hypergeometric Family Function
超几何家庭功能
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Family function for a hypergeometric distribution where either the number of white balls or the total number of white and black balls are unknown.
家庭功能的超几何分布,在以下情况下白球的数目或总数的白色和黑色的球是未知的。
用法----------Usage----------
hyperg(N = NULL, D = NULL, lprob = "logit", earg = list(), iprob = NULL)
参数----------Arguments----------
参数:N
Total number of white and black balls in the urn. Must be a vector with positive values, and is recycled, if necessary, to the same length as the response. One of N and D must be specified.
瓮里的白球和黑球的总数。必须是一个具有正的值的矢量,被回收时,如有必要,作为响应的相同的长度。其中的N和D必须指定。
参数:D
Number of white balls in the urn. Must be a vector with positive values, and is recycled, if necessary, to the same length as the response. One of N and D must be specified.
瓮里的白球的数量。必须是一个具有正的值的矢量,被回收时,如有必要,作为响应的相同的长度。其中的N和D必须指定。
参数:lprob
Link function for the probabilities. See Links for more choices.
Link功能的概率。见Links更多的选择。
参数:earg
List. Extra argument for the link. See earg in Links for general information.
列表。额外的参数的链接。见earg中Links的一般信息。
参数:iprob
Optional initial value for the probabilities. The default is to choose initial values internally.
可选的初始值的概率。默认值是内部选择的初始值。
Details
详细信息----------Details----------
Consider the scenario from dhyper where there are N=m+n balls in an urn, where m are white and n are black. A simple random sample (i.e., without replacement) of k balls is taken. The response here is the sample proportion of white balls. In this document, N is N=m+n, D is m (for the number of “defectives”, in quality control terminology, or equivalently, the number of marked individuals). The parameter to be estimated is the population proportion of white balls, viz. prob = m/(m+n).
考虑的情况下,从dhyper有N=m+n在瓮中的球,其中m是白色和n是黑的。一个简单的随机抽样(即,无需更换)k球的。这里的反应是白球的样本比例。在这份文件中,N是N=m+n,D是m(的“缺陷”的数量,质量控制术语,或者等价地,一些显着的个人)。要估计的参数是白球,即人口的比例。 prob = m/(m+n)。
Depending on which one of N and D is inputted, the estimate of the other parameter can be obtained from the equation prob = m/(m+n), or equivalently, prob = D/N. However, the log-factorials are computed using lgamma and both m and n are not restricted to being integer. Thus if an integer N is to be estimated, it will be necessary to evaluate the likelihood function at integer values about the estimate, i.e., at trunc(Nhat) and ceiling(Nhat) where Nhat is the (real) estimate of N.
取决于哪一个N和D被输入,其他参数的估计可以以下方式获得从等式prob = m/(m+n),或等价地,prob = D/N。然而,对数的阶乘计算lgamma都m和n不限制为整数。因此,如果一个整数N是要估计,将要评价的似然函数在整数有关的估计值,即,在trunc(Nhat)和ceiling(Nhat)其中Nhat (实际)估计N。
值----------Value----------
An object of class "vglmff" (see vglmff-class). The object is used by modelling functions such as vglm, vgam, rrvglm, cqo, and cao.
类的一个对象"vglmff"(见vglmff-class)。该对象被用于建模功能,如vglm,vgam,rrvglm,cqo和cao。
警告----------Warning ----------
No checking is done to ensure that certain values are within range, e.g., k <= N.
未进行任何检查,以确保特定值范围内的,例如,k <= N。
注意----------Note----------
The response can be of one of three formats: a factor (first level taken as success), a vector of proportions of success, or a 2-column matrix (first column = successes) of counts. The argument weights in the modelling function can also be specified. In particular, for a general vector of proportions, you will need to specify weights because the number of trials is needed.
响应可以是三种格式之一:一个因素(视为成功的第一电平),在成功的比例的向量,或2列的矩阵(第一列=成功)的计数。参数weights的建模功能也可以指定。特别是,对于一个向量的比例,你会需要指定weights,因为审判的需要。
(作者)----------Author(s)----------
Thomas W. Yee
参考文献----------References----------
Statistical Distributions, New York: Wiley-Interscience, Third edition.
参见----------See Also----------
dhyper, binomialff.
dhyper,binomialff。
实例----------Examples----------
nn = 100
m = 5 # number of white balls in the population[在人群中的白球数]
k = rep(4, len = nn) # sample sizes[样本量]
n = 4 # number of black balls in the population[在人群中的黑球数]
y = rhyper(nn = nn, m = m, n = n, k = k)
yprop = y / k # sample proportions[样本比例]
# N is unknown, D is known. Both models are equivalent:[N是未知的,D是已知的。这两个模型是等价的:]
fit = vglm(cbind(y,k-y) ~ 1, hyperg(D = m), trace = TRUE, crit = "c")
fit = vglm(yprop ~ 1, hyperg(D=m), weight = k, trace = TRUE, crit = "c")
# N is known, D is unknown. Both models are equivalent:[N已知,D是未知的。这两个模型是等价的:]
fit = vglm(cbind(y,k-y) ~ 1, hyperg(N = m+n), trace = TRUE, crit = "l")
fit = vglm(yprop ~ 1, hyperg(N = m+n), weight = k, trace = TRUE, crit = "l")
coef(fit, matrix = TRUE)
Coef(fit) # Should be equal to the true population proportion[真正的人口比例应该是平等的]
unique(m / (m+n)) # The true population proportion[真正的人口比例]
fit@extra
head(fitted(fit))
summary(fit)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|