Poisson Density as limit of Negative Binomial
Limit Distributions-Poisson Density
Let us look at the behaviour of the frequency plots of random variables that are distributed according to the Negative Binomial distribution for a fixed and various . Recall that:
sage: def nbinom(k,p,r):
... return N(binomial(k+r-1,r)*p^k*(1-p)^r)
In order to compare them we create a sequence with and varying .
sage: p=1/2
sage: nbinoms=[bar_chart(map(lambda r: nbinom(k,p,r), range(20)),color='gray', width=0.2) for k in range(1,20)]
We then animate this sequence.
sage: nbanim=animate(nbinoms,xmin=0,xmax=20,ymin=0,ymax=0.5,figsize=[6,4])
There is no discernable limiting behavior except that the mode moves to the right (keeps increasing) as does the mean.
sage: nbanim.show(delay=70)
Therefore, let us fix . Let us introduce a new variable and "increase the frequency of checks" as follows. We replace by and by as we did for the Binomial distribution.
In other words, we are considering a sequence of random variables so that is distributed according to .
We then get the formula .
In this case, we expect the limit to be a density, so we should consider the frequencies to be divided by the interval size ( ) and we must also use as the step size.
The limiting density is the Poisson density .
sage: c=0.9;k=2;var('t')
sage: poden=plot(c^k*t^(k-1)*exp(-c*t)/factorial(k-1),(t,0,10),color='orange')
sage: nseq=[poden+point(map(lambda t: (t,n*nbinom(k,c/n,t*n)), srange(0,10,1/n)),color='gray') for n in range(1,30)]
sage: nanim=animate(nseq,xmin=0,xmax=10,ymin=0,ymax=c/2,figsize=[6,4])
sage: nanim.show(delay=70)