\Header{Poisson}{The Poisson Distribution}
\alias{dpois}{Poisson}
\alias{ppois}{Poisson}
\alias{qpois}{Poisson}
\alias{rpois}{Poisson}
\keyword{distribution}{Poisson}
\begin{Usage}
\begin{verbatim}
dpois(x, lambda)
ppois(q, lambda)
qpois(p, lambda)
rpois(n, lambda)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\texttt{x}] vector of (non-negative integer) quantiles.
\item[\texttt{q}] vector of quantiles.
\item[\texttt{p}] vector of probabilities.
\item[\texttt{n}] number of random values to return.
\item[\texttt{lambda}] vector of positive means.
\end{ldescription}
\end{Arguments}
\begin{Description}
These functions provide information about the Poisson distribution
with parameter \texttt{lambda}.  \texttt{dpois} gives the density,
\texttt{ppois} gives the distribution function \texttt{qpois} gives the
quantile function and \texttt{rpois} generates random deviates.\end{Description}
\begin{Details}
The Poisson distribution has density
\deqn{p(x) = \frac{{\lambda}^{x} {e}^{-\lambda}}{x!}}{p(x) = lambda^x exp(-lambda)/x!}
for \eqn{x = 0, 1, 2, \ldots}{}.

If an element of \texttt{x} is not integer, the result of \texttt{dpois} is zero,
with a warning.\end{Details}
\begin{SeeAlso}
\texttt{\Link{dbinom}} for the binomial and \texttt{\Link{dnbinom}} for
the negative binomial distribution.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
-log(dpois(0:7, lambda=1) * gamma(1+ 0:7))
Ni <- rpois(50, lam= 4); table(factor(Ni, 0:max(Ni)))

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")

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

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")


\end{ExampleCode}
\end{Examples}

