This lesson provides a review of Baye's Theorem and how to use it.
REFERENCES
Baye's Theorem and Baye's Theorem Calculator from the faculty at Vassar College
Bayes' Theorem provides you with the ability to determine the probability of an event occurring or not occurring given another event has either occurred or not occurred.
You have 2 events.
They are event A and event B.
These events can either happen or not happen.
If they happen they are called A and B.
If they don't happen they are called ~A and ~B.
The ~ stands for NOT meaning the event does not occur.
P(A) means the probability of event A occurring.
P(~A) means the probability of event A not occurring.
By the laws of probability:
P(A) occurring or P(B) occurring = P(A) + P(B).
P(A) occurring and P(B) occurring = P(A) * P(B).
The probability of B occurring given that A occurs might be different than the probability of B occurring given that A does not occur.
An example would be the following.
Event A is a person having a disease.
Event ~A is a person not having a disease.
Event B is a person testing positive for the disease (the test says he has the disease).
Event ~B is a person testing negative for the disease (the test says he does not have the disease).
The probability of the person testing positive for the disease when he has the disease is different than the probability of the person testing positive for the disease when he doesn't have the disease.
The probability of the person testing negative for the disease when he has the disease is different than the probability of the person testing negative for the disease when he doesn't have the disease.
These conditional probabilities are what Baye's Theorem is all about.
Conditional Property is symbolized by |.
P(A|B) means the probability of A occurring given that B has occurred.
P(A|~B means the probability of A occurring given that B has NOT occurred.
P(~A|B) means the probability of A NOT occurring given that B has occurred.
P(~A|~B) means the probability of A NOT occurring given that B has NOT occurred.
Similarly:
P(B|A) means the probability of B occurring given that A has occurred.
P(B|~A) means the probability of B occurring given that A has NOT occurred.
P(~B|A) means the probability of B NOT occurring given that A has occurred.
P(~B|~A) means the probability of B NOT occurring given that A has NOT occurred.
Here's the theorem tied to an example:
Event A means a person has a disease or the person does not have the disease.
Event B means a person tests positive for the disease or the person does not test positive for the disease.
There are 4 equations to work with.
In all 4 equations:
P(A) means the probability that the person has the disease.
P(~A) means the probability that the person does not have the disease.
P(B) means the probability that the person tests positive for the disease.
P(~B) means the probability that the person test negative for the disease.
These are unconditional probabilities. P(B) and P(~B), however, are derived from conditional probability formulas that will be explained later.
The equations are:
Equation 1:
P(A|B) = [P(B|A) x P(A)] / P(B)
P(A|B) means the probability that the person has the disease given that the person tests positive for the disease.
P(B|A) means the probability that the person tests positive for the disease given that the person has the disease.
Equation 2:
P(~A|B) = [P(B|~A) x P(~A)] / P(B)
P(~A|B) means the probability that the person does not have the disease given that the person tests positive for the disease.
P(B|~A) means the probability that the person tests positive for the disease given that the person does not have the disease.
Equation 3:
P(~A|~B) = [P(~B|~A) x P(~A)] / P(~B)
P(~A|~B) means the probability that the person does not have the disease given that the person tests negative for the disease.
P(~B|~A) means the probability that the person tests negative for the disease given that the person does not have the disease.
Equation 4:
P(A|~B) = [P(~B|A) x P(A)] / P(~B)
P(A|~B) means the probability that the person has the disease given that the person tests negative for the disease.
P(~B|A) means the probability that the person tests negative for the disease given that the person has the disease.
P(A) and P(~A) are fairly straight forward.
P(A) is the probability that the person has the disease.
P(~A) is the probability that the person does not have the disease.
P(B) and P(~B), while not conditional themselves, are derived from conditional probability formulas as shown below:
P(B) = [P(B|A) x P(A)] + [P(B|~A) x P(~A)] (equation 5)
P(B) means the probability that the person tests positive for the disease.
P(B|A) means the probability that the person tests positive for the disease given that the person has the disease.
P(A) means the probability that the person has the disease.
P(B|~A) means the probability that the person tests positive for the disease given that the person does not have the disease.
P(~A) means the probability that the person does not have the disease.
P(~B) = [P(~B|A) x P(A)] + [P(~B|~A) x P(~A)] (equation 6)
P(~B) means the probability that the person will test negative for the disease.
P(~B|A) means the probability that the person tests negative for the disease given that the person has the disease.
P(A) means the probability that the person has the disease.
P(~B|~A) means the probability that the person tests negative for the disease given that the person does not have the disease.
P(~A) means the probability that the person does not have the disease.
Now that the terminology is understood, we can move on to consolidating all the equations in one place and solving an example.
There are six equations to deal with.
Equations 5 and 6 will be used for all scenarios.
Recommendation is to solve equation 5 or 6 first.
You will then solve Equation 1 or 2 or 3 or 4, depending on which one describes your situation correctly.
Before we go further, here are some notes that might help clarify some of the relationships between events.
P(A) + P(~A) = 1
The person either has the disease or the person does not have the disease.
P(B|A) + P(~B|A) = 1
Given that the person has the disease, the person will either be tested positive for the disease or the person will be tested negative for the disease.
P(B|~A) + P(~B|~A) = 1
Given that the person does NOT have the disease, the person will either be tested positive for the disease or the person will be tested negative for the disease.
The Vassar College Baye's Theorem Calculator included in the reference assumes this. When you enter one value of a pair, it provides you with the other value of the pair.
We'll use their example so you can reference back and forth a lot easier.
Here are the equations:
P(A|B) = [P(B|A) x P(A)] / P(B) (equation 1 - probability of A given B)
P(~A|B) = [P(B|~A) x P(~A)] / P(B) (equation 2 - probability of NOT A given B)
P(~A|~B) = [P(~B|~A) x P(~A)] / P(~B) (equation 3 - probability of NOT A given NOT B)
P(A|~B) = [P(~B|A) x P(A)] / P(~B) (equation 4 - probability of A given NOT B)
P(B) = [P(B|A) x P(A)] + [P(B|~A) x P(~A)] (equation 5 - probability of B)
P(~B) = [P(~B|A) x P(A)] + [P(~B|~A) x P(~A)] (equation 6 - probability of NOT B)
Following is the example from the reference:
Here are the inputs to the example:
P(A) = .005
P(~A) = .995 (equals 1 - P(A))
P(B|A) = .99
P(~B|A) = .01 (equals 1 - P(B|A)
P(B|~A) = .05
P(~B|~A) = .95 (equals 1 - P(B|~A)
Assume you want to know the probability that a person does NOT have a disease given that the person tests positive for the disease.
First thing you want to do is calculate P(A) and P(B).
P(A) is given.
The P(B) formula you want is equation 5 shown below:
P(B) = [P(B|A) x P(A)] + [P(B|~A) x P(~A)] (equation 5)
From the inputs to the example:
P(B|A) = .99
P(A) = .005
P(B|~A) = .05
P(~A) = .995
Replace these values in equation 5 to get:
P(B) = [.99 x .005] + [.05 x .995] (equation 5)
This becomes:
P(B) = .00495 + .04975
This becomes:
P(B) = .0547
Your value for P(B) = .0545
You now select one of the equations 1 through 4 that fits your situation.
You want the probability that the person does not have the disease given that the person tested positive for the disease.
That would be equation 2 as shown below:
P(~A|B) = [P(B|~A) x P(~A)] / P(B) (equation 2 - probability of NOT A given B)
Your P(B) is already calculated so that takes care of the denominator to the equation.
All the other values are inputs to the problem.
Your inputs to the problem are again:
P(A) = .005
P(~A) = .995 (equals 1 - P(A))
P(B|A) = .99
P(~B|A) = .01 (equals 1 - P(B|A)
P(B|~A) = .05
P(~B|~A) = .95 (equals 1 - P(B|~A)
plus what you previously calculated:
P(B) = .0547
You replace the variables in the equation with the values for those variables to get:
P(~A|B) = [P(B|~A) x P(~A)] / P(B)
becomes:
P(~A|B) = [.05 x .995] / .0547
This becomes:
P(~A|B) = .04975 / .0547
This becomes:
P(~A|B) = .909506399
Your answer is:
P(~A|B) = .909506399
This is the probability that the person does NOT have the disease given that the person tests positive for the disease.
You can test your answer by inputting into the Baye's Theorem Calculator from the reference.
That calculator does all the heavy duty calculations for you and provides you with answers for all the options at the same time.
You should do it manually first, however, to understand how the process works.
The answer provided by the Baye's Theorem Calculator is:
P(~A|B) = 0.9095
Questions and Comments may be referred to me via email at
theoptsadc@yahoo.com
You may also check out my website at
http://theo.x10hosting.com
This lesson has been accessed 6942 times.