Modeling Belief How much do you believe it will rain? How strong is your belief in democracy? How much do you believe Candidate X? How much do you believe Car x is faster than Car y? How long do you think you will live?
After your yearly checkup, the doctor has bad news and good news. The bad news is that you tested positive for a serious disease, and that the test is 99% accurate (i.e. the probability of testing positive given that you have the disease is 0.99, as is the probability of testing negative given that you don't have the disease). The good news is that this is a rare disease, striking only one in 10,000 people. Why is it good news that the disease is rare? What are the chances that you actually have the disease?
What is probability? A numerical measure of the strength of a belief in a certain proposition:p(proposition). Provides rules for coherent inductive reasoning: addition p(this OR That) Multiplication p(this AND That) conditional probability p(this Given THAT) independence. This and That are not related
Birthday Problem What s the chance two people in a room share the same birthday? Events? Define probabilities? Answer in MATLAB code: n=0:60; p = 1-cumprod((365-n)/365)
Birthday Problem What s the chance at least two people in a room share the same birthday? P( B ) = 1- P( Not B) = 1-P(NOONE shares the same birthday. ) Events? Events A i = Person i s birthday is different from Persons {0,,i-1} Define probabilities? P(A i ) = P(i s birthday is different from preceding persons) = (365-i)/365 (i.e. How many chances out of the total) P(Not B) = P(A 0 & A 1 & & A i )= P(A 0, A 1,, A i ) = P(A 0 )P( A 1 ) P( A i ) = j=0 P(A j ) = (365*364*.(365-i))/ 365 i = 365!/((365-i)! 365 i ) i
Posterior Probabilities Knowing right prob to compute! P(s O) = P(O s)p(s)/p(o) s = world property O = Observation Example: Medical Testing You test positive for cancer A doctor tells you that the test only misses 10% of people who have cancer, so prepare for the worst Do you seek a second opinion? Why?
Mr. Dupont is a professional wine taster. When given a French wine, he will identify it with probability 0.9 correctly as French, and will mistake it for a Californian wine with probability 0.1. When given a Californian wine, he will identify it with probability 0.8 correctly as Californian, and will mistake it for a French wine with probability 0.2. Suppose that Mr. Dupont is given ten unlabelled glasses of wine, three with French and seven with Californian wines. He randomly picks a glass, tries the wine, and solemnly says: "French". What is the probability that the wine he tasted was Californian?
Prob Computations.. Estimate the probability of some event E when it depends on F. Estimate the probability of E given some other event F, p(e F) Estimate p(e not-f) Estimate p(f) Compute P(E) as p(f) p(e F) + p(not-f) p(e not-f)
Bayes Example
Mr. Dupont is a professional wine taster. When given a French wine, he will identify it with probability 0.9 correctly as French, and will mistake it for a Californian wine with probability 0.1. When given a Californian wine, he will identify it with probability 0.8 correctly as Californian, and will mistake it for a French wine with probability 0.2. Suppose that Mr. Dupont is given ten unlabelled glasses of wine, three with French and seven with Californian wines. He randomly picks a glass, tries the wine, and solemnly says: "French". What is the probability that the wine he tasted was Californian? Rf Rc F 0.9 0.1 C 0.2 0.8 P(F) = 0.3; P(C) = 0.7; P(C Rf) = P(Rf C) p( C )/P(Rf) = 0.2*0.7/Σ w P(Rf w)p(w) = 0.2*0.7/(0.9*0.3+0.2*0.7) = 0.3415 = 0.2*0.7/0.41 = 0.3415
Visualizing 0.9 D H = Hypothesis, Patient has cancer" D = Datum 0.3 H 0.1 ~D 0.7 ~H 0.2 D D ~D H ~H 0.9 0.2 0.1 0.8 0.8 ~D P(H) = 0.3; P(~H) = 0.7;
WHAT YOU NEED TO KNOW Joint Probability Conditioning P(x, y) = P(A " B) P(y x) = P(x,y) /P(x) Marginalization P(x) = # y P(x,y)
Matlab code for computing sum of two die % Need to enumerate all possibilities % die1 = 1:6; % die2 = 1:6; % Now a basic control structure % for die1value=1:6, for die2value = 1:6, possibilities(die1value,die2value) = die1value + die2value; end end % possibilities = % % 2 3 4 5 6 7 % 3 4 5 6 7 8 % 4 5 6 7 8 9 % 5 6 7 8 9 10 % 6 7 8 9 10 11 % 7 8 9 10 11 12 % sort our table into a long list possibilities = reshape(possibilities,[1,36]) % possibilities = % % Columns 1 through 18 % % 2 3 4 5 6 7 3 4 5 6 7 8 % 4 5 6 7 8 9 % % Columns 19 through 36 % % 5 6 7 8 9 10 6 7 8 9 10 11 % 7 8 9 10 11 12 % now the minimum value of the sum is 2 % and the max is 12 for sumvalues = 2:12, testifequal = (possibilities == sumvalues); % testifequal returns a new list of the same size % possibilities with a 1 for every element in % possibilities that is equal to the current sumvalue % (2,3,4, etc) and zero for all other values count(sumvalues-1) = sum(testifequal); end probsum = count/36
Binomial Events
Normal & Multivariate Normal Σ= [σ x 2 0 0 σ y 2 ] Σ= [σ x 2 ρσ x σ y ρσ x σ y σ y 2 ]