1 Probability Tips and Tricks A quick and dirty intro2 Why do we need probability? (Obligatory motivation slide) The world is full of random shit Our ...
1 Tips and Tricks Stéphane Vialette LIGM, Université Paris-Est Marne-la-Vallée November 14, 2011 Stéphane Vialette (LIGM, ...
1 Microsoft Excel Office 2016/2013/2010/2007 Tips and Tricks In Office 2007, the OFFICE BUTTON is the symbol at the top left of the screen. 1 Enter Fr...
1 Search Wizard Compass The search wizard allows you to perform a property search, then choose any or all of the management companies based on your re...
1 Science Tips and Tricks: 35 minutes 40 questions 7 passages(5 7q) Sep 20 7:18 AM The seven passages are about science. You do not have to know the a...
1 Esri International User Conference San Diego, California Technical Workshops July 23 27, 2012 ArcMap: Tips and Tricks Miriam Schmidts Jorge Ruiz-Val...
1 Uverse tips and tricks 08/13/2017 Retitrating up aripiprazole 08/13/ mg oxycodone k 56 08/15/2017 -Scottish accent generator -Iv to po dilaudid conv...
1 OWB Tips and Tricks Jean-Pierre Dijcks Senior Manager OWB Product Management2 Topics Match/Merge Capabilities Set based ...
1 Excel Tips and Tricks2 References Excel Annoyances - Curtis Frye Excel Hacks - O Reilly (Joseph Rubin) (Allen Wyatt) Some Excel Basics as well as ...
1 technical tips and tricks Filtering & grouping by schedule status Document author: Produced by: Andy Jessop Project Learning International Limit...
Probability Tips and Tricks A quick and dirty intro
Why do we need probability? (Obligatory motivation slide) • The world is full of random shit • Our job as professional nerds is to quantify that • Also, you’re sitting some kind of exam and want to pass, that’s probably enough motivation
Random variables • Some things occur randomly: these have probability distributions • A probability distribution describes how these random variables behave • In practice does this actually work?
Properties of probability distributions • The probability of anything happening has to lie between 0 and 1. • Probability =0 <- will not happen, no chance • Probability =1 <- certainty, no chance • Anything in between? <- randomness
Types of Probability Distributions • There are lots of types: • Probability Density Function • Cumulative Density Function • Marginal Probability • Joint Probability • Conditional Probability
Random Variables come in two kids • Discrete/categorical • Typical example: gender <- flawed example • Typical example: colour of your car <- boring example • Will my kids listen to me and turn off youtube at the end of the next minecraft video? Yes/no
• Continuous • Typical example: height/weight/income • Favourite example: how many Cadbury Crème eggs can I eat? <- continuous because I’m going to count them in fractional amounts, e.g. 2.5 eggs. It would be categorical/discrete if I only counted them in whole eggs
PDFs work differently for the two kinds of random variables • Fundamentally: it’s all about the area under the curve
• But for discrete random variables, the curve is not smooth and cannot be integrated, so we add instead
• Continuous random variables <- integrals
• The CDF is the integral of the probability density function up to the break point • The probability of a continuous random variable lying between two bounds is the integral between them
• Discrete random variables <- summations
• The CDF is the summation up to the break point • The probability of a discrete RV lying between two bounds is the summation between: beware start and end points!
Python walk through with Allen Downey • http://allendowney.blogspot.com.au/2016/06/what-isdistribution.html • Allen is a great data scientist and does a really good notebook walk through.
Conditional Probability Visual • http://setosa.io/conditional/?utm_content=buffereb70e&utm_mediu m=social&utm_source=twitter.com&utm_campaign=buffer • By Victor Powell- so what is a conditional probability?
Bayes’ Rule: The Linkage Between these Probabilities (and the closest thing stats nerds have to a turf war) P( F and D) P ( F D) = P ( D) • • • •
Conditional = Joint/Marginal – we can manipulate this Conditional * Marginal = Joint Marginal = Joint/Conditional The trick with Bayes’ Rule is manipulating it to give you what you need.
Question 4.45 from Groebner, Shannon and Fry: Business Statistics, 9th Edition, Pearson 2014.
Joint, Marginal and Conditional Probabilities • P(Supplier A) = 0.3 – marginal probability • P(Supplier B) = 0.7 – marginal probability
• P() is usually the marginal probability
• P(Defective|Supplier A) = 0.15 – conditional probability of defective given supplier A • P(Defective|Supplier B) = 0.10 – conditional probability of defective given supplier B • P(|) is the conditional probability
• P(Defective and Supplier A) is the joint probability- the probability of both things happening at the same time
Step (1) What do we want? • P(Supplier A|Defective) • P(Supplier B|Defective) • And to find out which is higher
Step (2) What do we have? • P(Supplier A) = 0.3 • P(Supplier B) = 0.7 • P(Defective|Supplier A) = 0.15 • P(Defective|Supplier B) = 0.10
We want to reverse these!
Step (3): Panic • OK don’t really: remember Bayes’ Rule • P(Supplier A|Defective)= P(Supplier A and Defective)/P(Defective) • But we don’t have either P(Supplier A and Defective) OR P(Defective)!!
Step (4): We just nailed Bayes’ Rule we can do this! • P(Defective|Supplier A)=P(Defective and Supplier A)/P(Supplier A)
We have these….!!!!
• So… • P(Defective and Supplier A)=P(Defective|Supplier A)*P(Supplier A)=0.15*0.3
Now we just need P(Defective) P(Defective) = P(Defective and Supplier A)+ P(Defective And Supplier B) - We are summing up both options P(Defective) =P(Defective|Supplier A)P(Supplier A) + P(Defective|Supplier B)P(Supplier B) (Bayes’ Rule again!)
= (0.15)(0.3) + (0.10)(0.7) = 0.115
Step (5): Plug these results into Step 3 • P(Defective and Supplier A)=0.45 • P(Defective)=0.115 • P(Supplier A|Defective)= P(Supplier A and Defective)/P(Defective) =0.45/0.115 =0.3913
Same for Supplier B • P(Supplier B|Defective) = (0.10)(0.7)/0.115 = 0.6087 • Supplier B is the most likely to have supplied the defective parts.