加入收藏
大学数学, 研究生数学,大学数学资料下载,免费 大学数学课件,研究生数学课件,免费下载
R语言- Poisson 分布(中文帮助)
2015-12-19 10:55:58

Poisson {stats}

[转载请注明出处,胡桃木屋 mathapply.cn ”R语言中文帮助“工作室译] 


The Poisson Distribution

泊松分布


Description(描述)

     Density, distribution function, quantile function and random generation for the Poisson distribution with parameter lambda.

    概率密度,分布函数,分位数函数和参数为lambda的泊松分布随机器。


Usage(用法)
dpois(x, lambda, log = FALSE)
ppois(q, lambda, lower.tail = TRUE, log.p = FALSE)
qpois(p, lambda, lower.tail = TRUE, log.p = FALSE)
rpois(n, lambda)


 Arguments


x
     vector of (non-negative integer) quantiles.
     分位数(非负整数)向量。
q
     vector of quantiles.
     分位数向量。
p
     vector of probabilities.
     概率向量。
n
     number of random values to return.
     返回随机值的数量。
lambda
     vector of (non-negative) means.

     均值(非负)向量。

log, log.p 
     logical; if TRUE, probabilities p are given as log(p).
     逻辑型,如果为真,概率p作为log(p)给定。

lower.tail
     logical; if TRUE (default), probabilities are P[X ≤ x], otherwise, P[X > x].
     逻辑型,如果为真(默认),概率是P[X<=x], 否则概率为P[X>x].


Details(详细说明)

    The Poisson distribution has density

              p(x) = λ^x exp(-λ)/x!

for x = 0, 1, 2, … . The mean and variance are E(X) = Var(X) = λ.

    泊松分布的密度函数为

       p(x) = λ^x exp(-λ)/x!

其中 x = 0, 1, 2, … . 均值和方差为 are E(X) = Var(X) = λ.

 

     If an element of x is not integer, the result of dpois is zero, with a warning. p(x) is computed using Loader's algorithm, see the reference in dbinom.

    如果x的元素不是整数,dpois函数结果为0,并给出一个警告。p(x)通过Loader的算法计算,见参考文献中dbinom。

   

     The quantile is right continuous: qpois(p, lambda) is the smallest integer x such that P(X ≤ x) ≥ p.

     分位数是右连续的,qpois(p,lambda)是用最小整数x来给出,P(X ≤ x) ≥ p.

    

    Setting lower.tail = FALSE allows to get much more precise results when the default, lower.tail = TRUE would return 1, see the example below.

    默认情况,设置lower.tail=FALSE允许获得更精确的结果,lower.tail=TRUE将返回1. 见下面的示例。


Value(返回值)

    dpois gives the (log) density, ppois gives the (log) distribution function, qpois gives the quantile function, and rpois generates random deviates.

    dpois返回(对数)概率密度,ppois返回(对数)分布函数, qpois返回分位数函数,rpois生成随机数。

 

    Invalid lambda will result in return value NaN, with a warning.

    无效的lambda将导致返回NaN,并带一个警告。

 

    The length of the result is determined by n for rpois, and is the maximum of the lengths of the numerical arguments for the other functions.

    返回结果的长度取决由rpois的参数n,也可取决于用于其它函数的数值参数的最大长度。

 

    The numerical arguments other than n are recycled to the length of the result. Only the first elements of the logical arguments are used.

     除了n数值参数被循环达到结果的长度。仅仅逻辑参数的第一个元素被使用。


Source(来源)

dpois uses C code contributed by Catherine Loader (see dbinom).

ppois uses pgamma.

qpois uses the Cornish–Fisher Expansion to include a skewness correction to a normal approximation, followed by a search.

rpois uses

Ahrens, J. H. and Dieter, U. (1982). Computer generation of Poisson deviates from modified normal distributions. ACM Transactions on Mathematical Software, 8, 163–179.


See Also

    Distributions for other standard distributions, including dbinom for the binomial and dnbinom for the negative binomial distribution.

    其它标准分布,包括二项分布的dbinom ,负二项分布的dnbinom见Distributions。

poisson.test.


Examples
require(graphics)

-log(dpois(0:7, lambda = 1) * gamma(1+ 0:7)) # == 1
Ni <- rpois(50, lambda = 4); table(factor(Ni, 0:max(Ni)))

1 - ppois(10*(15:25), lambda = 100)  # becomes 0 (cancellation)
    ppois(10*(15:25), lambda = 100, lower.tail = FALSE)  # no cancellation

par(mfrow = c(2, 1))
x <- seq(-0.01, 5, 0.01)
plot(x, ppois(x, 1), type = "s", ylab = "F(x)", main = "Poisson(1) CDF")
plot(x, pbinom(x, 100, 0.01), type = "s", ylab = "F(x)",
     main = "Binomial(100, 0.01) CDF")



[Package stats version 3.2.2 Index]

赞一个(126) | 阅读(15300)
上一篇:R语言- NegBinomial 分布(中文帮助)
下一篇:R语言- Uniform 分布(中文帮助)
 

胡桃木屋版权所有@2013 湘ICP备13006789号-1