(10 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
'''Example'''
 
'''Example'''
  
Suppose we have an ECE 302 class with 100 students, 40 African students and 60 Non-African students and we want to distinguish the students with African origin from the rest of class. Since we know that African last names are generally have long, we decide to use the number of letters in the last name as the feature to classify the students. We also have the following statistics available to us.  
+
Suppose we have an ECE 302 class with 100 students, 40 African students and 60 Non-African students and we want to distinguish the students with African origin from the rest of class. Since we know that African last names are usually longer than others, we decide to use the number of letters in the last name as the feature to classify the students. We also have the following statistics available to us.  
  
 
First, the distribution among Non-Africans.
 
First, the distribution among Non-Africans.
[[Image:non-african.jpg]]
+
[[Image:non-african.jpg|400px|thumb|left]]
 +
Then the distribution among the Africans.
 +
[[Image:african.jpg|400px|thumb|right]]
 +
 
 +
And, both graphs put together.
 +
[[Image:mixed.jpg|400px|thumb|left]]
 +
 
 +
 
 +
With all this information, we can use Bayes rule to determine if a student is African or not. Without the information about the length of the last names, the probability of a student being African would always be 0.4, but with the added feature, it becomes easier to determine the origin of the student using Bayes theorem.
 +
 
 +
Using the equation below
 +
 
 +
<div style="margin-left: 25em;">
 +
<math>P(x_j|y)= \frac{p(y|x_j)p(x_j)}{P(y)} </math> 
 +
</div>
 +
 
 +
and
 +
 
 +
<div style="margin-left: 25em;">
 +
<math>P(y|x)= \frac{P(xy)}{P(x)} </math>                                                 
 +
</div>
 +
 
 +
where:
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x<sub>j</sub> represents the event of an African student
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; y represents the length of the student's last name
 +
 
 +
We can find the probability of a student being African or not African given the length of their last name and just plugging into the equations above.
 +
 
 +
 
 +
'''Notes'''
 +
*Discrete variables are used because its easier to show the differences between the two events, and also easier to calculate probabilities with, however as stated in the [[Bayesian Decision Theory - Continuous Features|previous essay]], continuous variables can also be used.
 +
 
 +
*This only works for situations where there are only two events and one feature classifier.
 +
 
 +
 
 +
 
 +
----
 +
*[[Honors_project_1_ECE302S12|Back to Tosin's Honors Project]]
 +
*[[2013 Spring ECE 302 Boutin|Back to ECE 302 Spring 2013. Prof Boutin]]
 +
*[[ECE302|Back to ECE 302]]
 +
 
 +
[[Category:Honors_project]] [[Category:ECE302]] [[Category:Pattern_recognition]]

Latest revision as of 17:34, 22 March 2013

Illustration of Bayes Rule


       The last couple of essays have provided insight into the Bayesian Decision Theory, showing how conditional probabilities are used to determine the probability of a particular event given that we know the prior probabilities. For this essay, we will be looking at a real world illustration where we can use Bayes Rule to solve a problem.

Example

Suppose we have an ECE 302 class with 100 students, 40 African students and 60 Non-African students and we want to distinguish the students with African origin from the rest of class. Since we know that African last names are usually longer than others, we decide to use the number of letters in the last name as the feature to classify the students. We also have the following statistics available to us.

First, the distribution among Non-Africans.

Non-african.jpg

Then the distribution among the Africans.

African.jpg

And, both graphs put together.

Mixed.jpg


With all this information, we can use Bayes rule to determine if a student is African or not. Without the information about the length of the last names, the probability of a student being African would always be 0.4, but with the added feature, it becomes easier to determine the origin of the student using Bayes theorem.

Using the equation below

$ P(x_j|y)= \frac{p(y|x_j)p(x_j)}{P(y)} $

and

$ P(y|x)= \frac{P(xy)}{P(x)} $

where:

       xj represents the event of an African student

       y represents the length of the student's last name

We can find the probability of a student being African or not African given the length of their last name and just plugging into the equations above.


Notes

  • Discrete variables are used because its easier to show the differences between the two events, and also easier to calculate probabilities with, however as stated in the previous essay, continuous variables can also be used.
  • This only works for situations where there are only two events and one feature classifier.



Alumni Liaison

To all math majors: "Mathematics is a wonderfully rich subject."

Dr. Paul Garrett