bf: Bayes Factor(s) from Marginal Likelihoods

Description Usage Arguments Details Value Note Author(s) References

View source: R/bf.R

Description

Generic function that computes Bayes factor(s) from marginal likelihoods. bayes_factor() is simply an (S3 generic) alias for bf().

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
bf(x1, x2, log = FALSE, ...)

bayes_factor(x1, x2, log = FALSE, ...)

## Default S3 method:
bayes_factor(x1, x2, log = FALSE, ...)

## S3 method for class 'bridge'
bf(x1, x2, log = FALSE, ...)

## S3 method for class 'bridge_list'
bf(x1, x2, log = FALSE, ...)

## Default S3 method:
bf(x1, x2, log = FALSE, ...)

Arguments

x1

Object of class "bridge" or "bridge_list" as returned from bridge_sampler. Additionally, the default method assumes that x1 is a single numeric log marginal likelihood (e.g., from logml) and will throw an error otherwise.

x2

Object of class "bridge" or "bridge_list" as returned from bridge_sampler. Additionally, the default method assumes that x2 is a single numeric log marginal likelihood (e.g., from logml) and will throw an error otherwise.

log

Boolean. If TRUE, the function returns the log of the Bayes factor. Default is FALSE.

...

currently not used here, but can be used by other methods.

Details

Computes the Bayes factor (Kass & Raftery, 1995) in favor of the model associated with x1 over the model associated with x2.

Value

For the default method returns a list of class "bf_default" with components:

For the method for "bridge" objects returns a list of class "bf_bridge" with components:

For the method for "bridge_list" objects returns a list of class "bf_bridge_list" with components:

Note

For examples, see bridge_sampler and the accompanying vignettes:
vignette("bridgesampling_example_jags")
vignette("bridgesampling_example_stan")

Author(s)

Quentin F. Gronau

References

Kass, R. E., & Raftery, A. E. (1995). Bayes factors. Journal of the American Statistical Association, 90(430), 773-795. doi: 10.1080/01621459.1995.10476572


bridgesampling documentation built on April 16, 2021, 9:07 a.m.