Definitioncore
Bayes factor
Also called Bayes factor test.
The ratio of the marginal likelihoods of the data under two models. It turns prior odds into posterior odds and does not depend on the prior probabilities of the models.
A Bayes factor compares two statistical models and by how well each one predicted the observed data , with its parameters averaged over its prior. It is the ratio of the two marginal likelihoods. By Bayes's theorem, it is the factor that converts the prior odds of against into the posterior odds, so it does not depend on the prior probabilities of the two models. Jeffreys introduced it to test scientific hypotheses, and it is the Bayesian counterpart of the likelihood ratio.
Definition
Let be the data. For , model has a parameter , a sampling density and a proper prior density . The marginal likelihood of is
If and , the Bayes factor of against is
If is a simple hypothesis , then , and for two simple hypotheses is the likelihood ratio of the Neyman-Pearson lemma.
Odds form. For prior model probabilities ,
Proof. with . Divide the case by the case .
Three facts that follow from the definition.
- Chaining. For three models, , so Bayes factors order any set of models consistently.
- Null expectation 1. If is simple, then , because is a probability density. By Markov's inequality . So is an e-variable for a simple null. For a composite null this fails in general.
- Bounded by the maximized ratio. , so if is simple, is at most the maximized likelihood ratio, for every prior .
Reading the size. Jeffreys (Appendix B) graded in steps of half a unit of . Against : to is "not worth more than a bare mention", to substantial, to strong, to very strong, and above decisive. Kass and Raftery (1995) give a coarser scale, quoted on the marginal likelihood page. These words are conventions, not error rates.
What a Bayes factor is not. It is a ratio of predictive probabilities, not a test with a level. The rule "reject when " is a test, and its type I error is at most for a simple null by the fact above, but the number itself has no level and no type II error. It is also not a p-value and not the posterior probability of ; the posterior probability needs the prior odds as well.
Examples and non-examples
Example: a coin, exact. Toss a coin times and see heads. Let and Beta, the uniform prior. Then
So , and . With prior odds , . On Jeffreys's grades it is just past , at the bottom of the substantial grade. The exact fractions agree with a direct sum of the binomial terms over a fine grid of .
Example: the prior matters. With Beta and the same data:
| 0.01 | 0.1 | 0.5 | 1 | 2 | 5 | 10 | 100 | 1000 | |
|---|---|---|---|---|---|---|---|---|---|
| 0.089 | 0.767 | 2.404 | 3.221 | 3.666 | 3.298 | 2.569 | 1.198 | 1.020 |
A very diffuse prior ( puts the mass near and ) wastes prior mass on values that the data rule out, and goes to : the data then favour . A very concentrated prior () makes the same as , and . Unlike the posterior of , the Bayes factor does not forget the prior as grows. The limit of this effect is the Lindley paradox.
Example: two simple hypotheses. For , and , . At it is .
Non-example: the p-value. For the coin, the two-sided binomial p-value is . It is computed under alone, it is not , and it is not . See p-value.
Non-example: the maximized likelihood ratio. is the statistic of the likelihood ratio test. It uses the best for the data, not an average over the prior, and it is an upper bound for over every prior on .
Non-example: a ratio with an improper prior. If is improper, is the same prior for every , but it multiplies and the "Bayes factor" by . The ratio is not defined; see improper prior. Only parameters that both models share, with the same improper prior, are safe.
Non-example: posterior odds. equals only when the prior odds are .
Related definitions
- Marginal likelihood. The numerator and the denominator. Most of the work in practice is computing it.
- Savage-Dickey density ratio. A formula, not a new quantity: when fixes inside and the priors are compatible, equals the posterior density of at divided by its prior density there.
- Lindley paradox. A theorem about the behaviour of for a point null as grows with the z-statistic fixed, or as the prior spreads. It explains why and a p-value can disagree.
- Bridge sampling and nested sampling. Monte Carlo methods that estimate or the ratio ; they compute the Bayes factor and do not change its definition.
- Bayesian information criterion. approximates with an error of order , so is a rough approximation to that does not depend on the prior.
- Intrinsic and fractional Bayes factors. To use default improper priors, Berger and Pericchi (1996) train them into proper priors on minimal subsets of the data and average over the subsets. O'Hagan (1995) uses a fraction of the likelihood for the same purpose. Both are approximations to some Bayes factor, not Bayes factors of the original priors.
- Posterior model probabilities. With more than two models, . Bayesian model averaging uses them as weights.
- Likelihood ratio test. The frequentist relative: it maximizes over the parameters where the Bayes factor integrates, and it is calibrated by its distribution under .
- Predictive criteria. PSIS-LOO and WAIC score prediction of each point from the posterior. The Bayes factor scores prediction of all the data from the prior. The two can disagree, and only the Bayes factor depends on how diffuse the prior is.
References
- Robert E. Kass and Adrian E. Raftery, Bayes factors, Journal of the American Statistical Association 90(430), 1995, pages 773 to 795 (the definition, the scale for interpretation, the Schwarz approximation, and the methods to compute marginal likelihoods; general locator)
- Harold Jeffreys, Theory of Probability, 3rd edition (1961), reprinted in Oxford Classic Texts in the Physical Sciences, Oxford University Press, 1998, Chapter 5 (significance tests with one new parameter) and Appendix B (the grades of the Bayes factor K)
- Christian P. Robert, Nicolas Chopin and Judith Rousseau, Harold Jeffreys's Theory of Probability revisited, Statistical Science 24(2), 2009, pages 141 to 172 (Jeffreys's tests, Appendix B and its grades of K; general locator)
- Berger and Pericchi 1996, the intrinsic Bayes factor built from minimal training samples (general locator)
- O'Hagan 1995, the fractional Bayes factor that uses a fraction b of the likelihood to train an improper prior (general locator)
- Christian P. Robert, The Bayesian Choice, 2nd edition, Springer, 2007, Chapter 5 (tests and confidence regions, Bayes factors, and the conflict with p-values) and Chapter 7 (model choice)
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag T4B5GB Edit this page History Report an error Markdown