Computes inclusion Bayes factors based on prior model probabilities, posterior model probabilities (or natural-log marginal likelihoods), and an indicator of whether the models represent the null or alternative hypothesis.
inclusion_BF(
prior_probs,
post_probs,
margliks,
is_null,
on_failure = c("error", "drop", "zero")
)vector of prior model probabilities summing to one.
vector of posterior model probabilities summing to one.
vector of natural-log marginal likelihoods.
logical vector of indicators whether the model corresponds
to the null or alternative hypothesis (or an integer vector indexing models
corresponding to the null hypothesis; use 0 or integer(0)
when no models are null)
policy for missing marginal likelihoods in models with
positive prior probability. See compute_inference().
inclusion_BF returns a Bayes factor.
Supplying margliks as the input is preferred since it is better at dealing with
under/overflow (posterior probabilities are very close to either 0 or 1). In case that both the
post_probs and margliks are supplied, the results are based on margliks.
If the prior probability of either the null or alternative hypothesis is
zero, the Bayes factor is undefined and NA is returned.