Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 5a: Bayes’ Rule Class web site: DEA in Bioinformatics: Statistics Module Box 1Box 2Box 3.

Similar presentations


Presentation on theme: "Lecture 5a: Bayes’ Rule Class web site: DEA in Bioinformatics: Statistics Module Box 1Box 2Box 3."— Presentation transcript:

1 Lecture 5a: Bayes’ Rule Class web site: http://ludwig-sun2.unil.ch/~darlene/module4/ DEA in Bioinformatics: Statistics Module Box 1Box 2Box 3

2 Outline (A) CLT – Review and Example Conditional probability (Review) Partition (Review) Which Box? Bayes’ Rule

3 Central Limit Theorem (CLT) The CLT says that if we –repeat the sampling process many times –compute the sample mean (or proportion) each time –make a histogram of all the means (or proportions) then that histogram of sample means (or proportions) should look like the normal distribution Of course, in practice we only get one sample from the population The CLT provides the basis for making confidence intervals and hypothesis tests for means or proportions

4 Normal approximation to the binomial distribution One important application of the CLT is when the RV X ~ Bin(n, p) when n is large X is a sum of independent Bernoulli(p) RVs Then X is exactly binomial, but approximately normal with  = np and  =  np(1-p) How large should n be? Large enough so that both np and n(1-p) are at least about 10 Possible to modify the approximation if np or n(1-p) is between 5 and 10 (continuity correction)

5 Example A pair of dice is rolled approximately 180 times an hour at a craps table in Las Vegas a)Write an exact expression for the probability that 25 or more rolls have a sum of 7 during the first hour b)What is the approximate probability that 25 or more rolls have a sum of 7 during the first hour c)What is the approximate probability that between 700 and 750 rolls have a sum of 7 during 24 hours?

6 Conditional probability Formally, P(A | B) = P(A AND B) / P(B) P(A | B) is not defined if P(B) = 0 Example: Mendel and peas –Given that a seed is yellow, what is the probability it is a heterozygote?

7 Mendel and peas Heterozygotes y/g, g/y: y/y, y/g, g/y  g/g  pollen parentseed parent y g y g yy yg gy gg ¼ ¼ ¼ ¼ yellow heterozygote P(yellow and heterozygote) = ?? P(yellow) = ?? P(H|Y) = ??

8 Partition A partition divides the sample space into disjoint subsets –no gaps –no overlaps

9 Law of total probability For a partition A, B of the sample space and an event R, P(R) = P(R AND A) + P(R AND B) Can have any number of events in the partition

10 Which box? Suppose there are 3 similar boxes: 1, 2, 3 Box i contains i white balls and 1 black ball I choose a box at random and then pick 1 ball at random from that box (and show you the ball) – it is white Which box do you guess the ball came from, and what is your chance of getting it right?

11 Which box? (cont) Box 1Box 2Box 3

12 Bayes’ Rule For a partition B 1, B 2,..., B n of all possible outcomes, P(B i | A) = P(A | B i ) * P(B i ) / P(A) = P(A | B i ) * P(B i ) P(A | B i ) * P(B i ) +... + P(A | B n ) * P(B n )

13 Bayes’ rule uses both expressions for P(A AND B) Let’s go back to the definition of conditional probability for a moment: P(A | B) = P(A AND B) / P(B) We can also write P(B | A) = P(A AND B) / P(A) This gives us two ways to express P(A AND B): P(A AND B) = P(A | B) P(B) P(A AND B) = P(B | A) P(A)

14 Example (from last week) Suppose that 5% of men and 0.25% of women are color blind. A person is chosen at random. What is the probability that the person is color blind assuming... –there are an equal number of males and females –there are twice as many males as females in the population

15 Example (cont) Suppose that 5% of men and 0.25% of women are color blind. A color blind person is chosen at random. What is the probability that the person is male assuming... –there are an equal number of males and females –there are twice as many males as females in the population

16 Disease screening Suppose a blood test for a particular disease results in either a + or – reading Assume that 95% of people with the disease produce +, and 2% of people without the disease also produce + Also assume that 1% of the population has the disease What is the chance that a person chosen at random from the population has the disease, given that the test produces +?

17 Huntington’s disease Rare, autosomal dominant disorder which starts to appear in middle age (40s or 50s) Incidence in the general population is about 1/10,000, which means that the probability of carrying the defective gene is about.01% But for individuals with an affected parent, the probability of carrying the defective gene is 50% There is a test for HD, assume that the false positive rate is 2%, and the false negative rate is 1%

18 Huntington’s disease (cont) Suppose a person with an affected parent takes the test –What is the chance the person is at risk if the test is negative? –What is the chance the person is at risk if the test is positive?

19 Huntington’s disease (cont) Now suppose that a person without an affected parent is considering taking the test –What is the chance the person is at risk if the test is negative? –What is the chance the person is at risk if the test is positive?

20 Bayesian inference The Bayesian probability framework uses a different interpretation of probability than the long-run frequentist interpretation In this version of probability, we have P(parameters|data) = c * P(data|pars) * P(pars) In words, the posterior distribution for the parameters is proportional to the prior times the likelihood In the Bayesian framework, inference is based on the posterior distribution

21 (BREAK)


Download ppt "Lecture 5a: Bayes’ Rule Class web site: DEA in Bioinformatics: Statistics Module Box 1Box 2Box 3."

Similar presentations


Ads by Google