This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
bayesian_statistics [2019/10/03 03:10] floyd |
bayesian_statistics [2019/10/03 18:21] (current) floyd |
||
---|---|---|---|
Line 32: | Line 32: | ||
For example, you go to a pet store looking for a small mammal with white fur. There is a box and you are told that one out of six animals in the box have white fur and that there are both eight mice and ten hamsters in the box for a total of 18 individuals. 2 of the mice have white fur and 1 of the hamsters have white fur. Before you reach in the box you know the probability of grabbing an individual with white fur is $3/18 = 0.1\bar{6}$ You reach in and can feel that you have grabbed a mouse but can't see it yet. Given that you have a mouse the probability of white fur is now | For example, you go to a pet store looking for a small mammal with white fur. There is a box and you are told that one out of six animals in the box have white fur and that there are both eight mice and ten hamsters in the box for a total of 18 individuals. 2 of the mice have white fur and 1 of the hamsters have white fur. Before you reach in the box you know the probability of grabbing an individual with white fur is $3/18 = 0.1\bar{6}$ You reach in and can feel that you have grabbed a mouse but can't see it yet. Given that you have a mouse the probability of white fur is now | ||
- | $$P(\mbox{white}|\mbox{mouse})=\frac{\mbox{white}\cap\mbox{mouse}}{P(\mbox{mouse})}=\frac{2/ | + | $$P(\mbox{white}|\mbox{mouse})=\frac{P(\mbox{white}\cap\mbox{mouse})}{P(\mbox{mouse})}=\frac{2/ |
and indeed 1/4 of the mice have white fur (2 out of 8). This is an awkward way to calculate the probability, | and indeed 1/4 of the mice have white fur (2 out of 8). This is an awkward way to calculate the probability, | ||
Once we accept the relationships between the probabilities we can easily rearranged the system to the classical Bayesian equation | Once we accept the relationships between the probabilities we can easily rearranged the system to the classical Bayesian equation | ||
+ | $$P(M|D) P(D) = P(M) \cap P(D) = P(D|M) P(M)\mbox{, | ||
$$P(M|D) P(D) = P(D|M) P(M)\mbox{, | $$P(M|D) P(D) = P(D|M) P(M)\mbox{, | ||
$$P(M|D) = \frac{P(D|M) P(M)}{P(D)}\mbox{.}$$ | $$P(M|D) = \frac{P(D|M) P(M)}{P(D)}\mbox{.}$$ | ||
+ | The probability of the model (or hypothesis) given the data can be calculated from the probability of the data and a prior probability of the model. | ||
Let's bring this into our example. | Let's bring this into our example. |