Learn R Programming

EMC2 (version 2.1.0)

get_BayesFactor: Bayes Factors

Description

returns the Bayes Factor for two models

Usage

get_BayesFactor(MLL1, MLL2)

Value

The BayesFactor for model 1 over model 2

Arguments

MLL1

Numeric. Marginal likelihood of model 1. Obtained with run_bridge_sampling()

MLL2

Numeric. Marginal likelihood of model 2. Obtained with run_bridge_sampling()

Examples

Run this code
if (FALSE) {
# First get the marginal likelihood for two_models
# Here the full model is an emc object with the hypothesized effect
# The null model is an emc object without the hypothesized effect
MLL_full <- run_bridge_sampling(full_model, cores_per_prop = 3)
MLL_null <- run_bridge_sampling(null_model, cores_per_prop = 3)
# Now we can calculate their Bayes factor
get_BayesFactor(MLL_full, MLL_null)
}

Run the code above in your browser using DataLab