User Tools

Site Tools


bayesian_statistics

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
bayesian_statistics [2019/10/03 03:10]
floyd
bayesian_statistics [2019/10/03 03:14]
floyd
Line 11: Line 11:
 You are doing a project on quantifying the reproductive success of male mice with the //t//-haplotype in the wild. However, you can only directly observe the offspring of individual (normal tailed, +/+) females without knowing the identity of the male parents. (Here assume each batch of offspring has only one male parent and belongs to the female it is found with in the nest.) You want to calculate the probability that the male parent was a $t$/+ heterozygote given the observation of the number of +/+ offspring. First off, before observing any more data, we can use the information of the 5% frequency of heterozygotes in the population from earlier studies. Our "prior" probability of a heterozygous father is $P(M_1) = 0.05$. Here were are using $P()$ to represent probability and $M_1$ to represent one of our models. A model is a hypothesis and our first hypothesis in this example is that the father is heterozygous. Our second model is that the father is a wildtype homozygote.  You are doing a project on quantifying the reproductive success of male mice with the //t//-haplotype in the wild. However, you can only directly observe the offspring of individual (normal tailed, +/+) females without knowing the identity of the male parents. (Here assume each batch of offspring has only one male parent and belongs to the female it is found with in the nest.) You want to calculate the probability that the male parent was a $t$/+ heterozygote given the observation of the number of +/+ offspring. First off, before observing any more data, we can use the information of the 5% frequency of heterozygotes in the population from earlier studies. Our "prior" probability of a heterozygous father is $P(M_1) = 0.05$. Here were are using $P()$ to represent probability and $M_1$ to represent one of our models. A model is a hypothesis and our first hypothesis in this example is that the father is heterozygous. Our second model is that the father is a wildtype homozygote. 
  
-Let's say that we observe a single +/+ offspring. Now we need to calculate the probability of our data, $P(D)$. This is integrated over all models. Either the parent is a heterozygote, with a probability of 5% and the probability of a +/+ offspring is 10%, or the parent is a +/+ homozygote and the probability of a +/+ offspring is 100%. +Let's say that we observe a single +/+ offspring. Now we need to calculate the probability of our data, $P(D)$. This is integrated over all models. Either the parent is a heterozygote, with a probability of 5% and the probability of a +/+ offspring is 10%, or the parent is a +/+ homozygote and the probability of a +/+ offspring is 100%. {{thaplotypecross1.png?300}}
 $$P(D) = 0.05 \times 0.1 + 0.95 \times 1 = 0.955$$ $$P(D) = 0.05 \times 0.1 + 0.95 \times 1 = 0.955$$
 You can also see that You can also see that
Line 18: Line 18:
  
 We are interested in the probability of the model given the data and it turns out that We are interested in the probability of the model given the data and it turns out that
-$$P(M) \cap P(D)=P(M|D) P(D) = P(D|M) P(M)\mbox{.}$$+$$P(M) \cap P(D)=P(M|D) P(D) = P(D|M) P(M)\mbox{.}$${{thaplotypecross1.png?300}}
 The joint probability (intersection, $\cap$) of the model and the data is equal to both the probability of the model given the data times the probability of the data and the probability of the data given the model times the probability of the model---these are kind of flip side perspectives of looking at the same combinations of probabilities. The joint probability (intersection, $\cap$) of the model and the data is equal to both the probability of the model given the data times the probability of the data and the probability of the data given the model times the probability of the model---these are kind of flip side perspectives of looking at the same combinations of probabilities.
  
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/18}{8/18}=1/4$$+$$P(\mbox{white}|\mbox{mouse})=\frac{P(\mbox{white}\cap\mbox{mouse})}{P(\mbox{mouse})}=\frac{2/18}{8/18}=1/4$$
 and indeed 1/4 of the mice have white fur (2 out of 8). This is an awkward way to calculate the probability, but it does show the equation and relationship between the probabilities work.  and indeed 1/4 of the mice have white fur (2 out of 8). This is an awkward way to calculate the probability, but it does show the equation and relationship between the probabilities work. 
  
bayesian_statistics.txt ยท Last modified: 2019/10/03 18:21 by floyd