Synopses & Reviews
Master Bayesian Inference through Practical Examples and Computation—Not Advanced Mathematical Analysis
Bayesian methods of inference are deeply natural and extremely powerful. However, most discussions of Bayesian inference rely on intensely complex mathematical analyses and artificial examples, making it inaccessible to anyone without a strong mathematical background. Now, though, Cameron Davidson-Pilon introduces Bayesian inference from a computational perspective, bridging theory to practice—freeing you to get results using computing power.
Bayesian Methods for Hackers illuminates Bayesian inference through probabilistic programming with the powerful PyMC language and the closely related Python tools NumPy, SciPy, and Matplotlib. Using this approach, you can reach effective solutions in small increments, without extensive mathematical intervention.
Davidson-Pilon begins by introducing the concepts underlying Bayesian inference, comparing it with other techniques and guiding you through building and training your first Bayesian model. Next, he introduces PyMC through a series of detailed examples and intuitive explanations that have been refined after extensive user feedback. You’ll learn how to use the Markov Chain Monte Carlo algorithm, choose appropriate sample sizes and priors, work with loss functions, and apply Bayesian inference in domains ranging from finance to marketing. Once you’ve mastered these techniques, you’ll constantly turn to this guide for the working PyMC code you need to jumpstart future projects.
Coverage includes
• Learning the Bayesian “state of mind” and its practical implications
• Understanding how computers perform Bayesian inference
• Using the PyMC Python library to program Bayesian analyses
• Building and debugging models with PyMC
• Testing your model’s “goodness of fit”
• Opening the “black box” of the Markov Chain Monte Carlo algorithm to see how and why it works
• Leveraging the power of the “Law of Large Numbers”
• Mastering key concepts, such as clustering, convergence, autocorrelation, and thinning
• Using loss functions to measure an estimate’s weaknesses based on your goals and desired outcomes
• Selecting appropriate priors and understanding how their influence changes with dataset size
• Overcoming the “exploration vs. exploitation” dilemma: deciding when “pretty good” is good enough
• Using Bayesian inference to improve A/B testing
• Solving data science problems that rely on mountains of data
Synopsis
Master Bayesian Inference through Practical Examples and Computation Without Advanced Mathematical Analysis
Bayesian methods of inference are deeply natural and extremely powerful. However, most discussions of Bayesian inference rely on intensely complex mathematical analyses and artificial examples, making it inaccessible to anyone without a strong mathematical background. Now, though, Cameron Davidson-Pilon introduces Bayesian inference from a computational perspective, bridging theory to practice freeing you to get results using computing power.
Bayesian Methods for Hackers illuminates Bayesian inference through probabilistic programming with the powerful PyMC language and the closely related Python tools NumPy, SciPy, and Matplotlib. Using this approach, you can reach effective solutions in small increments, without extensive mathematical intervention.
Davidson-Pilon begins by introducing the concepts underlying Bayesian inference, comparing it with other techniques and guiding you through building and training your first Bayesian model. Next, he introduces PyMC through a series of detailed examples and intuitive explanations that have been refined after extensive user feedback. You ll learn how to use the Markov Chain Monte Carlo algorithm, choose appropriate sample sizes and priors, work with loss functions, and apply Bayesian inference in domains ranging from finance to marketing. Once you ve mastered these techniques, you ll constantly turn to this guide for the working PyMC code you need to jumpstart future projects.
Coverage includes
Learning the Bayesian state of mind and its practical implications
Understanding how computers perform Bayesian inference
Using the PyMC Python library to program Bayesian analyses
Building and debugging models with PyMC
Testing your model s goodness of fit
Opening the black box of the Markov Chain Monte Carlo algorithm to see how and why it works
Leveraging the power of the Law of Large Numbers
Mastering key concepts, such as clustering, convergence, autocorrelation, and thinning
Using loss functions to measure an estimate s weaknesses based on your goals and desired outcomes
Selecting appropriate priors and understanding how their influence changes with dataset size
Overcoming the exploration versus exploitation dilemma: deciding when pretty good is good enough
Using Bayesian inference to improve A/B testing
Solving data science problems when only small amounts of data are available
Cameron Davidson-Pilon has worked in many areas of applied mathematics, from the evolutionary dynamics of genes and diseases to stochastic modeling of financial prices. His contributions to the open source community include lifelines, an implementation of survival analysis in Python. Educated at the University of Waterloo and at the Independent University of Moscow, he currently works with the online commerce leader Shopify.
"
Synopsis
The next generation of really difficult problems will be statistical, not deterministic: the solutions will be buried beneath layers of noise. Bayesian methods offer data scientists powerful flexibility in solving these brutally complex problems. However, Bayesian methods have traditionally required deep mastery of complicated math and advanced algorithms, placing them off-limits to many who could benefit from them.
New technologies such as the Python PyMC library now make it possible to largely abstract Bayesian inference from deeper mathematics. Bayesian Methods for Hackers is the first book built upon this approach. Using realistic and relevant examples, it shows programmers how to solve many common problems with Bayesian methods, even if they have only modest mathematical backgrounds. Cameron Davidson-Pilon demystifies all facets of Bayesian programming, including:
- The philosophy of Bayesian inference, the Bayesian "state of mind," and Bayesian inference in practice
- How the Python PyMC library implements Bayesian techniques, freeing you to use them without first possessing a deep understanding of Bayesian mathematics
- How to build on your growing application experience to gain a deeper theoretical understanding
To build your understanding, he guides you through many real-world applications, including:
- Inferring behavior from text-message data
- Performing A/B testing with Bayesian methods
- Diagnosing and improving convergence
- Gaining insight from aggregated geographical data
- Developing statistical models to predict census form return rates
- Sequencing Reddit comments
- Improving machine learning
- Predicting stock returns, and much more
Using Bayesian Methods for Hackers, you can start leveraging powerful Bayesian tools right now -- gradually deepening your theoretical knowledge while you're already achieving powerful results in areas ranging from marketing to finance.
About the Author
Cameron Davidson-Pilon has seen many fields of applied mathematics, from the evolutionary dynamics of genes and diseases, to stochastic modelling of financial prices. His main contributions to the open source community include Bayesian Methods for Hackers and lifelines. Cameron was raised in Guelph, Ontario, but educated at the University of Waterloo and Independent University of Moscow. He currently lives in Ottawa, Ontario, working with the online commerce leader Shopify.
Table of Contents
Foreword by Paul Dix
Preface
Acknowledgments
About the Author
Chapter 1: The Philosophy of Bayesian Inference
Chapter 2: A Little More on PyMC
Chapter 3: Opening the Black Box of MCMC
Chapter 4: The Greatest Theorem Never Told
Chapter 5: Would You Rather Lose an Arm or a Leg?
Chapter 6: Getting Our Priorities Straight
Chapter 7: Bayesian A/B Testing
Index