Normal(stats)
Normal()所属R语言包:stats
The Normal Distribution
正态分布
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Density, distribution function, quantile function and random generation for the normal distribution with mean equal to mean and standard deviation equal to sd.
平均密度分布函数,分位数函数和正态分布随机生成等于mean和标准偏差等于sd。
用法----------Usage----------
dnorm(x, mean = 0, sd = 1, log = FALSE)
pnorm(q, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE)
qnorm(p, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE)
rnorm(n, mean = 0, sd = 1)
参数----------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,长度是所需的数量。
参数:mean
vector of means.
手段向量。
参数:sd
vector of standard deviations.
向量的标准偏差。
参数:log, log.p
logical; if TRUE, probabilities p are given as log(p).
逻辑;如果为TRUE,概率P日志(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 mean or sd are not specified they assume the default values of 0 and 1, respectively.
如果mean或sd没有被指定,他们承担的默认值,分别0和1。
The normal distribution has density
正态分布密度
where μ is the mean of the distribution and σ the standard deviation.
μ是σ标准偏差平均分布。
qnorm is based on Wichura's algorithm AS 241 which provides precise results up to about 16 digits.
qnorm基础上的241 Wichura的算法提供精确的结果,约16位。
值----------Value----------
dnorm gives the density, pnorm gives the distribution function, qnorm gives the quantile function, and rnorm generates random deviates.
dnorm给人的密度,pnorm给出了分布函数,qnorm给人的分量功能,rnorm产生随机的偏离。
源----------Source----------
For pnorm, based on
对于的pnorm的基础上,
Cody, W. D. (1993) Algorithm 715: SPECFUN – A portable FORTRAN package of special function routines and test drivers. ACM Transactions on Mathematical Software 19, 22–32.
科迪,WD(1993)算法715 SPECFUN - 便携式FORTRAN特殊功能的程序和测试车手包。 ACM交易在数学软件19,22-32。
For qnorm, the code is a C translation of
,qnorm的代码是一个C语言的翻译
Wichura, M. J. (1988) Algorithm AS 241: The Percentage Points of the Normal Distribution. Applied Statistics, 37, 477–484.
wichura,MJ(1988)算法AS 241:正态分布百分点。应用统计,37,477-484。
For rnorm, see RNG for how to select the algorithm and for references to the supplied methods.
rnorm,如何选择算法和RNG的提供的方法。
参考文献----------References----------
The New S Language. Wadsworth & Brooks/Cole.
Continuous Univariate Distributions, volume 1, chapter 13. Wiley, New York.
参见----------See Also----------
Distributions for other standard distributions, including dlnorm for the Lognormal distribution.
其他标准分布,包括dlnorm对数正态分布的分布。
举例----------Examples----------
require(graphics)
dnorm(0) == 1/ sqrt(2*pi)
dnorm(1) == exp(-1/2)/ sqrt(2*pi)
dnorm(1) == 1/ sqrt(2*pi*exp(1))
## Using "log = TRUE" for an extended range :[#“日志= TRUE”,使用范围扩展:]
par(mfrow=c(2,1))
plot(function(x) dnorm(x, log=TRUE), -60, 50,
main = "log { Normal density }")
curve(log(dnorm(x)), add=TRUE, col="red",lwd=2)
mtext("dnorm(x, log=TRUE)", adj=0)
mtext("log(dnorm(x))", col="red", adj=1)
plot(function(x) pnorm(x, log.p=TRUE), -50, 10,
main = "log { Normal Cumulative }")
curve(log(pnorm(x)), add=TRUE, col="red",lwd=2)
mtext("pnorm(x, log=TRUE)", adj=0)
mtext("log(pnorm(x))", col="red", adj=1)
## if you want the so-called 'error function'[#如果你想所谓的“误差函数”]
erf <- function(x) 2 * pnorm(x * sqrt(2)) - 1
## (see Abramowitz and Stegun 29.2.29)[(见Abramowitz和Stegun 29年2月29日的)]
## and the so-called 'complementary error function'[#和所谓的“互补误差函数”]
erfc <- function(x) 2 * pnorm(x * sqrt(2), lower = FALSE)
## and the inverses[#和“逆]
erfinv <- function (x) qnorm((1 + x)/2)/sqrt(2)
erfcinv <- function (x) qnorm(x/2, lower = FALSE)/sqrt(2)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|