0:01

In this video, we will continue with the HIV testing example to introduce

Â the concept of Bayes factors.

Â Earlier, we introduced the concept of priors and posteriors.

Â The prior odds is defined as the ratio of the prior probabilities

Â assigned to the hypotheses or models we're considering.

Â So if there are two competing hypotheses being considered,

Â then the prior odds of hypothesis one to hypothesis two can be defined as

Â O of H1 to H2, which is equal to the probability of H1 over probability of H2.

Â Similarly, the posterior odds is the ratio of the two posterior probabilities of this

Â hypotheses.

Â That is PO of H1 to H2 is the probability of H1 given data

Â divided by the probability of H2 given data.

Â Using Bayes rule, we can rewrite the posterior probabilities as the probability

Â of the data given the hypothesis times the prior for

Â that hypothesis divided by the probability of data.

Â The probability of data in both the numerator and denominator cancels, and

Â we can reorganize this as the ratio of the data given H1 and

Â data given H2 times the ratio of the prior probabilities of these hypothesis.

Â The first quantity, the ratio of the probabilities of data given these two

Â hypotheses is defined as the Bayes factor.

Â And the second quantity is the prior odds that we saw earlier.

Â In other words, the posterior odds is the product of the bayes factor and

Â the prior odds for these two hypotheses.

Â The Bayes factor quantifies the evidence of data arising from hypothesis one

Â versus hypothesis two.

Â In a discrete case, this is simply the ratio of the likelihoods of the observed

Â data under the two hypotheses or models.

Â However, in a continuous case, it's the ratio of the marginal likelihoods.

Â In this way,

Â we are considering all possible values of the model parameters theta.

Â In this video, we will stick with the simpler discrete case.

Â And in upcoming videos,

Â we will revisit calculating Bayes factors for more complicated models.

Â Let's return to the HIV testing example from earlier,

Â where our patient had tested positive in the ELISA.

Â Remember that our hypotheses, our patient does not have HIV, and patient has HIV.

Â The prior probabilities we place on these hypothesis came from the prevalence of

Â HIV at the time in the general population.

Â We were told that the prevalence of HIV in the population was 1.48 out of 1000,

Â hence the prior probability assigned to hypothesis 2 is 0.00148.

Â And the prior assigned to hypothesis 1 is simply the complement of this.

Â Hence, the prior odds can be calculated as the ratio of these two values,

Â which comes out to approximately 674.68.

Â We also calculated posterior probabilities of these hypotheses given a positive

Â result.

Â These were approximately 0.88 and 0.12.

Â We'll hold on to more decimal places in our calculations to avoid rounding

Â errors later.

Â Hence, the posterior odds is approximately 7.25,

Â then we can calculate the Bayes factor as the ratio of the posterior

Â odds to prior odds which comes out to approximately 0.0108.

Â Note that in this simple discrete case the Bayes factor, it simplifies to

Â the ratio of the likelihoods of the observed data under the two hypotheses.

Â Remember that the true positive rate of the test was 0.93 and

Â the false positive rate was 0.01.

Â Using these two the base factor also comes out to approximately 0.0108.

Â 3:38

So now that we calculated the Bayes factor, the next natural question is,

Â what does this number mean?

Â A commonly used scale for interpreting Bayes factors is proposed by Jeffreys and

Â it's as follows.

Â If the Bayes factor is between one and

Â three, the evidence against H2 is not worth a bare mention.

Â If it's 3 to 20 the evidence is positive.

Â If it's 30 to 150 the evidence is strong and

Â if it's greater than 150 the evidence is very strong.

Â It might have caught youre attention that the base factor we calculated does

Â not even appear on the scale.

Â To obtain a base factor value on the scale we will need to change the order of our

Â hypotheses and calculate the base factor for hypotheses two to hypothesis one.

Â And look for evidence against hypothesis one instead.

Â We can calculate the Bayes factor as a reciprocal of the Bayes factor for

Â hypothesis one to hypothesis two.

Â For our data, this comes out to approximately 93.

Â Hence, evidence against hypothesis one,

Â which states that the patient does not have HIV is strong.

Â This means that even though the posterior for

Â having HIV given a positive result was low, we would still decide

Â according to the scale based on a positive elisa that the patient has HIV.

Â An intuitive way of thinking about this is to consider not only the posteriors, but

Â also the priors assigned to this hypotheses.

Â Bayes factor is the ratio of the posterior odds to prior odds.

Â While 12% is a low posterior probability for

Â having HIV given a positive ELISA result, this value is still much higher

Â than the overall prevalence of HIV in the population.

Â In other words, the prior probability for that hypothesis.

Â 5:22

Another commonly used scale for

Â interpreting Bayes factors is proposed by Kass and Raftery, and

Â it deals with the natural logarithm of the calculated Bayes factor.

Â Reporting of the log scale can be helpful for

Â numerical accuracy reasons when the likelihoods are very small.

Â Taking two times the natural logarithm of the Bayes factor we calculated earlier,

Â we would end up with the same decision that the evidence

Â against hypothesis two is strong.

Â To recap, in this video we defined prior odds, posterior odds, and Bayes factors.

Â We learned about scales by which we can interpret these values for

Â model selection.

Â We also re-emphasize that in Bayesian testing,

Â the order in which we evaluate the models of hypotheses does not matter.

Â Since the Bayes factor of hypothesis two versus hypothesis one is

Â simply the reciprocal of the Bayes factor for hypothesis one versus hypothesis two.

Â