Estimating Probabilities with Bayesian Modeling in Python
(Source)
A simple application of Probabilistic Programming with PyMC3 in Python
It started, as the best projects always do, with a few tweets:
Allen Downey Tweets Twitter is a great resource for data science!
This may seem like a simple problem — the prevalences are simply the same as the observed data (50% lions, 33% tigers and 17% bears) right? If you believe observations we make are a perfect representation of the underlying truth, then yes, this problem could not be easier. However, as a Bayesian, this view of the world and the subsequent reasoning is deeply unsatisfying.
First, how can we be sure this single trip to the preserve was indicative of all trips? What if we went during the winter when the bears were hibernating? We need to include uncertainty in our estimate considering the limited data. Second, how can we incorporate prior beliefs about the situation into this estimate? If we have heard from a friend the preserve has an equal number of each animal, then surely this should play some role in our estimate.
Fortunately, there is a solution that allows to express uncertainty and incorporate prior information into our estimate: Bayesian Inference.