Path: blob/master/examples/hospital_birth_rate.ipynb
1901 views
You can order print and ebook versions of Think Bayes 2e from Bookshop.org and Amazon.
Comparing birth rates
Here's an exercise that was in a draft of Think Bayes, but I ended up cutting it.
Exercise: Two doctors fresh out of medical school are arguing about whose hospital delivers more babies. The first doctor says, "I've been at Hospital A for one week, and already we've had a day when we delivered 19 babies."
The second doctor says, "I've been at Hospital B for two weeks, and already there's been a 20-baby day."
Which hospital do you think delivers more babies on average? You can assume that the number of babies born in a day is well modeled by a Poisson distribution with parameter , which is the Greek letter pronounced "lambda".
The following function computes the PMF of a Poisson distribution with parameter lam over a range of integers, qs:
For example, if the actual value of is 8, we can compute the distribution of babies born in a single day like this:
And here's what it looks like.
The mean of this distribution is the parameter, .
And here's what the distributions look like for the maximum number of babies after one week or two weeks.
Now you finish it off from there.
Think Bayes, Second Edition
Copyright 2020 Allen B. Downey
License: Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)