Saturday, July 21, 2012

Bayes Rule

Here's a basic and common example of the use of Bayes Theorem:

1 percent of women tested for breast cancer will have the disease. Only 80 percent of the women with cancer will have a positive mammography. An additional 9.6 percent of women will have a false positive mammography. What is the probability of having cancer given a positive mammography?

Let C = Has cancer, ~C = no cancer, M = Positive mammography
The probability of cancer given a positive mammography would be labelled as "P(C/M)". So we're looking to find the answer to "P(C/M = ?)".


The Bayes Rule to solve this in plain English is: The probability of cancer given a positive mammography is equal to the prior probability of cancer multiplied by the probability of a positive mammography given cancer, then divided by the same number with the addition of the prior probability of no cancer multiplied by the probability of a positive mammography given no cancer.

So the symbolized rule is the following: P(C/M) = P(C) * P(M/C) / P(C) * P(M/C) + P(~C) * P(M/~C)

When we aren't using the "/" symbol we are referring to the prior probability of something. The prior probability of an event of hypothesis is basically the probability of it with our current knowledge without updated evidence. In this scenario the updated evidence would be the test results. Since only 1 % of women tested will have cancer, then the prior probability before evidence is 1 %. So "P(C)" = the prior probability of having cancer.

Here are the numbers:

P(C) = .01 since 1 percent of women tested will have cancer.

P(M/C) = .8 since 80 percent of the women with breast cancer will have a positive mammography.
P(~C) = .99 since 99 percent of women tested will not have cancer.
P(M/~C) = .096 since 9.6 percent of women without cancer will have a positive mammography.

With these above numbers we can solve the equation:

P(C) * P(M/C) = .01 * .8 = .008
P(C) * P(M/C) + P(~C) * P(M/~C) = .01 * .8 + .99 * .096 = .008 + .09504 = .10304
Now you divide the top number by the bottom, so it is .008 / .10304 = .07764
The end result is that the probability of having cancer given a positive mammography is only 7.8 percent. This is higher than the prior probability of 1 percent, but still nothing to be too worried about.


I think everything up there is all correct, but here is a crucial link anyways: http://yudkowsky.net/rational/bayes/

No comments:

Post a Comment