Bayes Theorem and Hypergeometric Distribution

Similar documents
Chapters 3.2 Discrete distributions

Lecture 4: Random Variables and Distributions

Binomial and Poisson Probability Distributions

Discrete Probability Distributions

Common Discrete Distributions

Outline PMF, CDF and PDF Mean, Variance and Percentiles Some Common Distributions. Week 5 Random Variables and Their Distributions

Fault-Tolerant Computer System Design ECE 60872/CS 590. Topic 2: Discrete Distributions

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

Relationship between probability set function and random variable - 2 -

CSC Discrete Math I, Spring Discrete Probability

Probability: Why do we care? Lecture 2: Probability and Distributions. Classical Definition. What is Probability?

Probability and Estimation. Alan Moses

Discrete Probability Distributions

Random Variables Example:

Chapter 3. Discrete Random Variables and Their Probability Distributions

Determining Probabilities. Product Rule for Ordered Pairs/k-Tuples:

Chapter 3. Discrete Random Variables and Their Probability Distributions

Introduction to Probability and Statistics Slides 3 Chapter 3

Random Variables. Definition: A random variable (r.v.) X on the probability space (Ω, F, P) is a mapping

Probability Theory. Introduction to Probability Theory. Principles of Counting Examples. Principles of Counting. Probability spaces.

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

Binomial random variable

Bernoulli Trials, Binomial and Cumulative Distributions

Why study probability? Set theory. ECE 6010 Lecture 1 Introduction; Review of Random Variables

STAT509: Discrete Random Variable

Hypergeometric, Poisson & Joint Distributions

Chapter 2: Discrete Distributions. 2.1 Random Variables of the Discrete Type

Module 2 : Conditional Probability

ACM 116: Lecture 2. Agenda. Independence. Bayes rule. Discrete random variables Bernoulli distribution Binomial distribution

Conditional Probability

With Question/Answer Animations. Chapter 7

Chapter 3 Discrete Random Variables

Lecture 2: Probability and Distributions

Deep Learning for Computer Vision

CHAPTER 4. Probability is used in inference statistics as a tool to make statement for population from sample information.

4. Discrete Probability Distributions. Introduction & Binomial Distribution

Lecture 10: Bayes' Theorem, Expected Value and Variance Lecturer: Lale Özkahya

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

Conditional Probability

Statistics for Economists. Lectures 3 & 4

CMPSCI 240: Reasoning Under Uncertainty

Topic 9 Examples of Mass Functions and Densities

Probability & statistics for linguists Class 2: more probability. D. Lassiter (h/t: R. Levy)

4. Suppose that we roll two die and let X be equal to the maximum of the two rolls. Find P (X {1, 3, 5}) and draw the PMF for X.

1 Preliminaries Sample Space and Events Interpretation of Probability... 13

Bayes Formula. MATH 107: Finite Mathematics University of Louisville. March 26, 2014

INF FALL NATURAL LANGUAGE PROCESSING. Jan Tore Lønning

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.

Quick Tour of Basic Probability Theory and Linear Algebra

Learning Objectives for Stat 225

Statistics for Economists Lectures 6 & 7. Asrat Temesgen Stockholm University

Probability theory for Networks (Part 1) CS 249B: Science of Networks Week 02: Monday, 02/04/08 Daniel Bilar Wellesley College Spring 2008

MATH 3670 First Midterm February 17, No books or notes. No cellphone or wireless devices. Write clearly and show your work for every answer.

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

To find the median, find the 40 th quartile and the 70 th quartile (which are easily found at y=1 and y=2, respectively). Then we interpolate:

Theorem 1.7 [Bayes' Law]: Assume that,,, are mutually disjoint events in the sample space s.t.. Then Pr( )

Conditional Probability

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

b. ( ) ( ) ( ) ( ) ( ) 5. Independence: Two events (A & B) are independent if one of the conditions listed below is satisfied; ( ) ( ) ( )

Chapter 3: Discrete Random Variable

L2: Review of probability and statistics

Basic Probability and Information Theory: quick revision

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

ECE 302: Probabilistic Methods in Electrical Engineering

2. In a clinical trial of certain new treatment, we may be interested in the proportion of patients cured.

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

Lectures Random Variables

Mathematical Statistics 1 Math A 6330

Things to remember when learning probability distributions:

CS 630 Basic Probability and Information Theory. Tim Campbell

MTH4451Test#2-Solutions Spring 2009

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

DISCRETE RANDOM VARIABLES: PMF s & CDF s [DEVORE 3.2]

2.4. Conditional Probability

Topic 3: The Expectation of a Random Variable

Continuous Distributions

Bernoulli Trials and Binomial Distribution

Discrete Probability

Lecture 3. Discrete Random Variables

Topic 2 Probability. Basic probability Conditional probability and independence Bayes rule Basic reliability

Discrete Distributions

1 Probability and Random Variables

Chapter 2 Random Variables

Statistics for Managers Using Microsoft Excel/SPSS Chapter 4 Basic Probability And Discrete Probability Distributions

Math 151. Rumbos Fall Solutions to Review Problems for Exam 2. Pr(X = 1) = ) = Pr(X = 2) = Pr(X = 3) = p X. (k) =

Lecture 8 : The Geometric Distribution

Single Maths B: Introduction to Probability

1 A simple example. A short introduction to Bayesian statistics, part I Math 217 Probability and Statistics Prof. D.

PAS04 - Important discrete and continuous distributions

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

Lecture 2: Repetition of probability theory and statistics

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

Statistics for Managers Using Microsoft Excel (3 rd Edition)

Class 26: review for final exam 18.05, Spring 2014

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

BINOMIAL DISTRIBUTION

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

Analysis of Engineering and Scientific Data. Semester

Communication Theory II

2.6 Tools for Counting sample points

Transcription:

Bayes Theorem Bayes Theorem is a theorem of probability theory that can be seen as a way of understanding how the probability that a theory is true is affected by a new piece of evidence. It has been used in a wide variety of contexts, ranging from marine biology to the development of Bayesian spam blockers for email systems. In the philosophy of science, it has been used to try to clarify the relationship between theory and evidence. Many insights in the philosophy of science involving confirmation, falsification, the relation between science and pseudosience, and other topics can be made more precise, and sometimes extended or corrected, by using Bayes Theorem.

Definition Let A 1, A 2,, A k be a collection of k mutually exclusive events with prior probabilities P (A i )(i = 1,, k). Then for any other event B for which P (B) > 0, the posterior probability of A j given that B has occurred is P (A B) = P (B A)P (A) P (B A)P (A)

Bayes Example I Incidence of a rare disease. Only 1 in 1000 adults is afflicted with a rare disease for which a diagnostic test has been developed. The test is such that when an inidividual actually has the disease, a positive result will occur 99% of the time, whereas an individual without the disease will show a positive test result only 2% of the time. If a randomly selected individual is tested and the result is positive, what is the probability that the individual has the disease? Let A = individual has the disease, and B = positive test result P (A) = 1 1000 = 0.001, P (A ) = 1 0.001 = 0.999, P (B A) = 0.99 and P (B A ) = 0.02

Bayes Example II If a randomly selected individual is tested and the result is positive, what is the probability that the individual has the disease? P (A B) = P (B A)P (A) P (B A)P (A) + P (B A )P (A ) = P (A B) P (B) where P (B) = P (B A)P (A) + P (B A )P (A ) = (0.99)(0.001) (0.99)(0.001)+(0.02)(0.999) = 0.0472103

Sampling with replacement vs. without replacement Suppose we have a bowl of 100 unique numbers from 0 to 99. We want to select a random sample of numbers from the bowl. After we pick a number from the bowl, we can put the number aside or we can put it back into the bowl. If we put the number back in the bowl, it may be selected more than once; if we put it aside, it can selected only one time. When a population element can be selected more than one time, we are sampling with replacement. When a population element can be selected only one time, we are sampling without replacement. Sampling with replacement tends to give more extreme (variable) samples than without replacement.

Sampling with and without replacement Suppose we have a population as follows: 0, 1, 2, 3, 4 Take samples of size 2 with and without replacement: With with (con t) Without (0,0) (2,3) (0,1) (0,1) (2,4) (0,2) (0,2) (3,3) (0,3) (0,3) (3,4) (0,4) (0,4) (4,4) (1,2) (1,1) (1,3) (1,2) (1,4) (1,3) (2,3) (1,4) (2,4) (2,2) (3,4)

Models for Discrete Random Variables (rv) Each random variable can be considered as being obtained by probability sampling from its own sample space, and in doing so leads to a classification of sampling experiments, and the corresponding variables, into classes. Random variables within each class share a common traits and parameter estimations. These classes of probability distributions are also called probability models.

Bernoulli trials A Bernoulli trial or experiment is one whose outcome can be classified as either a success or failure. The Bernoulli random variable X takes the value 1 if the outcome is a success, 0 if it is a failure. Examples of Bernoulli trials: flipping a coin, product taken randomly from production line and classified as a success if the product is defective or a failure if it is not defective.

Bernoulli pdf CDF If the probability of success is p and failure is 1 p, the pmf and CDF of X are: x 0 1 p(x) 1 p p F (x) 1 p 1 The binomial distribution is an extension (in the same family of probability models) of the Bernoulli distribution. The binomial random variable is the number of k successes in the n Bernoulli trials.

The Hypergeometric Distribution The assumptions leading to the hypergeometric distribution are: 1. The population or set to be sampled consists of N elements (a finite population). 2. Each individual element can be characterized as a success(s) or a failure (F ) and there are M successes in the population. 3. A sample of n individuals is selected without replacement in such a way that each subset of size n is equally likely to be chosen. Let X be the number of successes in the sample.

Hypergeometric pmf P (X = x) = ( M )( N M ) x n x ( N n) V X = EX = Mn N ( ) N n Mn N 1 N SDX = V X ( 1 M ) N

Hyper Example I Five individuals from an animal population thought to be near extinction in a certain region have been caught, tagged, and released to mix into the population. After they have had an opportunity to mix, a random sample of 10 of these animals is selected. Let X = the number of tagged animals in the second sample. If there are actually 25 animals of this type in the region, find the following: 1. Probability that exactly 2 are tagged? (P (X = 2)) 2. Probability that at most 2 are tagged? (P (X 2)) 3. EX, V X, SDX 4. Suppose the population size N is not actually known, the value of x is observed and we can use that to estimate N. Suppose now M = 100, n = 40 and x = 16 ˆN = Mn x

Hyper Example II 1. P (X = 2) = (5 2)( 20 8 ) ( 25 10) = 0.3853755 2. P (X 2) = P (2)+P (1)+P (0) = (5 2)( 20 0.6988142 8 ) ( 25 10) + (5 1)( 20 9 ) ( 25 10) + (5 0)( 20 10) ( 25 10) =

Hyper Example III 3. EX, V X, SDX M=5; n=10; N=25 EX=M*n/N; VX=((N-n)/(N-1))*(M*n/N)*(1-M/N) SDX=sqrt(VX) EX; VX; SDX [1] 2 [1] 1 [1] 1 4. ˆN = Mn x = 100 40 16 = 250

R code Use dhyper() for the pmf calculation (single probabilities) or phyper() for CDF P(X<=x). dhyper(x,m,n,k) (and phyper(x,m,n,k,lower.tail=t)) where: x: argument of interest, x m: M, the number tagged in the population, the number of successes n: N-M, the number of N elements in the population minus the number tagged k: n, the sample size lower.tail=t: for use in phyper() only; logical, default is T, calculations will be P (X x) Use sum() with dhyper(x,m,n,k) to calculate probabilities of intervals

Previous example with full code M=5; n=10; N=25 # P(X=2), P(X<=2) dhyper(2,m,n-m,n) [1] 0.3853755 sum(dhyper(0:2,m,n-m,n)) [1] 0.6988142