When to use Baye’s rule

You have a hypothesis and observed some evidence.
You want .
You limit the space of total possibilities.

Baye’s Theorem: What’s ?

What are the chances of me having cancer? If I don’t know anything else, the chances are the same as anyone else in my demographic → That’s the prior , the best guess without any futther info.
If I take a test or have a symptom, I get extra information about and can update that information.
is something we usually can calculate pretty easily as opposed to updating (would need to collect more data, …).
So the basic idea of bayesian statistics is sequentially updating your beliefs given new information.

If we don’t know , we can compute it witht the help of the law of total probability.

Or generally, for disjoint sets , i.e mutually exclusive hypotheses for explaining :

Sensitivity and specificity

Assume a drug test which has 90% sensitivity, i.e. the probability of a positive result given it’s a drug user , and 80% specificity, i.e. . This test is quite bad, 20% of non-users get a false positive. Let’s also say 10% of the population use the drug .
The probability of someone being a drug-user after testing positive is:

So the probability that you did actually use the drug is only 33%. Even if the sensitivity is 1, we only reach ~35%.
This error gets better for more common events.

This is also relevant for machine learning: We can get close to 100% accuracy just by ignoring very rare samples (high sensitivity, low specificity).


Among cases where the evidence is true, how often is the hypothesis true?
750|center
752|center

… probability of both the hypothesis and evidence occurying together. Forms an Area.
center
Thinking of probability geometrically, as proportions is incredibly helpful.

How to make accurate predicitons

Have an estimate of the situation before you consider the evidence. This is the prior … how likely is it, not knowing/considering the extra evidence.
This is your initial belief. And the evidence only updates this belief. A common fallacy is that you disregard the prior…

The belief about the hypothesis after seeing the evidence () is called posterior.

The formula

… hypothesis
… evidence

rare disease example

Someone takes a test for a rare disease after returning from an exotic country. The test indicates a true positive rate of (sensitivity). The disease itself is extremely rare, with a probability of of travelers from that country contracting it. Assuming a false positive rate (specificity error) of , we can calculate the probability of actually having the disease given a positive test result.

So we know:

  • : The probability of a positive test result when the disease is present, which is .
  • : The baseline probability of contracting the disease, which is .
  • : The probability of a positive test result when the disease is not present, assumed to be .

TODO finish example

References

probability
bayesian statistics