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
Previous revision
bayesian_statistics [2019/10/03 03:14]
floyd
bayesian_statistics [2019/10/03 18:21] (current)
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%. {{thaplotypecross1.png?300}}+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%. 
 $$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{.}$${{thaplotypecross1.png?300}}+$$P(M) \cap P(D)=P(M|D) P(D) = P(D|M) P(M)\mbox{.}$$
 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 36: Line 36:
  
 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. 
bayesian_statistics.1570072463.txt.gz ยท Last modified: 2019/10/03 03:14 by floyd