Bayes_factor

Bayes_factor#

Compute Bayes factor using Savage–Dickey ratio.

We can apply this function when the null model is nested within the alternative. In other words when the null (ref_val) is a particular value of the model we are building (see here).

For others cases computing Bayes factor is not straightforward and requires more complex methods. Instead, of Bayes factors, we usually recommend Pareto smoothed importance sampling leave one out cross validation (PSIS-LOO-CV). In ArviZ, you will find them as functions with loo in their names.

Matplotlib version of plot_bf

Link to this page with the bokeh tab selected

Link to this page with the plotly tab selected

from arviz_base import load_arviz_data

import arviz_plots as azp

azp.style.use("arviz-variat")

data = load_arviz_data("centered_eight")

pc = azp.plot_bf(
    data,
    backend="none",  # change to preferred backend
    var_names="mu"
)

pc.show()

See also

API Documentation: plot_bf

Other examples with plot_bf#