6 - Probability and Bayes Theorem Flashcards
Consider r and b as boxes.
r has 6 o and 2 a
b has 1 o and 3 a
P(B=r) = 4/10
P(B=b) = 6/10
Notice that it is not 50/50
Why is it not 50/50?
Models must account for biases that are given
Consider r and b as boxes.
r has 6 o and 2 a
b has 1 o and 3 a
What is the probability of picking an a from r or b?
r would be 1/4
b would be 3/4
Consider r and b as boxes.
r has 6 o and 2 a
b has 1 o and 3 a
Given that we picked an o, what is the probability of the box being b?
Hard to answer
Consider X and Y are random variables.
X can take any values xi where i =1…M
Y can take any yj where j = 1,….L
Consider a total N trials, how could you represent it?
Create a grid where rows are Y (or X) and columns are X (or Y).
Each slot in the grid nij means X=xi and Y = yj
Ci would be the number of times X is xi
Rj would be times Y takes yi
Joint Probability of X=xi and Y=yj
(nij)/N where N is the number of trials
P(X=xi,Y=yj) = (nij)/N
Probability of X=xi, irrespective of Y
p(X=xi) = (ci)/N where N is number of trials
Sum Rule (from X, Y and N)
Probabilities not gradients
p(X) = sum(j=1->Y)(p(X,Y))
Marginal Probability
P(X=xi)
(and maybe p(Y=yj)?)
Probability of Y=yj, irrespective of X
p(Y=yj) = (rj)/N where N is the number of trials.
Conditional Probability.
ie X=xi given that Y=yj
Give both the P notation and grid notation
p(X=xi|Y=yj)
From the grid = (nij)/(rj)
product rule
p(X,Y)
p(Y|X)p(X) or p(X|Y)p(Y)
Bayes Theorem (not expanded)
p(Y|X) = (p(X|Y)p(Y))/p(X)
p(X|Y) = (p(Y|X)p(X))/p(Y)
(product rule rewritten)
Bayes Theorem Expanded
p(Y|X) = p(X|Y)p(Y)/(sum(1->Y)(p(X|Y)p(Y)))
p(X|Y) = p(Y|X)p(X)/(sum(1->X)(p(Y|X)p(X))) ????
Prior Probability
If a red box is 4/10 probability and the blue is 6/10
The prior probability favours the blue
Posterior Probability
If a red box is 4/10 probability and the blue is 6/10
but the red box has more oranges and an orange is selected then…
the posterior probability favours the red box