Poisson Chris Piech CS109, Stanford University. Piech, CS106A, Stanford University

Similar documents
Debugging Intuition. How to calculate the probability of at least k successes in n trials?

Lecture 08: Poisson and More. Lisa Yan July 13, 2018

Continuous Variables Chris Piech CS109, Stanford University

a zoo of (discrete) random variables

Binomial in the Limit

a zoo of (discrete) random variables

Bernoulli and Binomial

CSE 312, 2011 Winter, W.L.Ruzzo. 6. random variables

Lecture 13: Covariance. Lisa Yan July 25, 2018

The Random Variable for Probabilities Chris Piech CS109, Stanford University

The Random Variable for Probabilities Chris Piech CS109, Stanford University

Lecture 10: Normal RV. Lisa Yan July 18, 2018

3.4. The Binomial Probability Distribution

Central Theorems Chris Piech CS109, Stanford University

More discrete distributions

Conditional distributions

Lecture 18: Central Limit Theorem. Lisa Yan August 6, 2018

Random Variables Chris Piech CS109, Stanford University. Piech, CS106A, Stanford University

Math/Stat 352 Lecture 8

Discrete Random Variables

Common Discrete Distributions

CS 361: Probability & Statistics

Bernoulli and Binomial Distributions. Notes. Bernoulli Trials. Bernoulli/Binomial Random Variables Bernoulli and Binomial Distributions.

Massachusetts Institute of Technology

Binomial and Poisson Probability Distributions

EE/CpE 345. Modeling and Simulation. Fall Class 5 September 30, 2002

Guidelines for Solving Probability Problems

3 Multiple Discrete Random Variables

random variables T T T T H T H H

Lecture Notes 7 Random Processes. Markov Processes Markov Chains. Random Processes

Lecture 2: Discrete Probability Distributions

CS 237: Probability in Computing

It can be shown that if X 1 ;X 2 ;:::;X n are independent r.v. s with

Lecture 13. Poisson Distribution. Text: A Course in Probability by Weiss 5.5. STAT 225 Introduction to Probability Models February 16, 2014

Lecture 2 Binomial and Poisson Probability Distributions

ELEG 3143 Probability & Stochastic Process Ch. 2 Discrete Random Variables

Special Discrete RV s. Then X = the number of successes is a binomial RV. X ~ Bin(n,p).

Continuous Random Variables. What continuous random variables are and how to use them. I can give a definition of a continuous random variable.

Suppose that you have three coins. Coin A is fair, coin B shows heads with probability 0.6 and coin C shows heads with probability 0.8.

Problem Set #5. Due: 1pm on Friday, Nov 16th

Independent random variables

Closed book and notes. 120 minutes. Cover page, five pages of exam. No calculators.

A Probability Primer. A random walk down a probabilistic path leading to some stochastic thoughts on chance events and uncertain outcomes.

CMPSCI 240: Reasoning Under Uncertainty

Review of Probability. CS1538: Introduction to Simulations

EXAM. Exam #1. Math 3342 Summer II, July 21, 2000 ANSWERS

CDA6530: Performance Models of Computers and Networks. Chapter 2: Review of Practical Random Variables

Stat Lecture 20. Last class we introduced the covariance and correlation between two jointly distributed random variables.

Introduction and Overview STAT 421, SP Course Instructor

Lecture 12. Poisson random variables

Lecture Notes 2 Random Variables. Discrete Random Variables: Probability mass function (pmf)

Lecture 14. Text: A Course in Probability by Weiss 5.6. STAT 225 Introduction to Probability Models February 23, Whitney Huang Purdue University

Discrete Distributions

Random variables. DS GA 1002 Probability and Statistics for Data Science.

Queueing Theory and Simulation. Introduction

Chapter 4 Part 3. Sections Poisson Distribution October 2, 2008

Week 9 The Central Limit Theorem and Estimation Concepts

Lecture 3. Discrete Random Variables

Probability Distributions.

Things to remember when learning probability distributions:

Discrete and continuous

Lecture 2: Repetition of probability theory and statistics

HW on Ch Let X be a discrete random variable with V (X) = 8.6, then V (3X+5.6) is. V (3X + 5.6) = 3 2 V (X) = 9(8.6) = 77.4.

Applied Statistics I

Data, Estimation and Inference

(Ch 3.4.1, 3.4.2, 4.1, 4.2, 4.3)

X = X X n, + X 2

Counting. 1 Sum Rule. Example 1. Lecture Notes #1 Sept 24, Chris Piech CS 109

Discrete probability distributions

Week 6, 9/24/12-9/28/12, Notes: Bernoulli, Binomial, Hypergeometric, and Poisson Random Variables

p. 4-1 Random Variables

Topic 3 - Discrete distributions

(Ch 3.4.1, 3.4.2, 4.1, 4.2, 4.3)

STAT509: Discrete Random Variable

Discrete Probability Distributions

Discrete Distributions

Example continued. Math 425 Intro to Probability Lecture 37. Example continued. Example

the law of large numbers & the CLT

BINOMIAL DISTRIBUTION

CDA6530: Performance Models of Computers and Networks. Chapter 2: Review of Practical Random

STAT/MATH 395 PROBABILITY II

Chapters 3.2 Discrete distributions

SDS 321: Introduction to Probability and Statistics

18.175: Lecture 17 Poisson random variables

The Normal Distribution

Topic 3: The Expectation of a Random Variable

PRACTICE PROBLEMS FOR EXAM 2

Probability. Machine Learning and Pattern Recognition. Chris Williams. School of Informatics, University of Edinburgh. August 2014

Page Max. Possible Points Total 100

ST 371 (V): Families of Discrete Distributions

Chapter 3 Discrete Random Variables

Binomial random variable

Mathematical Statistics 1 Math A 6330

Distribusi Binomial, Poisson, dan Hipergeometrik

CSE 312: Foundations of Computing II Quiz Section #10: Review Questions for Final Exam (solutions)

Special distributions

Random variable X is a mapping that maps each outcome s in the sample space to a unique real number x, x. X s. Real Line

An-Najah National University Faculty of Engineering Industrial Engineering Department. Course : Quantitative Methods (65211)

Basics on Probability. Jingrui He 09/11/2007

1 Bernoulli Distribution: Single Coin Flip

Transcription:

Poisson Chris Piech CS109, Stanford University Piech, CS106A, Stanford University

Probability for Extreme Weather? Piech, CS106A, Stanford University

Four Prototypical Trajectories Review

Binomial Random Variable Consider n independent trials of an experiment with success probability p. X is number of successes in n trials X is a Binomial Random Variable: Examples # of heads in n coin flips # of 1 s in randomly generated length n bit string # of disk drives crashed in 1000 computer cluster o Assuming disks crash independently

Our random variable Num trials Probability of success on each trial X Bin(n, p) Is distributed as a Binomial With these parameters

If X is a binomial with parameters n and p Probability Mass Function for a Binomial n P (X = k) = k p k (1 p) n k Probability that our variable takes on the value k

Bernoulli vs Binomial X Bern(p) X 2 {0, 1} Bernoulli is a type of RV that can take on two values, 1 (for success) with probability p and 0 (for failure) with probability (1- p) Y Bin(n, p) nx Y = i=1 X i s.t. X i Bern(p) Binomial is the sum of n Bernoullis

Fundamental Properties Semantic Meaning P(X = k) Random Variable E[X] Var(X) E[X 2 ] Std(X)

Is Peer Grading Accurate Enough? Looking ahead Peer Grading on Coursera HCI. 31,067 peer grades for 3,607 students. Tuned Models of Peer Assessment. C Piech, J Huang, A Ng, D Koller

Is Peer Grading Accurate Enough? Looking ahead 1. Defined random variables for: True grade (s i ) for assignment i Observed (z ij ) score for assign i Bias (b j ) for each grader j Variance (r j ) for each grader j 2. Designed a probabilistic model that defined the distributions for all random variables Problem param s i Bin(points, ) z j i N (µ = s i + b j, = p r j ) Tuned Models of Peer Assessment. C Piech, J Huang, A Ng, D Koller

Is Peer Grading Accurate Enough? Looking ahead 1. Defined random variables for: True grade (s i ) for assignment i Observed (z ij ) score for assign i Bias (b j ) for each grader j Variance (r j ) for each grader j 2. Designed a probabilistic model that defined the distributions for all random variables 3. Found the variable assignments that maximized the probability of our observed data Inference or Machine Learning Tuned Models of Peer Assessment. C Piech, J Huang, A Ng, D Koller

Yes, With Probabilistic Modelling Before: After: 81% within 10pp 99% within 10pp -100-80 -60-40 -20 0 20 40 60 80-100 -80-60 -40-20 0 20 40 60 80 Tuned Models of Peer Assessment. C Piech, J Huang, A Ng, D Koller

Good to know Natural Exponent def:

Four Prototypical Trajectories End Review

Algorithmic Ride Sharing

Probability of k requests from this area in the next 1 min

Probability of k requests from this area in the next 1 min

Probability of k requests from this area in the next 1 min On average λ = 5 requests per minute

Probability of k requests from this area in the next 1 min On average λ = 5 requests per minute We can break the next minute down into seconds 1 2 3 4 5 6 60

Probability of k requests from this area in the next 1 min On average λ = 5 requests per minute We can break the next minute down into seconds 1 2 3 4 5 6 60 At each second either get a request or you don t. Let X = Number of requests in the minute

Probability of k requests from this area in the next 1 min On average λ = 5 requests per minute We can break the next minute down into seconds 1 2 3 4 5 6 60 At each second either get a request or you don t. Let X = Number of requests in the minute

Probability of k requests from this area in the next 1 min On average λ = 5 requests per minute We can break the next minute down into seconds 1 2 3 4 5 6 60 At each second either get a request or you don t. Let X = Number of requests in the minute But what if there are two requests in the same second?

Probability of k requests from this area in the next 1 min On average λ = 5 requests per minute We can break that next minute down into milli-seconds 1 60,000 At each milli-second either get a request or you don t. Let X = Number of requests in the minute But what if there are two requests in the same second?

Probability of k requests from this area in the next 1 min On average λ = 5 requests per minute We can break that next minute down into milli-seconds 1 60,000 At each milli-second either get a request or you don t. Let X = Number of requests in the minute Can we do any better than milli-seconds?

Binomial in the Limit On average λ = 5 requests per minute We can break that minute down into infinitely small buckets OMG so small 1 Let X = Number of requests in the minute Who wants to see some cool math?

Binomial in the Limit

Probability of k requests from this area in the next 1 min

Simeon-Denis Poisson Simeon-Denis Poisson (1781-1840) was a prolific French mathematician Published his first paper at 18, became professor at 21, and published over 300 papers in his life He reportedly said Life is good for only two things, discovering mathematics and teaching mathematics. I m going with French Martin Freeman

Poisson Random Variable X is a Poisson Random Variable: the number of occurrences in a fixed interval of time. X Poi( ) λ is the rate X takes on values 0, 1, 2 has distribution (PMF): P (X = k) =e k k!

Poisson Process Consider events that occur over time Earthquakes, radioactive decay, hits to web server, etc. Have time interval for events (1 year, 1 sec, whatever...) Events arrive at rate: l events per interval of time Split time interval into n à sub-intervals Assume at most one event per sub-interval Event occurrences in sub-intervals are independent With many sub-intervals, probability of event occurring in any given sub-interval is small N(t) = # events in original time interval ~ Poi(l)

Piech, CS106A, Stanford University Poisson is great when you have a rate!

Piech, CS106A, Stanford University Poisson is great when you have a rate and you care about # of occurrences!

Piech, CS106A, Stanford University Make sure that the time unit for rate and match the probability question

Earthquakes Average of 2.79 major earthquakes per year. What is the probability of 3 major earthquakes next year? Piech, CS106A, Stanford University

Earthquake Probability Mass Function Piech, CS106A, Stanford University Let X = number of earthquakes next year P(X = x) Number of earthquakes (x)

Four Prototypical Trajectories Poisson can approximate a Binomial!

Storing Data on DNA All the movies, images, emails and other digital data from more than 600 smartphones (10,000 gigabytes) can be stored in the faint pink smear of DNA at the end of this test tube.

Storing Data on DNA Will the DNA storage become corrupt? In DNA (and real networks) store large strings Length n» 10 4 Probability of corruption of each base pair is very small p» 10-6 X ~ Bin(10 4, 10-6 ) is unwieldy to compute Extreme n and p values arise in many cases # bit errors in steam sent over a network # of servers crashes in a day in giant data center

Storing Data on DNA Will the DNA storage become corrupt? In DNA (and real networks) store large strings Length n» 10 4 Probability of corruption of each base pair is very small p» 10-6 X ~ Poi(l = 10 4 * 10-6 = 0.01) P (X = k) =e k! P (X = 0) = e 1 0! 0.01 = e 0.01 0.99 k

Poisson is Binomial in the Limit Poisson approximates Binomial where n is large, p is small, and l = np is moderate Different interpretations of "moderate" n > 20 and p < 0.05 n > 100 and p < 0.1 Really, Poisson is Binomial as n à and p à 0, where np = l

Bin(10,0.3) vs Bin(100,0.03) vs Poi(3) 0.3 P(X = k) 0.25 0.2 0.15 0.1 Bin(10, 0.3) Bin(100, 0.03) Poi(3) 0.05 0 1 2 3 4 5 6 7 8 9 10 k

Piech, CS106A, Stanford University Poisson can be used to approximate a Binomial where n is large and p is small.

Tender (Central) Moments with Poisson Recall: Y ~ Bin(n, p) E[Y] = np Var(Y) = np(1 p) X ~ Poi(l) where l = np (n à and p à 0) E[X] = np = l Var(X) = np(1 p) = l(1 0) = l Yes, expectation and variance of Poisson are same o It brings a tear to my eye

A Real License Plate Seen at Stanford No, it s not mine but I kind of wish it was.

Poisson is Chill Poisson can still provide a good approximation even when assumptions are mildly violated Poisson Paradigm Can apply Poisson approximation when... Successes in trials are not entirely independent o Example: # entries in each bucket in large hash table Probability of Success in each trial varies (slightly) o o Small relative change in a very small p Example: average # requests to web server/sec. may fluctuate slightly due to load on network

Consider requests to a web server in 1 second In past, server load averages 2 hits/second X = # hits server receives in a second What is P(X < 5)? Solution Web Server Load

Probability for Extreme Weather?

Hurricanes per Year since 1851 35 30 Number of Hurricanes in Atlantic 25 20 15 10 5 0 1851 1857 1863 1869 1875 1881 1887 1893 1899 1905 1911 1917 1923 1929 1935 1941 1947 1953 1959 1965 1971 1977 1983 1989 1995 2001 2007 2013

Four Prototypical Trajectories To the code!

Historically ~ Poisson(8.5) Predicted and Actual Frequency 18 16 14 12 10 8 6 4 2 0 Until 1966, things look pretty Poisson Lambda = 8.5 0 10 20 30 40 Num Hurricanes

Improbability Drive What is the probability of over 15 hurricanes in a season given that the distribution doesn t change? Let X = # hurricanes in a year. X ~ Poi(8.5) Solution: P (X >15) = 1 P (X apple 15) =1 X15 i=0 =1 0.98 =0.02 P (X = i) This is the pmf of a Poisson. Your favorite programming language has a function for it

Four Prototypical Trajectories Twice since 1966 there have been years with over 30 hurricanes

Improbability Drive What is the probability of over 30 hurricanes in a season given that the distribution doesn t change? Let X = # hurricanes in a year. X ~ Poi(8.5) Solution: P (X >30) = 1 P (X apple 30) =1 X30 i=0 P (X = i) =1 0.999999997823 =2.2e 09 This is the pdf of a Poisson. Your favorite programming language has a function for it

The Distribution has Changed 8 Predicted and Actual Frequency 7 6 5 4 3 2 Since 1966, looks like the distribution has changed Lambda = 16.6? 1 0 0 10 20 30 40 # Hurricanes

What s Up?

What s Up?

What s Up?

Python Scipy Poisson Methods Function pmf(k) cdf(k) entropy() mean() var() std() Description Probability mass function. Cumulative distribution function. (Differential) entropy of the RV. Mean of the distribution. Variance of the distribution. Standard deviation of the distribution.

The Poisson Common Path Backbone Solution Defense