1 Think Bayes Bayesian Statistics Made Simple Version 1.0.5
3 Think Bayes Bayesian Statistics Made Simple Version Allen B. Downey Green Tea Press Needham, Massachusetts
4 Copyright 2012 Allen B. Downey. Green Tea Press 9 Washburn Ave Needham MA Permission is granted to copy, distribute, and/or modify this document under the terms of the Creative Commons Attribution-NonCommercial 3.0 Unported License, which is available at licenses/by-nc/3.0/.
5 Preface 0.1 My theory, which is mine The premise of this book, and the other books in the Think X series, is that if you know how to program, you can use that skill to learn other topics. Most books on Bayesian statistics use mathematical notation and present ideas in terms of mathematical concepts like calculus. This book uses Python code instead of math, and discrete approximations instead of continuous mathematics. As a result, what would be an integral in a math book becomes a summation, and most operations on probability distributions are simple loops. I think this presentation is easier to understand, at least for people with programming skills. It is also more general, because when we make modeling decisions, we can choose the most appropriate model without worrying too much about whether the model lends itself to conventional analysis. Also, it provides a smooth development path from simple examples to realworld problems. Chapter 3 is a good example. It starts with a simple example involving dice, one of the staples of basic probability. From there it proceeds in small steps to the locomotive problem, which I borrowed from Mosteller s Fifty Challenging Problems in Probability with Solutions, and from there to the German tank problem, a famously successful application of Bayesian methods during World War II. 0.2 Modeling and approximation Most chapters in this book are motivated by a real-world problem, so they involve some degree of modeling. Before we can apply Bayesian methods (or any other analysis), we have to make decisions about which parts of the
6 vi Chapter 0. Preface real-world system to include in the model and which details we can abstract away. For example, in Chapter 7, the motivating problem is to predict the winner of a hockey game. I model goal-scoring as a Poisson process, which implies that a goal is equally likely at any point in the game. That is not exactly true, but it is probably a good enough model for most purposes. In Chapter 12 the motivating problem is interpreting SAT scores (the SAT is a standardized test used for college admissions in the United States). I start with a simple model that assumes that all SAT questions are equally difficult, but in fact the designers of the SAT deliberately include some questions that are relatively easy and some that are relatively hard. I present a second model that accounts for this aspect of the design, and show that it doesn t have a big effect on the results after all. I think it is important to include modeling as an explicit part of problem solving because it reminds us to think about modeling errors (that is, errors due to simplifications and assumptions of the model). Many of the methods in this book are based on discrete distributions, which makes some people worry about numerical errors. But for real-world problems, numerical errors are almost always smaller than modeling errors. Furthermore, the discrete approach often allows better modeling decisions, and I would rather have an approximate solution to a good model than an exact solution to a bad model. On the other hand, continuous methods sometimes yield performance advantages for example by replacing a linear- or quadratic-time computation with a constant-time solution. So I recommend a general process with these steps: 1. While you are exploring a problem, start with simple models and implement them in code that is clear, readable, and demonstrably correct. Focus your attention on good modeling decisions, not optimization. 2. Once you have a simple model working, identify the biggest sources of error. You might need to increase the number of values in a discrete approximation, or increase the number of iterations in a Monte Carlo simulation, or add details to the model. 3. If the performance of your solution is good enough for your application, you might not have to do any optimization. But if you do, there are two approaches to consider. You can review your code and look
7 0.3. Working with the code vii for optimizations; for example, if you cache previously computed results you might be able to avoid redundant computation. Or you can look for analytic methods that yield computational shortcuts. One benefit of this process is that Steps 1 and 2 tend to be fast, so you can explore several alternative models before investing heavily in any of them. Another benefit is that if you get to Step 3, you will be starting with a reference implementation that is likely to be correct, which you can use for regression testing (that is, checking that the optimized code yields the same results, at least approximately). 0.3 Working with the code Many of the examples in this book use classes and functions defined in thinkbayes.py. You can download this module from com/thinkbayes.py. Most chapters contain references to code you can download from http: //thinkbayes.com. Some of those files have dependencies you will also have to download. I suggest you keep all of these files in the same directory so they can import each other without changing the Python search path. You can download these files one at a time as you need them, or you can download them all at once from code.zip. This file also contains the data files used by some of the programs. When you unzip it, it creates a directory named thinkbayes_code that contains all the code used in this book. Or, if you are a Git user, you can get all of the files at once by forking and cloning this repository: https://github.com/allendowney/thinkbayes. One of the modules I use is thinkplot.py, which provides wrappers for some of the functions in pyplot. To use it, you need to install matplotlib. If you don t already have it, check your package manager to see if it is available. Otherwise you can get download instructions from http: //matplotlib.org. Finally, some programs in this book use NumPy and SciPy, which are available from and
8 viii Chapter 0. Preface 0.4 Code style Experienced Python programmers will notice that the code in this book does not comply with PEP 8, which is the most common style guide for Python (http://www.python.org/dev/peps/pep-0008/). Specifically, PEP 8 calls for lowercase function names with underscores between words, like_this. In this book and the accompanying code, function and method names begin with a capital letter and use camel case, LikeThis. I broke this rule because I developed some of the code while I was a Visiting Scientist at Google, so I followed the Google style guide, which deviates from PEP 8 in a few places. Once I got used to Google style, I found that I liked it. And at this point, it would be too much trouble to change. Also on the topic of style, I write Bayes s theorem with an s after the apostrophe, which is preferred in some style guides and deprecated in others. I don t have a strong preference. I had to choose one, and this is the one I chose. And finally one typographical note: throughout the book, I use PMF and CDF for the mathematical concept of a probability mass function or cumulative distribution function, and Pmf and Cdf to refer to the Python objects I use to represent them. 0.5 Prerequisites There are several excellent modules for doing Bayesian statistics in Python, including pymc and OpenBUGS. I chose not to use them for this book because you need a fair amount of background knowledge to get started with these modules, and I want to keep the prerequisites minimal. If you know Python and a little bit about probability, you are ready to start this book. Chapter 1 is about probability and Bayes s theorem; it has no code. Chapter 2 introduces Pmf, a thinly disguised Python dictionary I use to represent a probability mass function (PMF). Then Chapter 3 introduces Suite, a kind of Pmf that provides a framework for doing Bayesian updates. And that s just about all there is to it. Well, almost. In some of the later chapters, I use analytic distributions including the Gaussian (normal) distribution, the exponential and Poisson distributions, and the beta distribution. In Chapter 15 I break out the lesscommon Dirichlet distribution, but I explain it as I go along. If you are not
9 0.5. Prerequisites ix familiar with these distributions, you can read about them on Wikipedia. You could also read the companion to this book, Think Stats, or an introductory statistics book (although I m afraid most of them take a mathematical approach that is not particularly helpful for practical purposes). Contributor List If you have a suggestion or correction, please send to If I make a change based on your feedback, I will add you to the contributor list (unless you ask to be omitted). If you include at least part of the sentence the error appears in, that makes it easy for me to search. Page and section numbers are fine, too, but not as easy to work with. Thanks! First, I have to acknowledge David MacKay s excellent book, Information Theory, Inference, and Learning Algorithms, which is where I first came to understand Bayesian methods. With his permission, I use several problems from his book as examples. This book also benefited from my interactions with Sanjoy Mahajan, especially in fall 2012, when I audited his class on Bayesian Inference at Olin College. I wrote parts of this book during project nights with the Boston Python User Group, so I would like to thank them for their company and pizza. Jonathan Edwards sent in the first typo. George Purkins found a markup error. Olivier Yiptong sent several helpful suggestions. Yuriy Pasichnyk found several errors. Kristopher Overholt sent a long list of corrections and suggestions. Robert Marcus found a misplaced i. Max Hailperin suggested a clarification in Chapter 1. Markus Dobler pointed out that drawing cookies from a bowl with replacement is an unrealistic scenario. Tom Pollard and Paul A. Giannaros spotted a version problem with some of the numbers in the train example.
10 x Chapter 0. Preface Ram Limbu found a typo and suggested a clarification. In spring 2013, students in my class, Computational Bayesian Statistics, made many helpful corrections and suggestions: Kai Austin, Claire Barnes, Kari Bender, Rachel Boy, Kat Mendoza, Arjun Iyer, Ben Kroop, Nathan Lintz, Kyle McConnaughay, Alec Radford, Brendan Ritter, and Evan Simpson. Greg Marra and Matt Aasted helped me clarify the discussion of The Price is Right problem. Marcus Ogren pointed out that the original statement of the locomotive problem was ambiguous. Jasmine Kwityn and Dan Fauxsmith at O Reilly Media proofread the book and found many opportunities for improvement. James Lawry spotted a math error. Ben Kahle found a reference to the wrong figure. Jeffrey Law found an inconsistency between the text and the code.
11 Contents Preface v 0.1 My theory, which is mine v 0.2 Modeling and approximation v 0.3 Working with the code vii 0.4 Code style viii 0.5 Prerequisites viii 1 Bayes s Theorem Conditional probability Conjoint probability The cookie problem Bayes s theorem The diachronic interpretation The M&M problem The Monty Hall problem Discussion Computational Statistics Distributions The cookie problem
12 xii Contents 2.3 The Bayesian framework The Monty Hall problem Encapsulating the framework The M&M problem Discussion Exercises Estimation The dice problem The locomotive problem What about that prior? An alternative prior Credible intervals Cumulative distribution functions The German tank problem Discussion Exercises More Estimation The Euro problem Summarizing the posterior Swamping the priors Optimization The beta distribution Discussion Exercises
13 Contents xiii 5 Odds and Addends Odds The odds form of Bayes s theorem Oliver s blood Addends Maxima Mixtures Discussion Decision Analysis The Price is Right problem The prior Probability density functions Representing PDFs Modeling the contestants Likelihood Update Optimal bidding Discussion Prediction The Boston Bruins problem Poisson processes The posteriors The distribution of goals The probability of winning Sudden death Discussion Exercises
14 xiv Contents 8 Observer Bias The Red Line problem The model Wait times Predicting wait times Estimating the arrival rate Incorporating uncertainty Decision analysis Discussion Exercises Two Dimensions Paintball The suite Trigonometry Likelihood Joint distributions Conditional distributions Credible intervals Discussion Exercises Approximate Bayesian Computation The Variability Hypothesis Mean and standard deviation Update The posterior distribution of CV
15 Contents xv 10.5 Underflow Log-likelihood A little optimization ABC Robust estimation Who is more variable? Discussion Exercises Hypothesis Testing Back to the Euro problem Making a fair comparison The triangle prior Discussion Exercises Evidence Interpreting SAT scores The scale The prior Posterior A better model Calibration Posterior distribution of efficacy Predictive distribution Discussion
16 xvi Contents 13 Simulation The Kidney Tumor problem A simple model A more general model Implementation Caching the joint distribution Conditional distributions Serial Correlation Discussion A Hierarchical Model The Geiger counter problem Start simple Make it hierarchical A little optimization Extracting the posteriors Discussion Exercises Dealing with Dimensions Belly button bacteria Lions and tigers and bears The hierarchical version Random sampling Optimization Collapsing the hierarchy One more problem
17 Contents xvii 15.8 We re not done yet The belly button data Predictive distributions Joint posterior Coverage Discussion
18 xviii Contents
19 Chapter 1 Bayes s Theorem 1.1 Conditional probability The fundamental idea behind all Bayesian statistics is Bayes s theorem, which is surprisingly easy to derive, provided that you understand conditional probability. So we ll start with probability, then conditional probability, then Bayes s theorem, and on to Bayesian statistics. A probability is a number between 0 and 1 (including both) that represents a degree of belief in a fact or prediction. The value 1 represents certainty that a fact is true, or that a prediction will come true. The value 0 represents certainty that the fact is false. Intermediate values represent degrees of certainty. The value 0.5, often written as 50%, means that a predicted outcome is as likely to happen as not. For example, the probability that a tossed coin lands face up is very close to 50%. A conditional probability is a probability based on some background information. For example, I want to know the probability that I will have a heart attack in the next year. According to the CDC, Every year about 785,000 Americans have a first coronary attack. (http://www.cdc.gov/ heartdisease/facts.htm) The U.S. population is about 311 million, so the probability that a randomly chosen American will have a heart attack in the next year is roughly 0.3%. But I am not a randomly chosen American. Epidemiologists have identified many factors that affect the risk of heart attacks; depending on those factors, my risk might be higher or lower than average.
20 2 Chapter 1. Bayes s Theorem I am male, 45 years old, and I have borderline high cholesterol. Those factors increase my chances. However, I have low blood pressure and I don t smoke, and those factors decrease my chances. Plugging everything into the online calculator at nih.gov/calculator.asp, I find that my risk of a heart attack in the next year is about 0.2%, less than the national average. That value is a conditional probability, because it is based on a number of factors that make up my condition. The usual notation for conditional probability is p(a B), which is the probability of A given that B is true. In this example, A represents the prediction that I will have a heart attack in the next year, and B is the set of conditions I listed. 1.2 Conjoint probability Conjoint probability is a fancy way to say the probability that two things are true. I write p(a and B) to mean the probability that A and B are both true. If you learned about probability in the context of coin tosses and dice, you might have learned the following formula: p(a and B) = p(a) p(b) WARNING: not always true For example, if I toss two coins, and A means the first coin lands face up, and B means the second coin lands face up, then p(a) = p(b) = 0.5, and sure enough, p(a and B) = p(a) p(b) = But this formula only works because in this case A and B are independent; that is, knowing the outcome of the first event does not change the probability of the second. Or, more formally, p(b A) = p(b). Here is a different example where the events are not independent. Suppose that A means that it rains today and B means that it rains tomorrow. If I know that it rained today, it is more likely that it will rain tomorrow, so p(b A) > p(b). In general, the probability of a conjunction is p(a and B) = p(a) p(b A)
21 1.3. The cookie problem 3 for any A and B. So if the chance of rain on any given day is 0.5, the chance of rain on two consecutive days is not 0.25, but probably a bit higher. 1.3 The cookie problem We ll get to Bayes s theorem soon, but I want to motivate it with an example called the cookie problem. 1 Suppose there are two bowls of cookies. Bowl 1 contains 30 vanilla cookies and 10 chocolate cookies. Bowl 2 contains 20 of each. Now suppose you choose one of the bowls at random and, without looking, select a cookie at random. The cookie is vanilla. What is the probability that it came from Bowl 1? This is a conditional probability; we want p(bowl 1 vanilla), but it is not obvious how to compute it. If I asked a different question the probability of a vanilla cookie given Bowl 1 it would be easy: p(vanilla Bowl 1) = 3/4 Sadly, p(a B) is not the same as p(b A), but there is a way to get from one to the other: Bayes s theorem. 1.4 Bayes s theorem At this point we have everything we need to derive Bayes s theorem. We ll start with the observation that conjunction is commutative; that is for any events A and B. p(a and B) = p(b and A) Next, we write the probability of a conjunction: p(a and B) = p(a) p(b A) Since we have not said anything about what A and B mean, they are interchangeable. Interchanging them yields p(b and A) = p(b) p(a B) 1 Based on an example from that is no longer there.
22 4 Chapter 1. Bayes s Theorem That s all we need. Pulling those pieces together, we get p(b) p(a B) = p(a) p(b A) Which means there are two ways to compute the conjunction. If you have p(a), you multiply by the conditional probability p(b A). Or you can do it the other way around; if you know p(b), you multiply by p(a B). Either way you should get the same thing. Finally we can divide through by p(b): p(a B) = p(a) p(b A) p(b) And that s Bayes s theorem! It might not look like much, but it turns out to be surprisingly powerful. For example, we can use it to solve the cookie problem. I ll write B 1 for the hypothesis that the cookie came from Bowl 1 and V for the vanilla cookie. Plugging in Bayes s theorem we get p(b 1 V) = p(b 1) p(v B 1 ) p(v) The term on the left is what we want: the probability of Bowl 1, given that we chose a vanilla cookie. The terms on the right are: p(b 1 ): This is the probability that we chose Bowl 1, unconditioned by what kind of cookie we got. Since the problem says we chose a bowl at random, we can assume p(b 1 ) = 1/2. p(v B 1 ): This is the probability of getting a vanilla cookie from Bowl 1, which is 3/4. p(v): This is the probability of drawing a vanilla cookie from either bowl. Since we had an equal chance of choosing either bowl and the bowls contain the same number of cookies, we had the same chance of choosing any cookie. Between the two bowls there are 50 vanilla and 30 chocolate cookies, so p(v) = 5/8. Putting it together, we have p(b 1 V) = (1/2) (3/4) 5/8
23 1.5. The diachronic interpretation 5 which reduces to 3/5. So the vanilla cookie is evidence in favor of the hypothesis that we chose Bowl 1, because vanilla cookies are more likely to come from Bowl 1. This example demonstrates one use of Bayes s theorem: it provides a strategy to get from p(b A) to p(a B). This strategy is useful in cases, like the cookie problem, where it is easier to compute the terms on the right side of Bayes s theorem than the term on the left. 1.5 The diachronic interpretation There is another way to think of Bayes s theorem: it gives us a way to update the probability of a hypothesis, H, in light of some body of data, D. This way of thinking about Bayes s theorem is called the diachronic interpretation. Diachronic means that something is happening over time; in this case the probability of the hypotheses changes, over time, as we see new data. Rewriting Bayes s theorem with H and D yields: p(h D) = p(h) p(d H) p(d) In this interpretation, each term has a name: p(h) is the probability of the hypothesis before we see the data, called the prior probability, or just prior. p(h D) is what we want to compute, the probability of the hypothesis after we see the data, called the posterior. p(d H) is the probability of the data under the hypothesis, called the likelihood. p(d) is the probability of the data under any hypothesis, called the normalizing constant. Sometimes we can compute the prior based on background information. For example, the cookie problem specifies that we choose a bowl at random with equal probability.
24 6 Chapter 1. Bayes s Theorem In other cases the prior is subjective; that is, reasonable people might disagree, either because they use different background information or because they interpret the same information differently. The likelihood is usually the easiest part to compute. In the cookie problem, if we know which bowl the cookie came from, we find the probability of a vanilla cookie by counting. The normalizing constant can be tricky. It is supposed to be the probability of seeing the data under any hypothesis at all, but in the most general case it is hard to nail down what that means. Most often we simplify things by specifying a set of hypotheses that are Mutually exclusive: At most one hypothesis in the set can be true, and Collectively exhaustive: There are no other possibilities; at least one of the hypotheses has to be true. I use the word suite for a set of hypotheses that has these properties. In the cookie problem, there are only two hypotheses the cookie came from Bowl 1 or Bowl 2 and they are mutually exclusive and collectively exhaustive. In that case we can compute p(d) using the law of total probability, which says that if there are two exclusive ways that something might happen, you can add up the probabilities like this: p(d) = p(b 1 ) p(d B 1 ) + p(b 2 ) p(d B 2 ) Plugging in the values from the cookie problem, we have p(d) = (1/2) (3/4) + (1/2) (1/2) = 5/8 which is what we computed earlier by mentally combining the two bowls. 1.6 The M&M problem M&M s are small candy-coated chocolates that come in a variety of colors. Mars, Inc., which makes M&M s, changes the mixture of colors from time to time.
25 1.6. The M&M problem 7 In 1995, they introduced blue M&M s. Before then, the color mix in a bag of plain M&M s was 30% Brown, 20% Yellow, 20% Red, 10% Green, 10% Orange, 10% Tan. Afterward it was 24% Blue, 20% Green, 16% Orange, 14% Yellow, 13% Red, 13% Brown. Suppose a friend of mine has two bags of M&M s, and he tells me that one is from 1994 and one from He won t tell me which is which, but he gives me one M&M from each bag. One is yellow and one is green. What is the probability that the yellow one came from the 1994 bag? This problem is similar to the cookie problem, with the twist that I draw one sample from each bowl/bag. This problem also gives me a chance to demonstrate the table method, which is useful for solving problems like this on paper. In the next chapter we will solve them computationally. The first step is to enumerate the hypotheses. The bag the yellow M&M came from I ll call Bag 1; I ll call the other Bag 2. So the hypotheses are: A: Bag 1 is from 1994, which implies that Bag 2 is from B: Bag 1 is from 1996 and Bag 2 from Now we construct a table with a row for each hypothesis and a column for each term in Bayes s theorem: Prior Likelihood Posterior p(h) p(d H) p(h) p(d H) p(h D) A 1/2 (20)(20) /27 B 1/2 (14)(10) 70 7/27 The first column has the priors. Based on the statement of the problem, it is reasonable to choose p(a) = p(b) = 1/2. The second column has the likelihoods, which follow from the information in the problem. For example, if A is true, the yellow M&M came from the 1994 bag with probability 20%, and the green came from the 1996 bag with probability 20%. If B is true, the yellow M&M came from the 1996 bag with probability 14%, and the green came from the 1994 bag with probability 10%. Because the selections are independent, we get the conjoint probability by multiplying. The third column is just the product of the previous two. The sum of this column, 270, is the normalizing constant. To get the last column, which
CS 70 Discrete Mathematics and Probability Theory Fall 2009 Satish Rao,David Tse Note Conditional Probability A pharmaceutical company is marketing a new test for a certain medical condition. According
Unit 19: Probability Models Summary of Video Probability is the language of uncertainty. Using statistics, we can better predict the outcomes of random phenomena over the long term from the very complex,
Book Review of Rosenhouse, The Monty Hall Problem Leslie Burkholder 1 The Monty Hall Problem, Jason Rosenhouse, New York, Oxford University Press, 2009, xii, 195 pp, US $24.95, ISBN 978-0-19-5#6789-8 (Source
BNG 202 Biomechanics Lab Descriptive statistics and probability distributions I Overview The overall goal of this short course in statistics is to provide an introduction to descriptive and inferential
1 2 CONTENTS OF DAY 2 I. More Precise Definition of Simple Random Sample 3 Connection with independent random variables 3 Problems with small populations 8 II. Why Random Sampling is Important 9 A myth,
WEEK #22: PDFs and CDFs, Measures of Center and Spread Goals: Explore the effect of independent events in probability calculations. Present a number of ways to represent probability distributions. Textbook
Discrete Math in Computer Science Homework 7 Solutions (Max Points: 80) CS 30, Winter 2016 by Prasad Jayanti 1. (10 points) Here is the famous Monty Hall Puzzle. Suppose you are on a game show, and you
Bayesian Analysis for the Social Sciences Simon Jackman Stanford University http://jackman.stanford.edu/bass November 9, 2012 Simon Jackman (Stanford) Bayesian Analysis for the Social Sciences November
Probabilities and Random Variables This is an elementary overview of the basic concepts of probability theory. 1 The Probability Space The purpose of probability theory is to model random experiments so
Statistics and Probability TABLE OF CONTENTS 1 Posing Questions and Gathering Data. 2 2 Representing Data. 7 3 Interpreting and Evaluating Data 13 4 Exploring Probability..17 5 Games of Chance 20 6 Ideas
CS 70 Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 10 Introduction to Discrete Probability Probability theory has its origins in gambling analyzing card games, dice,
AP Stats - Probability Review Multiple Choice Identify the choice that best completes the statement or answers the question. 1. I toss a penny and observe whether it lands heads up or tails up. Suppose
Using simulation to calculate the NPV of a project Marius Holtan Onward Inc. 5/31/2002 Monte Carlo simulation is fast becoming the technology of choice for evaluating and analyzing assets, be it pure financial
Statistics for Engineers 4-1 4. Introduction to Statistics Descriptive Statistics Types of data A variate or random variable is a quantity or attribute whose value may vary from one unit of investigation
Summary of Probability Mathematical Physics I Rules of Probability The probability of an event is called P(A), which is a positive number less than or equal to 1. The total probability for all possible
Lecture 4 Nancy Pfenning Stats 000 Chapter 7: Probability Last time we established some basic definitions and rules of probability: Rule : P (A C ) = P (A). Rule 2: In general, the probability of one event
MINITAB ASSISTANT WHITE PAPER This paper explains the research conducted by Minitab statisticians to develop the methods and data checks used in the Assistant in Minitab 17 Statistical Software. One-Way
COLLEGE ALGEBRA Paul Dawkins Table of Contents Preface... iii Outline... iv Preliminaries... Introduction... Integer Exponents... Rational Exponents... 9 Real Exponents...5 Radicals...6 Polynomials...5
Institute of Actuaries of India Subject CT3 Probability and Mathematical Statistics For 2015 Examinations Aim The aim of the Probability and Mathematical Statistics subject is to provide a grounding in
A Few Basics of Probability Philosophy 57 Spring, 2004 1 Introduction This handout distinguishes between inductive and deductive logic, and then introduces probability, a concept essential to the study
Assignment 2: Option Pricing and the Black-Scholes formula The University of British Columbia Science One CS 2015-2016 Instructor: Michael Gelbart Overview Due Thursday, November 12th at 11:59pm Last updated
Problem sets for BUEC 333 Part 1: Probability and Statistics I will indicate the relevant exercises for each week at the end of the Wednesday lecture. Numbered exercises are back-of-chapter exercises from
6.42/8.62J Mathematics for Computer Science Srini Devadas and Eric Lehman May 3, 25 Lecture otes Expected Value I The expectation or expected value of a random variable is a single number that tells you
Key Terms for This Session Session 8 Probability Previously Introduced frequency New in This Session binomial experiment binomial probability model experimental probability mathematical probability outcome
VISUAL ALGEBRA FOR COLLEGE STUDENTS Laurie J. Burton Western Oregon University VISUAL ALGEBRA FOR COLLEGE STUDENTS TABLE OF CONTENTS Welcome and Introduction 1 Chapter 1: INTEGERS AND INTEGER OPERATIONS
Comparison of frequentist and Bayesian inference. Class 20, 18.05, Spring 2014 Jeremy Orloff and Jonathan Bloom 1 Learning Goals 1. Be able to explain the difference between the p-value and a posterior
DECISION MAKING UNDER UNCERTAINTY: Models and Choices Charles A. Holloway Stanford University TECHNISCHE HOCHSCHULE DARMSTADT Fachbereich 1 Gesamtbibliothek Betrtebswirtscrtaftslehre tnventar-nr. :...2>2&,...S'.?S7.
Money & Finance I. UNIT OVERVIEW & PURPOSE: The purpose of this unit is for students to learn how savings accounts, annuities, loans, and credit cards work. All students need a basic understanding of how
238 CHAPTER 3. DISCRETE DYNAMICAL SYSTEMS WITH MANY VARIABLES 3.2 Roulette and Markov Chains In this section we will be discussing an application of systems of recursion equations called Markov Chains.
Math 141 Lecture 2: More Probability! Albyn Jones 1 1 Library 304 email@example.com www.people.reed.edu/ jones/courses/141 Outline Law of total probability Bayes Theorem the Multiplication Rule, again Recall
A Concrete Introduction to the Abstract Concepts of Integers and Algebra using Algebra Tiles Table of Contents Introduction... 1 page Integers 1: Introduction to Integers... 3 2: Working with Algebra Tiles...
Using Laws of Probability Sloan Fellows/Management of Technology Summer 2003 Uncertain events Outline The laws of probability Random variables (discrete and continuous) Probability distribution Histogram
Week 2: Conditional Probability and Bayes formula We ask the following question: suppose we know that a certain event B has occurred. How does this impact the probability of some other A. This question
Why Taking This Course? Course Introduction, Descriptive Statistics and Data Visualization GENOME 560, Spring 2012 Data are interesting because they help us understand the world Genomics: Massive Amounts
Curriculum Map Statistics and Probability Honors (348) Saugus High School Saugus Public Schools 2009-2010 Week 1 Week 2 14.0 Students organize and describe distributions of data by using a number of different
"PRINCIPLES OF PHYLOGENETICS: ECOLOGY AND EVOLUTION" Integrative Biology 200B University of California, Berkeley Spring 2009 N Hallinan Likelihood: Frequentist vs Bayesian Reasoning Stochastic odels and
Lecture 1 Introduction Properties of Probability Methods of Enumeration Asrat Temesgen Stockholm University 1 Chapter 1 Probability 1.1 Basic Concepts In the study of statistics, we consider experiments
Introduction and Overview Probability and Statistics is a topic that is quickly growing, has become a major part of our educational program, and has a substantial role in the NCTM Standards. While covering
L10: Probability, statistics, and estimation theory Review of probability theory Bayes theorem Statistics and the Normal distribution Least Squares Error estimation Maximum Likelihood estimation Bayesian
ECON 459 Game Theory Lecture Notes Auctions Luca Anderlini Spring 2015 These notes have been used before. If you can still spot any errors or have any suggestions for improvement, please let me know. 1
AMS 5 CHANCE VARIABILITY The Law of Averages When tossing a fair coin the chances of tails and heads are the same: 50% and 50%. So if the coin is tossed a large number of times, the number of heads and
Appendix D: The Monty Hall Controversy Appendix D: The Monty Hall Controversy - Page 1 Let's Make a Deal Prepared by Rich Williams, Spring 1991 Last Modified Fall, 2004 You are playing Let's Make a Deal
Business Analytics Methods, Models, and Decisions James R. Evans : University of Cincinnati PEARSON Boston Columbus Indianapolis New York San Francisco Upper Saddle River Amsterdam Cape Town Dubai London
4.3 Probability (4-3) 727 4.3 PROBABILITY In this section In the two preceding sections we were concerned with counting the number of different outcomes to an experiment. We now use those counting techniques
Probability Models.S1 Introduction to Probability Operations Research Models and Methods Paul A. Jensen and Jonathan F. Bard The stochastic chapters of this book involve random variability. Decisions are
Lecture Note 1 Set and Probability Theory MIT 14.30 Spring 2006 Herman Bennett 1 Set Theory 1.1 Definitions and Theorems 1. Experiment: any action or process whose outcome is subject to uncertainty. 2.
Section 7C: The Law of Large Numbers Example. You flip a coin 00 times. Suppose the coin is fair. How many times would you expect to get heads? tails? One would expect a fair coin to come up heads half
Problem 3 If A is divided by B the result is 2/3. If B is divided by C the result is 4/7. What is the result if A is divided by C? Suggested Questions to ask students about Problem 3 The key to this question
Stat 20: Intro to Probability and Statistics Lecture 16: More Box Models Tessa L. Childers-Day UC Berkeley 22 July 2014 By the end of this lecture... You will be able to: Determine what we expect the sum
INTRODUCTORY STATISTICS FIFTH EDITION Thomas H. Wonnacott University of Western Ontario Ronald J. Wonnacott University of Western Ontario WILEY JOHN WILEY & SONS New York Chichester Brisbane Toronto Singapore
14:440:127 Introduction to Computers for Engineers Notes for Lecture 06 Rutgers University, Spring 2010 Instructor- Blase E. Ur 1 Loop Examples 1.1 Example- Sum Primes Let s say we wanted to sum all 1,
The equivalence of logistic regression and maximum entropy models John Mount September 23, 20 Abstract As our colleague so aptly demonstrated ( http://www.win-vector.com/blog/20/09/the-simplerderivation-of-logistic-regression/
E3: PROBABILITY AND STATISTICS lecture notes 2 Contents 1 PROBABILITY THEORY 7 1.1 Experiments and random events............................ 7 1.2 Certain event. Impossible event............................
17. Chi Square A. Chi Square Distribution B. One-Way Tables C. Contingency Tables D. Exercises Chi Square is a distribution that has proven to be particularly useful in statistics. The first section describes
Joint Probability Distributions and Random Samples (Devore Chapter Five) 1016-345-01 Probability and Statistics for Engineers Winter 2010-2011 Contents 1 Joint Probability Distributions 1 1.1 Two Discrete
Evaluating Trading Systems By John Ehlers and Ric Way INTRODUCTION What is the best way to evaluate the performance of a trading system? Conventional wisdom holds that the best way is to examine the system
Introduction to Computation and Programming Using Python Revised and Expanded Edition John V. Guttag The MIT Press Cambridge, Massachusetts London, England CONTENTS PREFACE xiii ACKNOWLEDGMENTS xv 1 GETTING
Bayesian Tutorial (Sheet Updated 20 March) Practice Questions (for discussing in Class) Week starting 21 March 2016 1. What is the probability that the total of two dice will be greater than 8, given that
Chicago Booth BUSINESS STATISTICS 41000 Final Exam Fall 2011 Name: Section: I pledge my honor that I have not violated the Honor Code Signature: This exam has 34 pages. You have 3 hours to complete this
Lecture 13 Understanding Probability and Long-Term Expectations Thinking Challenge What s the probability of getting a head on the toss of a single fair coin? Use a scale from 0 (no way) to 1 (sure thing).
Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay Lecture - 17 Shannon-Fano-Elias Coding and Introduction to Arithmetic Coding
MONT 07N Understanding Randomness Solutions For Final Examination May, 00 Short Answer (a) (0) How are the EV and SE for the sum of n draws with replacement from a box computed? Solution: The EV is n times
Chapter 5 A Survey of Probability Concepts True/False 1. Based on a classical approach, the probability of an event is defined as the number of favorable outcomes divided by the total number of possible
VISUAL GUIDE to RX Scripting for Roulette Xtreme - System Designer 2.0 UX Software - 2009 TABLE OF CONTENTS INTRODUCTION... ii What is this book about?... iii How to use this book... iii Time to start...
Programming Your Calculator Casio fx-7400g PLUS Barry Kissane Programming Your Calculator: Casio fx-7400g PLUS Published by Shriro Australia Pty Limited 72-74 Gibbes Street, Chatswood NSW 2067, Australia
RUTHERFORD HIGH SCHOOL Rutherford, New Jersey COURSE OUTLINE STATISTICS AND PROBABILITY I. INTRODUCTION According to the Common Core Standards (2010), Decisions or predictions are often based on data numbers
PROBABILITY AND LIKELIHOOD, A BRIEF INTRODUCTION IN SUPPORT OF A COURSE ON MOLECULAR EVOLUTION (BIOL 3046) Probability The subject of PROBABILITY is a branch of mathematics dedicated to building models
Lab 11 Simulations In this lab you ll learn how to create simulations to provide approximate answers to probability questions. We ll make use of a particular kind of structure, called a box model, that
Chapter 4 Probability Distributions Lesson 4-1/4-2 Random Variable Probability Distributions This chapter will deal the construction of probability distribution. By combining the methods of descriptive
Artificial Intelligence 15-381 Mar 27, 2007 Bayesian Networks 1 Recap of last lecture Probability: precise representation of uncertainty Probability theory: optimal updating of knowledge based on new information
Spring 2006 This exam contains 7 questions. You should attempt them all. Each question is divided into parts to help lead you through the material. You should attempt to complete as much of each problem
Population and sample Sampling and Hypothesis Testing Allin Cottrell Population : an entire set of objects or units of observation of one sort or another. Sample : subset of a population. Parameter versus
An Innocent Investigation D. Joyce, Clark University January 2006 The beginning. Have you ever wondered why every number is either even or odd? I don t mean to ask if you ever wondered whether every number
1 3.1 Sample Spaces and Tree Diagrams Probability This section introduces terminology and some techniques which will eventually lead us to the basic concept of the probability of an event. The Rare Event
Lecture 3: Linear methods for classification Rafael A. Irizarry and Hector Corrada Bravo February, 2010 Today we describe four specific algorithms useful for classification problems: linear regression,
Expectation Statistics and Random Variables Math 425 Introduction to Probability Lecture 4 Kenneth Harris firstname.lastname@example.org Department of Mathematics University of Michigan February 9, 2009 When a large
CS 70 Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 3 Random Variables: Distribution and Expectation Random Variables Question: The homeworks of 20 students are collected
Chapter 4 One-Way ANOVA Recall this chart that showed how most of our course would be organized: Explanatory Variable(s) Response Variable Methods Categorical Categorical Contingency Tables Categorical
Hypothesis Testing for Beginners Michele Piffer LSE August, 2011 Michele Piffer (LSE) Hypothesis Testing for Beginners August, 2011 1 / 53 One year ago a friend asked me to put down some easy-to-read notes
Conditional Probability, Independence and Bayes Theorem Class 3, 18.05, Spring 2014 Jeremy Orloff and Jonathan Bloom 1 Learning Goals 1. Know the definitions of conditional probability and independence
What does it mean for something to be random? An event is called random if the process which produces the outcome is sufficiently complicated that we are unable to predict the precise result and are instead
Gaming the Law of Large Numbers Thomas Hoffman and Bart Snapp July 3, 2012 Many of us view mathematics as a rich and wonderfully elaborate game. In turn, games can be used to illustrate mathematical ideas.
ECE302 Spring 2006 HW3 Solutions February 2, 2006 1 Solutions to HW3 Note: Most of these solutions were generated by R. D. Yates and D. J. Goodman, the authors of our textbook. I have added comments in