Poisson                 package:base                 R Documentation

_T_h_e _P_o_i_s_s_o_n _D_i_s_t_r_i_b_u_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

     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)

_A_r_g_u_m_e_n_t_s:

       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 positive 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].

_D_e_t_a_i_l_s:

     The Poisson distribution has density

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

     for x = 0, 1, 2, ....

     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'.

     The quantile is left continuous: `qgeom(q, prob)' is the largest
     integer x such that P(X <= x) < q.

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

_V_a_l_u_e:

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

_S_e_e _A_l_s_o:

     `dbinom' for the binomial and `dnbinom' for the negative binomial
     distribution.

_E_x_a_m_p_l_e_s:

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

     1 - ppois(10*(15:25), lambda=100)               # becomes 0 (cancellation)
         ppois(10*(15:25), lambda=100, lower=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")

