Following MacKay Chapter 2:
The frequencies of all $27^2$ 2-letter bigrams $xy$ in the Linux FAQ, from MacKay Ch. 2.
${\rm Pr}(x,y)\;={\rm Pr}(x|y)\;{\rm Pr}(y)$
${\rm Pr}(x,y)\;={\rm Pr}(y|x)\;{\rm Pr}(x)$
The conditional probabilities for bigrams $xy$ in the Linux FAQ, from MacKay Ch. 2. The one on the left helps answer the question: which letter is likely to come next?
Q: What additional information do you need to turn the joint distribution above into these figures?
${\rm Pr}(x) = \sum_y\;{\rm Pr}(x,y)$
${\rm Pr}(x) = \int\;{\rm Pr}(x,y)\;dy$
$\int\;{\rm Pr}(x,y)\;dx\,dy = 1$
${\rm Pr}(x,y\,|\,H)\;={\rm Pr}(x\,|\,y,H)\;{\rm Pr}(y\,|\,H)$
In everyday life we use words like "probability," "chances", "odds" and so on all the time to describe our belief in things.
Here's an example, due to poet and educator Hilaire Belloc:
Discuss degree of belief and quantifiable probability with your neighbor, and see if you can come up with an example. Whose beliefs are involved, and how is the probability quantified? Can you distinguish between a probability that is equal to a frequency, and a probability that describes a degree of belief, in your scenario?
$B(x)$ can be mapped onto, and indeed replaced by, probability ${\rm Pr}(x)$ if the Cox Axioms are satisfied. As a checklist, these are:
If your degree of belief $B(x)$ is greater than your degree of belief $B(y)$, and your degree of belief $B(y)$ is greater than your degree of belief $B(z)$, is $B(x)$ greater than $B(z)$? Yes: this means that degree of belief can be represented by numbers
Is degree of belief $B(x)$ related to $B(NOT x)$? Yes: one goes up as the other goes down, like probabilities.
Does your degree of belief in both $x$ and $y$ depend on the degree of belief in $y$ and the degree of belief in $x$ given $y$?
${\rm Pr}(x|d,H)\;=\frac{1}{Z}{\rm Pr}(d|x,H)\;{\rm Pr}(x|H)$
where $Z$ is a normalization factor given by
$Z = \int {\rm Pr}(d|x,H)\;{\rm Pr}(x|H)\;dx = {\rm Pr}(d|H)$
${\rm Pr}(H|d)\;=\;{\rm Pr}(d|H)\;{\rm Pr}(H)\;/\;{\rm Pr}(d)$
You go to the doctor to be tested for a rare disease, and the test comes back positive.
The test is pretty good: it has a 95% true positive rate, and a 10% false positive rate. The incidence of the disease in the general population is 1 in 5000.
What is the probability that don't have the disease? Are your chances better or worse than 5%?
Let's edit the code below and compute this posterior probability using Bayes Theorem.
In [1]:
P_testpositive_given_sick = 0.95
P_testnegative_given_healthy = 0.10
P_sick = 1.0/5000.0
Z = 'normalization'
P_sick_given_testpositive = 'unknown...'
print(P_sick_given_testpositive)
Now let's go back to the Xray Image
In [ ]: