SDA Bayes
SDA Bayes
Bayesian Decisions
Izhar Bar-Gad
Room: 408 Phone: 7141 Email: [email protected]
Outline
Bayesian decisions
Decision theory
1
Simple decision example
Decision error
In this example
If we decide boy P ( girl )
P (error )
If we decide girl P(boy)
0.6
0.5
0.4
PDF
0.3
0.2
0.1
0
0 2 4 6 8
Weight (Kg)
2
Simple decision example –
conditional probability
Conditional probability
Bayes’ rule I
P ( y ) P( x, y ).
x
P ( x, y ) P ( x | y ) P ( y ) P ( y | x ) P ( x )
3
Bayes’ rule II
P( y | x) P( x)
P( x | y )
P( y)
P( y | x) P ( x ) P ( y | x) P( x )
P( x | y)
P ( x, y ) P ( y | x ) P ( x )
x x
likelihood prior
posterior
evidence
10
p( y | x) p( x)dx
11
12
4
Bayes’ decision rule
Decision:
boy : if P(boy|weight) > P(girl|weight)
girl : otherwise
or
boy : if P (weight |boy)P(boy) > P(weight|girl)P(girl)
girl : otherwise
Error:
If we decide boy P( girl | weight )
P (error | weight )
If we decide girl P(boy | weight )
P(error|weight) = min [P(boy|weight) , P(girl|weight)]
13
Loss function
14
Expected loss
15
5
Bayes’ decision rule
16
17
Outline
Bayesian decisions
18
6
The student dilemma
19
20
21
7
The student dilemma
P(fair|interesting)
P(interesting|fair)P(fair) 0.5* 0.4
0.5
P(interesting) 0.4
22
23
24
8
Outline
Bayesian decisions
25
The doctor can use prior and predict optimally: always flu.
26
x1 x2
i , j a1 0 10
a2 1 0
27
9
The Bayesian Doctor Example
0 0.1 10 1
0.9 1 0 0.9
28
29
30
10
The Bayesian Doctor Example
p( y1 ) p( y1 | x1 ) p( x1 ) p ( y1 | x2 ) p( x2 )
0.8 0.9 0.3 0.1
0.75
p ( y2 ) 1 p ( y1 ) 0.25
31
R( a1 | y1 ) p( x1 | y1 ) 1,1 p ( x2 | y1 ) 1,2
0 p( x2 | y1 ) 10
p ( y1 | x2 ) p ( x2 )
10
p ( y1 )
0.3 0.1
10 0.4
0.75
32
33
11
The Bayesian Doctor Example
34
35
12