Poisson
distribution
We will use the Poisson distribution to model count data and
(re)-introduce key concepts as probability density function, likelihood,
maximum likelihood estimator (MLE), and estimator properties, such as
unbiasedness, sufficiency, consistency and efficiency (Cramér-Rao lower
bound).
Probability density
function
A random variable \(y \in
\{0,1,2,\ldots\}\) follows a Poisson distribution with rate \(\lambda>0\), if \[
Pr(y|\lambda) = \frac{\lambda^ye^{-\lambda}}{y!}, \ \ \ \mbox{for} \
y=0,1,2,\ldots.
\] Below we illustrate the distributions of \(y\) following a Poisson(2):
cbind(0:3,dpois(0:3,2))
## [,1] [,2]
## [1,] 0 0.1353353
## [2,] 1 0.2706706
## [3,] 2 0.2706706
## [4,] 3 0.1804470
sum(dpois(0:3,2))
## [1] 0.8571235
A few different rates
\(\lambda\)
plot(0:10,dpois(0:10,1),type="h",xlab="Count (y)",ylab="Probability",lwd=2)
lines(0:10+0.1,dpois(0:10,2),col=2,lwd=2,type="h")
lines(0:10+0.2,dpois(0:10,3),col=3,lwd=2,type="h")
legend("topright",legend=c("Y~Poisson(1)","Y~Poisson(2)","Y~Poisson(3)"),col=1:3,lwd=2,bty="n")
Example: Coal mining
disaster
Counts of coal mining disaster in Great Britain by year from 1851 to
1891
y = c(4,5,4,1,0,4,3,4,0,6,3,3,4,0,2,6,3,3,5,4,5,3,1,4,4,1,5,5,3,4,2,5,2,2,3,4,2,1,3,2,2)
c(mean(y),var(y))
## [1] 3.097561 2.540244
n = length(y)
freq = rep(0,7)
for (i in 1:7)
freq[i] = sum(y==(i-1))
tab = cbind(0:6,freq,round(freq/n,2),round(dpois(0:6,2),2),round(dpois(0:6,3),2))
colnames(tab) = c("y","Freq","Rel.Freq","Poi(2)","Poi(3)")
tab
## y Freq Rel.Freq Poi(2) Poi(3)
## [1,] 0 3 0.07 0.14 0.05
## [2,] 1 4 0.10 0.27 0.15
## [3,] 2 7 0.17 0.27 0.22
## [4,] 3 9 0.22 0.18 0.22
## [5,] 4 10 0.24 0.09 0.17
## [6,] 5 6 0.15 0.04 0.10
## [7,] 6 2 0.05 0.01 0.05
plot(0:6,freq/n,type="h",xlab="Counts",ylab="Relative frequency",lwd=4,ylim=c(0,0.3))
title("Coal mining disaster")
lines(0:6+0.05,dpois(0:6,2),col=2,lwd=2,type="h")
lines(0:6+0.1,dpois(0:6,3),col=3,lwd=2,type="h")
lines(0:6+0.15,dpois(0:6,mean(y)),col=4,lwd=2,type="h")
legend("topright",legend=c("Observed frequency","Y~Poisson(2)","Y~Poisson(3)","Y~Poisson(3.098)"),
col=1:5,lwd=2,bty="n")
LS0tCnRpdGxlOiAiQ2xhc3MgMTogUG9pc3NvbiBtb2RlbCIKYXV0aG9yOiAiSGVkaWJlcnQgRnJlaXRhcyBMb3BlcyIKZGF0ZTogIjEwLzA5LzIwMjQiCm91dHB1dDoKICBodG1sX2RvY3VtZW50OgogICAgdG9jOiB0cnVlCiAgICB0b2NfZGVwdGg6IDMKICAgIHRvY19jb2xsYXBzZWQ6IHRydWUKICAgIGNvZGVfZG93bmxvYWQ6IHllcwogICAgbnVtYmVyX3NlY3Rpb25zOiB0cnVlCi0tLQoKIyBQb2lzc29uIGRpc3RyaWJ1dGlvbgpXZSB3aWxsIHVzZSB0aGUgUG9pc3NvbiBkaXN0cmlidXRpb24gdG8gbW9kZWwgY291bnQgZGF0YSBhbmQgKHJlKS1pbnRyb2R1Y2Uga2V5IGNvbmNlcHRzIGFzCnByb2JhYmlsaXR5IGRlbnNpdHkgZnVuY3Rpb24sIGxpa2VsaWhvb2QsIG1heGltdW0gbGlrZWxpaG9vZCBlc3RpbWF0b3IgKE1MRSksIGFuZCBlc3RpbWF0b3IgcHJvcGVydGllcywgc3VjaCBhcyB1bmJpYXNlZG5lc3MsIHN1ZmZpY2llbmN5LCBjb25zaXN0ZW5jeSBhbmQgZWZmaWNpZW5jeSAoQ3JhbcOpci1SYW8gbG93ZXIgYm91bmQpLgoKIyMgUHJvYmFiaWxpdHkgZGVuc2l0eSBmdW5jdGlvbgpBIHJhbmRvbSB2YXJpYWJsZSA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