MAT 411 Bayesian Data Analysis

The Prior strikes back

Lets look at this problems except, whats the probability of flipping 4 heads out of 10

We know this is Binomial Experiment and thus not the exact answer

Binomial Probability = $P(x) = \left(_x^n\right)p^xq^{n-x} = \frac{n!}{(n-x)!x!}p^xq^{n-x}$

A Difference between Frequentist and Bayesian

Confidence interval = $ \mu \pm z^*\frac{\sigma}{\sqrt{n}}$

Monty Hall Problem

Game show:

The contenstant chooses a door from 3, then the host picks another door and opens it( it will contain a goat)

So either the door that is not picked or the contestants door contains the big prize and the other a donkey.

Question What should the contestant do to improve his chances, either stick with the door or choose the last door?

So lets run the game, using this type of code and find out what is the best stratergy

Diabetic Robber

We know a person robbed a store, because the left some blood, we now know they are diabetic.

In America the prevalence of diabetes is 14.6% in men and 9.1% in females. Given we know the blood from the robber, whats the probability of them being male.

Bayes Theorem

$$ P(A|B) = ? $$

What is the blue?

So blue divided by all of original green (B) ....

$$ P(A|B) = \frac{P(A\cap B)}{P(B)} $$

So our analytical solution to our Robbery problem is

$$ P(\text{Male Given Diabetic}) = \frac{P(\text{Male and Diabetic})}{P(\text{Diabetic}) }$$$$ P(\text{Male Given Diabetic}) = \frac{0.5\times 0.146}{0.5\times 0.146 + 0.5\times0.091} $$