15.02.22
How to do Bayesian statistics in Python with PyMC3
Bayesian statistics is an approach to statistics based on a theorem first proved by an 18th century minister called Thomas Bayes. The theorem described how to model and update conditional probabilities. Bayesian statistics allows accurate and flexible modelling of probabilities and updating based on new evidence. It's fun stuff!
In the past, Bayesian statistics was less widely used than the 'traditional' frequentist way, partly as it needed more computational power. This is because some of the calculations needed could only be solved using complex simulations of streams of random numbers. These types of computations are called Markov Chain Monte Carlo sampling, named because of the city's association with gambling and random numbers.
Over the past decade, advances in both computer hardware and algorithmic innovation have made this type of modelling much easier to work with. Many of these innovations are accessible using PyMC3, bases, meta, mri,a Python library for doing this type of analysis. For a gentle introduction, read Austin Roachfords guide.