# How is Poisson distribution different to normal distribution?

I have generated a vector which has a Poisson distribution, as follows:

x = rpois(1000,10)


If I make a histogram using hist(x), the distribution looks like a the familiar bell-shaped normal distribution. However, a the Kolmogorov-Smirnoff test using ks.test(x, 'pnorm',10,3) says the distribution is significantly different to a normal distribution, due to very small p value.

So my question is: how does the Poisson distribution differ from a normal distribution, when the histogram looks so similar to a normal distribution?

-
Also (as an add-in to David's answer): read this (stats.stackexchange.com/a/2498/603) and set your sample size to 100 and see the difference it makes. –  user603 Jul 16 '12 at 19:28

## migrated from stackoverflow.comJul 16 '12 at 19:22

This question came from our site for professional and enthusiast programmers.

1. A Poisson distribution is discrete while a normal distribution is continuous, and a Poisson random variable is always >= 0. Thus, a Kolgomorov-Smirnov test will often be able to tell the difference.

2. When the mean of a Poisson distribution is large, it becomes similar to a normal distribution. However, rpois(1000, 10) doesn't even look that similar to a normal distribution (it stops short at 0 and the right tail is too long).

3. Why are you comparing it to ks.test(..., 'pnorm', 10, 3) rather than ks.test(..., 'pnorm', 10, sqrt(10))? The difference between 3 and $\sqrt{10}$ is small but will itself make a difference when comparing distributions. Even if the distribution truly were normal you would end up with an anti-conservative p-value distribution:

set.seed(1)

hist(replicate(10000, ks.test(rnorm(1000, 10, sqrt(10)), 'pnorm', 10, 3)$p.value))  - Often people will see something vaguely symmetric and assume it looks "normal." I suspect that what @Ross saw. – Fraijo Jul 16 '12 at 19:31 Note that the KS test generally assumes continuous distributions, so relying on the reported p-value in this case may (also) be somewhat suspect. – cardinal Jul 16 '12 at 19:55 True: running hist(replicate(1000, ks.test(rpois(1000, 10), rpois(1000, 10))$p.value)) demonstrates that a test comparing two identical Poisson distributions would be too conservative. –  David Robinson Jul 16 '12 at 19:58

I think it is worth mentioning that a Poisson($\lambda$) pmf is the limiting pmf of a Binomial($n$,$p_n$) with $p_n = \lambda / n$.

One rather lengthy development can be found on this blog.

But, we can prove this economically here as well. If $X_n \sim \mathrm{Binomial}(n,\lambda/n)$ then for fixed $k$ \begin{align} \mathbb P(X_n = k) &= \frac{n!}{k!(n-k)!} \left(\frac{\lambda}{n}\right)^k \left(1-\frac{\lambda}{n}\right)^{n-k} \\ &= \underbrace{\frac{n! n^{-k}}{(n-k)!}}_{\to 1} \frac{\lambda^k}{k!}\underbrace{(1-\lambda/n)^n}_{\to e^{-\lambda}} \cdot \underbrace{(1-\lambda/n)^{-k}}_{\to 1} \>. \end{align}

The first and last terms are easily seen to converge to 1 as $n \to \infty$ (recalling that $k$ is fixed). So, $$\mathbb P(X_n = k) \to \frac{e^{-\lambda} \lambda^k}{k!} \,,$$ as $n \to \infty$ since $(1-\lambda/n)^n \to e^{-\lambda}$.

In addition one has the normal approximation to the Binomial, i.e., Binomial($n$,$p$) $\approxeq^d \mathcal N(np, np(1-p))$. The approximation improves as $n \rightarrow \infty$ and $p$ stays away from 0 and 1. Obviously for the Poisson regime this is not the case (since there $p_n = \lambda / n \rightarrow 0$) but the larger $\lambda$ is the larger $n$ can be and still have a reasonable normal approximation.

-
(+1) Welcome to the site. I've made a few edits; please check that I have not introduced any errors in the process. I was not quite sure of what to make of the very last phrase in the last sentence. Some additional clarification there might be helpful. –  cardinal Aug 17 '12 at 0:24
I like the direction of this, though there may be ways to relate it a little more closely to the question at hand by making the connections between the three distributions clearer. For example (a) A binomial random variable (sequence) acts like a Poisson as long as $n p_n \approx \lambda$, (b) A binomial (sequence) acts like a normal as long as $p$ is approximately a fixed constant and (c) a Poisson (sequence) acts like a normal for large $\lambda$ essentially due to its infinite divisibility. –  cardinal Aug 17 '12 at 1:56
Nice comments @cardinal. About the last sentence, for fixed, large $n$ the larger $\lambda$ the larger $p_n$ (e.g. closer to $1/2$). Therefore the better the Normal approximation to the Binomial and in turn the Poisson. –  muratoa Aug 17 '12 at 5:30
Thanks. I see what you were trying to say now. I generally agree, with the caveat that some care needs to be taken with the relationship between the parameters, which are considered fixed and which vary with the others. :) –  cardinal Aug 17 '12 at 12:29
Thanks @Macro, I sure plan to! –  muratoa Aug 17 '12 at 14:19
show 1 more comment