Bayesian Methods for Hackers: Probabilistic Programming and Bayesian Inference (Addison-Wesley Data & Analytics) 1st Edition
Use the Amazon App to scan ISBNs and compare prices.
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.
Frequently bought together

- +
- +
Customers who viewed this item also viewed
Editorial Reviews
About the Author
Cameron Davidson-Pilon has seen many fields of applied mathematics, from evolutionary dynamics of genes and diseases to stochastic modeling 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 was educated at the University of Waterloo and Independent University of Moscow. He currently lives in Ottawa, Ontario, working with the online commerce leader Shopify.
Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.
Product details
- Publisher : Addison-Wesley Professional; 1st edition (October 2, 2015)
- Language : English
- Paperback : 256 pages
- ISBN-10 : 0133902838
- ISBN-13 : 978-0133902839
- Item Weight : 12.4 ounces
- Dimensions : 6.9 x 0.5 x 8.9 inches
- Best Sellers Rank: #124,899 in Books (See Top 100 in Books)
- #72 in Software Testing
- #73 in Data Mining (Books)
- #97 in Database Storage & Design
- Customer Reviews:
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on AmazonReviewed in the United States on September 29, 2021
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
Also most of the matplotlib formatting code could have been handled with a stylesheet thereby removing it from the meaningful code. In other words, I don't need to see the figure size, DPI, color, transparency settings, etc. in the displayed code, just show the plt.plot(x,y,label) command when possible.
I think a book that covers the core concepts via mathematical formalism and then shows from scratch the implementation (ideally without any 3rd party libraries) is best. I haven't seen such a book.
When you consider that this book is offered for free on Github, you're already getting a lot of value for free. If you're interested in seeing the exercise solutions (there are only a handful) or the additional chapter on A/B testing, then $17 for the e-book is a fair price.
My only complaint is that I wish there were more exercises to test the reader along the way. You can re-implement many of the examples yourself, but having a few more questions, especially in the later chapters would be helpful for validating understanding.
Reviewed in the United States on September 29, 2021
All that being said, this is a good book with a lot of information in just over 200 pages.
Top reviews from other countries
Note: all the material is actually freely available online in a git repository but I wanted it in Kindle format so I could read it on the go.
The book is focused on PyMC, a Python module for bayesian statistics. There are other Python modules that implement this algorithms too, and one could ask why to choose one and not other for this book. One of the major problems with PyMC is its incomplete documentation, and this book could be a great opportunity to target this issue, even more when this problem is cited in the text.
The book covers the PyMc version for Python 2. There actually exist a Python 3 version, that is totally different, so it's important to point it.
Nevertheless, I learned some important points on Bayesian statistics: selecting priors, problem solving strategies...










