Computing Bayes factors

The computation of Bayes factors can be framed as a hierarchical model, where the high-level parameter is an index that's assigned to each model and sampled from a categorical distribution. In other words, we perform inference of the two (or more) competing models at the same time and we use a discrete variable that jumps between models. How much time we spend sampling each model is proportional to . Then, we apply equation 5.10 to get Bayes factors.

To exemplify the computation of the Bayes factors, we are going to flip coins one more time:

Figure 5.10

Notice that while we are computing Bayes factors between models ...

Get Bayesian Analysis with Python - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.