bayes_factor {multibridge}R Documentation

S3 method for class 'bayes_factor.bmult'

Description

Extracts information about computed Bayes factors from object of class bmult

Usage

bayes_factor(x)

Arguments

x

object of class bmult as returned from mult_bf_informed or binom_bf_informed or an object of class bmult_bridge as returned from mult_bf_inequality or binom_bf_inequality

Value

Returns list with three data.frames. The first dataframe bf_table summarizes information the Bayes factor for equality and inequality constraints. The second dataframe error_measures contains for the overall Bayes factor the approximate relative mean-squared error re2, the approximate coefficient of variation cv, and the approximate percentage error percentage. The third dataframe $bf_ineq_table summarized information about the Bayes factor for inequality constraints, that is, the log marginal likelihood estimates for the constrained prior and posterior distribution. In addition, it contains for each independent Bayes factor the approximate relative mean-squared error re2

Note

In case the restricted hypothesis is tested against H_0 four data.frames will be returned. The fourth dataframe $bf_eq_table summarizes information about the Bayes factor for equality constraints compared to the encompassing hypothesis.

Examples

# data
x <- c(3, 4, 10, 11)
n <- c(15, 12, 12, 12)
# priors
a <- c(1, 1, 1, 1)
b <- c(1, 1, 1, 1)
# informed hypothesis
factor_levels <- c('theta1', 'theta2', 'theta3', 'theta4')
Hr            <- c('theta1', '<',  'theta2', '<', 'theta3', '<', 'theta4')

## Multinomial Case
out_mult  <- mult_bf_informed(x=x, Hr=Hr, a=a, factor_levels=factor_levels,
niter=1e3, seed=2020)
bayes_factor(out_mult)

[Package multibridge version 1.2.0 Index]