Bayesian Statistics The Fun Way: Understanding Statistics And Probability With Star Wars, LEGO, And Rubber Ducks

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

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.

Author(s): Will Kurt
Publisher: No Starch Press
Year: 2019

Language: English
Pages: 211
Tags: Bayesian Statistics

BAYESIAN STATISTICS THE FUN WAY......Page 2
About the Technical Reviewer......Page 4
ACKNOWLEDGMENTS......Page 5
WHY LEARN STATISTICS?......Page 6
Part I: Introduction to Probability......Page 7
Part III: Parameter Estimation......Page 8
BACKGROUND FOR READING THE BOOK......Page 9
NOW OFF ON YOUR ADVENTURE!......Page 10
PART I INTRODUCTION TO PROBABILITY......Page 11
REASONING ABOUT STRANGE EXPERIENCES......Page 12
Holding Prior Beliefs and Conditioning Probabilities......Page 13
Forming a Hypothesis......Page 14
GATHERING MORE EVIDENCE AND UPDATING YOUR BELIEFS......Page 15
COMPARING HYPOTHESES......Page 16
DATA INFORMS BELIEF; BELIEF SHOULD NOT INFORM DATA......Page 17
EXERCISES......Page 18
WHAT IS A PROBABILITY?......Page 20
CALCULATING PROBABILITIES BY COUNTING OUTCOMES OF EVENTS......Page 21
CALCULATING PROBABILITIES AS RATIOS OF BELIEFS......Page 22
Solving for the Probabilities......Page 23
Measuring Beliefs in a Coin Toss......Page 24
EXERCISES......Page 25
3 THE LOGIC OF UNCERTAINTY......Page 26
Solving a Combination of Two Probabilities......Page 27
Applying the Product Rule of Probability......Page 29
Example: Calculating the Probability of Being Late......Page 31
Calculating OR for Mutually Exclusive Events......Page 32
Using the Sum Rule for Non–Mutually Exclusive Events......Page 33
Example: Calculating the Probability of Getting a Hefty Fine......Page 34
EXERCISES......Page 35
STRUCTURE OF A BINOMIAL DISTRIBUTION......Page 36
UNDERSTANDING AND ABSTRACTING OUT THE DETAILS OF OUR PROBLEM......Page 37
COUNTING OUR OUTCOMES WITH THE BINOMIAL COEFFICIENT......Page 38
Combinatorics: Advanced Counting with the Binomial Coefficient......Page 39
Calculating the Probability of the Desired Outcome......Page 40
EXAMPLE: GACHA GAMES......Page 42
WRAPPING UP......Page 44
EXERCISES......Page 45
Distinguishing Probability, Statistics, and Inference......Page 46
Calculating the Probability of Probabilities......Page 47
Breaking Down the Probability Density Function......Page 51
Applying the Probability Density Function to Our Problem......Page 52
Quantifying Continuous Distributions with Integration......Page 53
REVERSE-ENGINEERING THE GACHA GAME......Page 54
WRAPPING UP......Page 55
EXERCISES......Page 56
PART II BAYESIAN PROBABILITY AND PRIOR PROBABILITIES......Page 57
INTRODUCING CONDITIONAL PROBABILITY......Page 58
Dependence and the Revised Rules of Probability......Page 59
CONDITIONAL PROBABILITIES IN REVERSE AND BAYES’ THEOREM......Page 60
INTRODUCING BAYES’ THEOREM......Page 61
WRAPPING UP......Page 62
EXERCISES......Page 63
7 BAYES’ THEOREM WITH LEGO......Page 64
WORKING OUT CONDITIONAL PROBABILITIES VISUALLY......Page 67
WORKING THROUGH THE MATH......Page 68
EXERCISES......Page 69
THE THREE PARTS......Page 70
Solving for the Likelihood......Page 71
Normalizing the Data......Page 72
The Likelihood for Our Alternative Hypothesis......Page 74
The Posterior for Our Alternative Hypothesis......Page 75
WRAPPING UP......Page 76
EXERCISES......Page 77
C-3PO’S ASTEROID FIELD DOUBTS......Page 78
DETERMINING C-3PO’S BELIEFS......Page 79
ACCOUNTING FOR HAN’S BADASSERY......Page 80
CREATING SUSPENSE WITH A POSTERIOR......Page 82
WRAPPING UP......Page 83
EXERCISES......Page 84
PART III PARAMETER ESTIMATION......Page 85
ESTIMATING SNOWFALL......Page 86
Solving a Simplified Version of Our Problem......Page 87
Solving a More Extreme Case......Page 90
Estimating the True Value with Weighted Probabilities......Page 92
Defining Expectation, Mean, and Averaging......Page 93
WRAPPING UP......Page 94
EXERCISES......Page 95
DROPPING COINS IN A WELL......Page 96
FINDING THE MEAN ABSOLUTE DEVIATION......Page 97
FINDING THE STANDARD DEVIATION......Page 99
WRAPPING UP......Page 100
EXERCISES......Page 101
MEASURING FUSES FOR DASTARDLY DEEDS......Page 102
THE NORMAL DISTRIBUTION......Page 104
SOLVING THE FUSE PROBLEM......Page 107
SOME TRICKS AND INTUITIONS......Page 110
THE BETA DISTRIBUTION AND THE NORMAL DISTRIBUTION......Page 112
EXERCISES......Page 114
THE PROBABILITY DENSITY FUNCTION......Page 115
Visualizing and Interpreting the PDF......Page 116
INTRODUCING THE CUMULATIVE DISTRIBUTION FUNCTION......Page 118
Finding the Median......Page 121
Approximating Integrals Visually......Page 122
Estimating Confidence Intervals......Page 123
Using the CDF in R......Page 124
Visualizing and Understanding the Quantile Function......Page 125
Calculating Quantiles in R......Page 126
EXERCISES......Page 127
PREDICTING EMAIL CONVERSION RATES......Page 128
TAKING IN WIDER CONTEXT WITH PRIORS......Page 130
PRIOR AS A MEANS OF QUANTIFYING EXPERIENCE......Page 134
IS THERE A FAIR PRIOR TO USE WHEN WE KNOW NOTHING?......Page 135
EXERCISES......Page 137
PART IV HYPOTHESIS TESTING: THE HEART OF STATISTICS......Page 138
SETTING UP A BAYESIAN A/B TEST......Page 139
Collecting Data......Page 140
In How Many Worlds Is B the Better Variant?......Page 142
How Much Better Is Each Variant B Than Each Variant A?......Page 143
EXERCISES......Page 145
REVISITING BAYES’ THEOREM......Page 146
Prior Odds......Page 147
Posterior Odds......Page 148
Testing for a Loaded Die......Page 149
Self-Diagnosing Rare Diseases Online......Page 150
EXERCISES......Page 152
USING THE BAYES FACTOR TO UNDERSTAND THE MYSTIC SEER......Page 153
Measuring the Bayes Factor......Page 154
Accounting for Prior Beliefs......Page 155
DEVELOPING OUR OWN PSYCHIC POWERS......Page 156
WRAPPING UP......Page 157
EXERCISES......Page 158
A PSYCHIC FRIEND ROLLING DICE......Page 159
Incorporating Prior Odds......Page 160
Considering Alternative Hypotheses......Page 161
ARGUING WITH RELATIVES AND CONSPIRACY THEORISTS......Page 162
WRAPPING UP......Page 163
EXERCISES......Page 164
IS THE CARNIVAL GAME REALLY FAIR?......Page 165
Searching for More Hypotheses with R......Page 167
Adding Priors to Our Likelihood Ratios......Page 169
BUILDING A PROBABILITY DISTRIBUTION......Page 171
FROM THE BAYES FACTOR TO PARAMETER ESTIMATION......Page 173
EXERCISES......Page 176
R AND RSTUDIO......Page 177
CREATING AN R SCRIPT......Page 178
Doubles......Page 179
Strings......Page 180
Missing Values......Page 181
Vectors......Page 182
FUNCTIONS......Page 183
Basic Functions......Page 184
The sum(), cumsum(), and diff() Functions......Page 185
The : operator and the seq() Function......Page 186
The ifelse() Function......Page 187
The runif() Function......Page 188
The sample() Function......Page 189
DEFINING YOUR OWN FUNCTIONS......Page 190
CREATING BASIC PLOTS......Page 192
EXERCISE: SIMULATING A STOCK PRICE......Page 195
SUMMARY......Page 196
FUNCTIONS......Page 197
Determining How Far You’ve Run......Page 199
Measuring the Area Under the Curve: The Integral......Page 200
Measuring the Rate of Change: The Derivative......Page 205
THE FUNDAMENTAL THEOREM OF CALCULUS......Page 209
ABOUT THE AUTHOR......Page 211