Poisson分布，是一种统计与概率学里常见到的离散概率分布，由法国数学家西莫恩·德尼·泊松（Siméon-Denis Poisson）在1838年时发表。

## The Poisson Distribution

### Description

Density, distribution function, quantile function and random generation for the Poisson distribution with parameter `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). `lower.tail` logical; if TRUE (default), probabilities are P[X ≤ x], otherwise, P[X > x].

## 1.泊松(Poisson)分布中抽样函数rpois

``````n = 100
lambda = 50
rpois(n, lambda)``````

## 2.泊松分布概率密度函数

``````x <- seq(0,100) # x为非负整数，表达次数。
y <- dpois(x, lambda, log = FALSE)
plot(x,y)``````

## 3.累积概率

``````# lower.tail logical; if TRUE (default), probabilities are P[X ≤ x],
# otherwise, P[X > x].

# P[X ≤ x]
ppois(60, lambda)
# P[X > x]
ppois(60, lambda,lower.tail = FALSE)

# probabilities p are given as log(p).
ppois(60, lambda, log.p = TRUE)``````

## 4.qpois函数(ppois的反函数)

``````# 累积概率为0.95时的x值
qpois(0.95, lambda)``````