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

R语言:GammaDist()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 21:38:04 | 显示全部楼层 |阅读模式
GammaDist(stats)
GammaDist()所属R语言包:stats

                                        The Gamma Distribution
                                         伽玛分布

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

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

Density, distribution function, quantile function and random generation for the Gamma distribution with parameters shape and scale.
密度,分布函数,分位数函数和参数shape和scaleGamma分布的随机生成。


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


dgamma(x, shape, rate = 1, scale = 1/rate, log = FALSE)
pgamma(q, shape, rate = 1, scale = 1/rate, lower.tail = TRUE,
       log.p = FALSE)
qgamma(p, shape, rate = 1, scale = 1/rate, lower.tail = TRUE,
       log.p = FALSE)
rgamma(n, shape, rate = 1, scale = 1/rate)



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

参数:x, q
vector of quantiles.
位数的向量。


参数:p
vector of probabilities.
概率向量。


参数:n
number of observations. If length(n) > 1, the length is taken to be the number required.
观测数。如果length(n) > 1,长度是所需的数量。


参数:rate
an alternative way to specify the scale.
另一种方式,到指定的规模。


参数:shape, scale
shape and scale parameters.  Must be positive, scale strictly.
形状和尺度参数。必须是积极的,scale严格。


参数:log, log.p
logical; if TRUE, probabilities/densities p are returned as log(p).
逻辑;如果TRUE,概率/密度plog(p)的返回。


参数:lower.tail
logical; if TRUE (default), probabilities are P[X ≤ x], otherwise, P[X > x].
逻辑;如果是TRUE(默认),概率P[X ≤ x],否则,“P[X > x]。


Details

详情----------Details----------

If scale is omitted, it assumes the default value of 1.
如果scale被省略,假定1的默认值。

The Gamma distribution with parameters shape = a and scale = s has density
与Gamma分布参数shape= a和scale= s有密度

for x ≥ 0, a > 0 and s > 0. (Here Gamma(a) is the function implemented by R's gamma() and defined in its help.  Note that a=0 corresponds to the trivial distribution with all mass at point 0.)
x ≥ 0,a > 0和s > 0。 (Gamma(a)R的gamma()和定义在它的帮助下实施的功能。请注意,a=00点琐碎所有质量分布相对应。)

The mean and variance are E(X) = a*s and Var(X) = a*s^2.
均值和方差E(X) = a*s和Var(X) = a*s^2。

The cumulative hazard H(t) = - log(1 - F(t)) is -pgamma(t, ..., lower = FALSE, log = TRUE).
累积危险H(t) = - log(1 - F(t))是-pgamma(t, ..., lower = FALSE, log = TRUE)。

Note that for smallish values of shape (and moderate scale) a large parts of the mass of the Gamma distribution is on values of x so near zero that they will be represented as zero in computer arithmetic.  So rgamma can well return values which will be represented as zero.  (This will also happen for very large values of scale since the actual generation is done for scale=1.)
请注意,为短小值shape(和适度scale)Gamma分布的质量大的部分是价值观x如此接近零,他们将代表零计算机运算。所以rgamma可以很好地将作为零表示的值返回。 (这也将发生非常大的价值scale自scale=1实际发电。)


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

dgamma gives the density, pgamma gives the distribution function, qgamma gives the quantile function, and rgamma generates random deviates.
dgamma给人的密度,pgamma给出了分布函数,qgamma给人的分量功能,rgamma产生随机的偏离。

Invalid arguments will result in return value NaN, with a warning.
无效的参数将导致返回值NaN,一个警告。


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

The S parametrization is via shape and rate: S has no scale parameter.
的S参数化是通过shape和rate:S有没有scale参数。

pgamma is closely related to the incomplete gamma function.  As defined by Abramowitz and Stegun 6.5.1 (and by "Numerical Recipes") this is
pgamma是密切相关的不完全伽玛函数。由Abramowitz和Stegun 6.5.1的定义(“数字食谱”),这是

P(a, x) is pgamma(x, a).  Other authors (for example Karl Pearson in his 1922 tables) omit the normalizing factor, defining the incomplete gamma function as pgamma(x, a) * gamma(a). A few use the "upper" incomplete gamma function, the integral from x to infinity which can be computed by pgamma(x, a, lower=FALSE) * gamma(a), or its normalized version. See also http://en.wikipedia.org/wiki/Incomplete_gamma_function.
P(a, x)是pgamma(x, a)。其他作者(例如卡尔·皮尔逊在他1922年的表)省略正常化的因素,不完全伽玛函数定义为pgamma(x, a) * gamma(a)。几个使用“上”不完全伽玛函数,从整体xinfinitypgamma(x, a, lower=FALSE) * gamma(a),或归版本可以计算。也见http://en.wikipedia.org/wiki/Incomplete_gamma_function。


源----------Source----------

dgamma is computed via the Poisson density, using code contributed by Catherine Loader (see dbinom).
dgamma计算,通过泊松密度使用由凯瑟琳装载机贡献的代码(见dbinom)。

pgamma uses an unpublished (and not otherwise documented) algorithm "mainly by Morten Welinder".
pgamma使用未发表的(而不是其他记录)“主要的莫滕Welinder算法。

qgamma is based on a C translation of
qgamma是基于一个C翻译

Best, D. J. and D. E. Roberts (1975). Algorithm AS91. Percentage points of the chi-squared distribution. Applied Statistics,  24, 385–388.
最好的,J. D. E.·罗伯茨(1975年)。算法AS91。卡方分布百分点。应用统计,24,385-388。

plus a final Newton step to improve the approximation.
加上牛顿最后一步提高逼近。

rgamma for shape >= 1 uses
rgamma的shape >= 1使用

Ahrens, J. H. and Dieter, U. (1982). Generating gamma variates by a modified rejection technique. Communications of the ACM, 25, 47–54,
阿伦斯,J. H.和迪特尔·U。(1982年)。产生伽玛变异数通过修改后的排斥反应技术。通信的ACM,25,47-54,

and for 0 < shape < 1 uses
0 < shape < 1使用

Ahrens, J. H. and Dieter, U. (1974). Computer methods for sampling from gamma, beta, Poisson and binomial distributions. Computing, 12, 223&ndash;246.
阿伦斯,J. H.和迪特尔,U。(1974年)。计算机抽样的方法从γ,β,泊松分布和二项式分布。计算,12,223-246。


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

The New S Language. Wadsworth &amp; Brooks/Cole.
Algorithm AS 239,  Chi-squared and incomplete Gamma integral, Applied Statistics (JRSS C) 37, 466&ndash;473.
Handbook of Mathematical Functions. New York: Dover. Chapter 6: Gamma and Related Functions.

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

gamma for the gamma function.
gamma为伽玛函数。

Distributions for other standard distributions, including dbeta for the Beta distribution and dchisq for the chi-squared distribution which is a special case of the Gamma distribution.
其他标准分布的分布,包括dbetaBeta分布和dchisq这是一个特殊情况下的Gamma分布的卡方分布。


举例----------Examples----------


-log(dgamma(1:4, shape=1))
p <- (1:9)/10
pgamma(qgamma(p,shape=2), shape=2)
1 - 1/exp(qgamma(p, shape=1))

# even for shape = 0.001 about half the mass is on numbers[即使形状= 0.001的一半左右大众对数字]
# that cannot be represented accurately (and most of those as zero)[不能准确代表(为零)]
pgamma(.Machine$double.xmin, 0.001)
pgamma(5e-324, 0.001)  # on most machines 5e-324 is the smallest[在大多数机器上5E-324是最小的]
                       # representable non-zero number[表示非零的数字]
table(rgamma(1e4, 0.001) == 0)/1e4

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-23 15:10 , Processed in 0.023504 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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