How to compute the probability using Naive Bayes assumption?

440 Views Asked by At

I am struggling a bit with this question (and it's on a practice test -- not an actual test).

Consider that  Y = wealth, and X1 = Gender, X2 = Hours worked. 

Let us consider the following data:  

P(Y = rich, X1 = Female, X2 < 40.5) = 0.0245895 
P(Y = poor, X1 = Female, X2 < 40.5) = 0.253122 
P(Y = rich, X1 = Female, X2 >= 40.5) = 0.0116293 
P(Y = poor, X1 = Female, X2 >= 40.5) = 0.0421768  
P(Y = rich, X1 = male, X2 < 40.5) = 0.0971295 
P(Y = poor, X1 = male, X2 < 40.5) = 0.331313 
P(Y = rich, X1 = male, X2 >= 40.5) = 0.105933 
P(Y = poor, X1 = male, X2 >= 40.5) = 0.134106  
Compute P(Y = rich | X1 = Female, X2 < 40.5) using Naiive Bayes assumption

**P(X1 = Female, X2 < 40.5| Y = rich)** 

**P(Y = rich)/ P(X1 = Female, X2 < 40.5)**

Firstly, I don't even understand what those last 2 equations mean -- how do they relate to the question?

Here is how I went about it (which is obviously not correct since it's not one of the answers):

P(Y = rich | X1 = female, X2 < 40.5)

= (P(X1 = female | Y = rich) * P (X2 < 40.5 | Y = rich) * P(Y = rich)) / P(X1 = female, X2 < 40.5)

= ((0.0245895 + 0.0116293) * (0.0245895 + 0.0971295) * (0.0245895 + 0.0116293 + 0.0971295 + 0.105933)) / (0.0245895 + 0.253122) = 0.003798

Possible answers:

0.07, 0.09, 0.91, 0.38

2

There are 2 best solutions below

3
On

The last two equations are the probabilities you multiply together to get the answer. They can be got like this:

$P(A|BC)=\displaystyle \frac {P(ABC)}{P(BC)}=\frac {P(BC|A)P(A)}{P(BC)}$, where you use definition of conditional probability twice. Let’s use the first equality and not the one you’re given, the second one. Here, $P(ABC)= 0.0245895 P(A^cBC)= 0.253122 P(ABC^c)= 0.0116293 P(A^cBC^c)= 0.0421768 P(AB^cC)= 0.0971295 P(A^cB^cC) = 0.331313 P(AB^cC^c)= 0.105933 P(A^cB^cC^c)= 0.134106 $

You can see $P(ABC)$ from the first line. $P(BC)=P(ABC)+P(A^cBC)$. The answer is $\displaystyle \frac {.025}{.025+.25}=.09$

0
On

Using Naive Baye's:

P(Y = rich | X1 = Female, X2 < 40.5)

= (P(X1 = female | Y = rich) * P(X2 < 40.5 | Y = rich) * P(Y = rich)) / P (X1 = female, X2 < 40.5)

= (((0.0245895 + 0.0116293) / (0.0245895 + 0.0116293 + 0.0971295 + 0.105933)) * (0.0245895 + 0.0971295) / (0.0245895 + 0.0116293 + 0.0971295 + 0.105933)) * (0.0245895 + 0.0116293 + 0.0971295 + 0.105933)) / (0.0245895 + 0.253122)

= 0.066342

≈ 0.07