Fun guide to learning Bayesian statistics and probability through unusual and illustrative examples.
Probability and statistics are increasingly important in a huge range of professions. But many people use data in ways they don't even understand, meaning they aren't getting the most from it. Bayesian Statistics the Fun Way will change that.
This book will give you a complete understanding of Bayesian statistics through simple explanations and un-boring examples. Find out the probability of UFOs landing in your garden, how likely Han Solo is to survive a flight through an asteroid shower, how to win an argument about conspiracy theories, and whether a burglary really was a burglary, to name a few examples.
By using these off-the-beaten-track examples, the author actually makes learning statistics fun. And you'll learn real skills, like how to:
• How to measure your own level of uncertainty in a conclusion or belief
• Calculate Bayes theorem and understand what it's useful for
• Find the posterior, likelihood, and prior to check the accuracy of your conclusions
• Calculate distributions to see the range of your data
• Compare hypotheses and draw reliable conclusions from them
Next time you find yourself with a sheaf of survey results and no idea what to do with them, turn to Bayesian Statistics the Fun Way to get the most value from your data.
Author(s): Will Kurt
Edition: 1
Publisher: No Starch Press
Year: 2019
Language: English
Commentary: Vector PDF
Pages: 256
City: San Francisco, CA
Tags: Bayesian Inference; R; Statistics; Probability Theory; Hypothesis Testing; Uncertainty; Monte Carlo Simulations
Brief Contents
Contents in Detail
Acknowledgments
Introduction
Why Learn Statistics?
What Is “Bayesian” Statistics?
What’s in This Book
Part I: Introduction to Probability
Part II: Bayesian Probability and Prior Probabilities
Part III: Parameter Estimation
Part IV: Hypothesis Testing: The Heart of Statistics
Background for Reading the Book
Now Off on Your Adventure!
Part I: Introduction to Probability
Chapter 1: Bayesian Thinking and Everyday Reasoning
Reasoning About Strange Experiences
Observing Data
Holding Prior Beliefs and Conditioning Probabilities
Forming a Hypothesis
Spotting Hypotheses in Everyday Speech
Gathering More Evidence and Updating Your Beliefs
Comparing Hypotheses
Data Informs Belief; Belief Should Not Inform Data
Wrapping Up
Exercises
Chapter 2: Measuring Uncertainty
What Is a Probability?
Calculating Probabilities by Counting Outcomes of Events
Calculating Probabilities as Ratios of Beliefs
Using Odds to Determine Probability
Solving for the Probabilities
Measuring Beliefs in a Coin Toss
Wrapping Up
Exercises
Chapter 3: The Logic of Uncertainty
Combining Probabilities with AND
Solving a Combination of Two Probabilities
Applying the Product Rule of Probability
Example: Calculating the Probability of Being Late
Combining Probabilities with OR
Calculating OR for Mutually Exclusive Events
Using the Sum Rule for Non–Mutually Exclusive Events
Example: Calculating the Probability of Getting a Hefty Fine
Wrapping Up
Exercises
Chapter 4: Creating a Binomial Probability Distribution
Structure of a Binomial Distribution
Understanding and Abstracting Out the Details of Our Problem
Counting Our Outcomes with the Binomial Coefficient
Combinatorics: Advanced Counting with the Binomial Coefficient
Calculating the Probability of the Desired Outcome
Example: Gacha Games
Wrapping Up
Exercises
Chapter 5: The Beta Distribution
A Strange Scenario: Getting the Data
Distinguishing Probability, Statistics, and Inference
Collecting Data
Calculating the Probability of Probabilities
The Beta Distribution
Breaking Down the Probability Density Function
Applying the Probability Density Function to Our Problem
Quantifying Continuous Distributions with Integration
Reverse-Engineering the Gacha Game
Wrapping Up
Exercises
Part II: Bayesian Probability and Prior Probabilities
Chapter 6: Conditional Probability
Introducing Conditional Probability
Why Conditional Probabilities Are Important
Dependence and the Revised Rules of Probability
Conditional Probabilities in Reverse and Bayes’ Theorem
Introducing Bayes’ Theorem
Wrapping Up
Exercises
Chapter 7: Bayes’ Theorem with LEGO
Working Out Conditional Probabilities Visually
Working Through the Math
Wrapping Up
Exercises
Chapter 8: The Prior, Likelihood, and Posterior of Bayes’ Theorem
The Three Parts
Investigating the Scene of a Crime
Solving for the Likelihood
Calculating the Prior
Normalizing the Data
Considering Alternative Hypotheses
The Likelihood for Our Alternative Hypothesis
The Prior for Our Alternative Hypothesis
The Posterior for Our Alternative Hypothesis
Comparing Our Unnormalized Posteriors
Wrapping Up
Exercises
Chapter 9: Bayesian Priors and Working with Probability Distributions
C-3PO’s Asteroid Field Doubts
Determining C-3PO’s Beliefs
Accounting for Han’s Badassery
Creating Suspense with a Posterior
Wrapping Up
Exercises
Part III: Parameter Estimation
Chapter 10: Introduction to Averaging and Parameter Estimation
Estimating Snowfall
Averaging Measurements to Minimize Error
Solving a Simplified Version of Our Problem
Solving a More Extreme Case
Estimating the True Value with Weighted Probabilities
Defining Expectation, Mean, and Averaging
Means for Measurement vs. Means for Summary
Wrapping Up
Exercises
Chapter 11: Measuring the Spread of Our Data
Dropping Coins in a Well
Finding the Mean Absolute Deviation
Finding the Variance
Finding the Standard Deviation
Wrapping Up
Exercises
Chapter 12: The Normal Distribution
Measuring Fuses for Dastardly Deeds
The Normal Distribution
Solving the Fuse Problem
Some Tricks and Intuitions
“N Sigma” Events
The Beta Distribution and the Normal Distribution
Wrapping Up
Exercises
Chapter 13: Tools of Parameter Estimation: The PDF, CDF, and Quantile Function
Estimating the Conversion Rate for an Email Signup List
The Probability Density Function
Visualizing and Interpreting the PDF
Working with the PDF in R
Introducing the Cumulative Distribution Function
Visualizing and Interpreting the CDF
Finding the Median
Approximating Integrals Visually
Estimating Confidence Intervals
Using the CDF in R
The Quantile Function
Visualizing and Understanding the Quantile Function
Calculating Quantiles in R
Wrapping Up
Exercises
Chapter 14: Parameter Estimation with Prior Probabilities
Predicting Email Conversion Rates
Taking in Wider Context with Priors
Prior as a Means of Quantifying Experience
Is There a Fair Prior to Use When We Know Nothing?
Wrapping Up
Exercises
Chapter 15: From Parameter Estimation to Hypothesis Testing: Building a Bayesian A/B Test
Setting Up a Bayesian A/B Test
Finding Our Prior Probability
Collecting Data
Monte Carlo Simulations
In How Many Worlds Is B the Better Variant?
How Much Better Is Each Variant B Than Each Variant A?
Wrapping Up
Exercises
Part IV: Hypothesis Testing: The Heart of Statistics
Chapter 16: Introduction to the Bayes Factor and Posterior Odds: The Competition of Ideas
Revisiting Bayes’ Theorem
Building a Hypothesis Test Using the Ratio of Posteriors
The Bayes Factor
Prior Odds
Posterior Odds
Wrapping Up
Exercises
Chapter 17: Bayesian Reasoning in the Twilight Zone
Bayesian Reasoning in the Twilight Zone
Using the Bayes Factor to Understand the Mystic Seer
Measuring the Bayes Factor
Accounting for Prior Beliefs
Developing Our Own Psychic Powers
Wrapping Up
Exercises
Chapter 18: When Data Doesn’t Convince You
A Psychic Friend Rolling Dice
Comparing Likelihoods
Incorporating Prior Odds
Considering Alternative Hypotheses
Arguing with Relatives and Conspiracy Theorists
Wrapping Up
Exercises
Chapter 19: From Hypothesis Testing to Parameter Estimation
Is the Carnival Game Really Fair?
Considering Multiple Hypotheses
Searching for More Hypotheses with R
Adding Priors to Our Likelihood Ratios
Building a Probability Distribution
From the Bayes Factor to Parameter Estimation
Wrapping Up
Exercises
Appendix A: A Quick Introduction to R
R and RStudio
Creating an R Script
Basic Concepts in R
Data Types
Missing Values
Vectors
Functions
Basic Functions
Random Sampling
The runif() Function
The rnorm() Function
The sample() Function
Using set.seed() for Predictable Random Results
Defining Your Own Functions
Creating Basic Plots
Exercise: Simulating a Stock Price
Summary
Appendix B: Enough Calculus to Get By
Functions
Determining How Far You’ve Run
Measuring the Area Under the Curve: The Integral
Measuring the Rate of Change: The Derivative
The Fundamental Theorem of Calculus
Appendix C: Answers to the Exercises
Index