Exercise-The Binomial is related to the Poisson distribution

advertisement
EXERCISE on Discrete Random Variables:
The Binomial is related to the Poisson distribution.
If X~Poisson(a) and Y~Poisson(b), independent, then
1) Z  X  Y is Poisson(a+b). The distribution of Z is a convolution:
z
z
z
x=0
x=0
x=0
Pr(Z = z) = å Pr(X = x)Pr(Y = z - x) = å Pr(X = x)Pr(Y = z - x) = å[X,Y ](x, z - x)
2) X | X  Y is Binomial( X  Y , a /(a  b) ) .
To get these results, we let c=a+b, n=X+Y, and p=a/(a+b).
We rewrite the joint distribution:
[X,Y ] =
a X -a bY -b æ (X + Y )! a X bY ö æ (a + b) X+Y -(a+b) ö
e
e =ç
e
÷ø
X!
Y!
è X!Y ! (a + b) X+Y ÷ø çè (X + Y )!
æ Z ö X
=ç
p (1- p) X
÷
è X ø
cZ - c
e
Z!
= [X | Z ][Z].
Your job is to verify this result in R, as follows:
a) Using the R function rpois(), generate 1000 Poissons with a=5 and 1000
Poissons with b=10. Add them pairwise to get a sample of Z’s.
b) Compare the frequency distribution, obtained from table(), to the theoretical
answer, from dpois(). You can use plot() or cbind(), for example.
c)
Compare the ecdf (empirical cumulative distribution function) to the theoretical
answer, from ppois().
d)
Get the sample quantiles, obtained from quantile(), and compare to the
theoretical result from qpois().
Download