BF: Calculate Bayes Factor

View source: R/mtraceR.R

BFR Documentation

Calculate Bayes Factor

Description

BF calculates log Bayes factors (LBF) of all models compared against the model that has the highest log likelihood. The models are then ranked based on LBF (mod.rank) and the model probability (mod.prob) is calculated.

Usage

BF(lmLs = NULL)

Arguments

lmLs

Numeric vector with log marginal likelihood values of the models

Details

A LBF value of -2 (or smaller) indicates support for reference model (the model that has the highest log likelihood). Values smaller than -6 indicate a strong evidence in favour of the reference model (Kass and Raftery 1995).

Value

A data.frame with log Bayes factors (LBF), the models' ranks (mod.rank) and the models' probability (mod.prob).

Examples

# From migrate-n tutotial: 'Comparison of gene flow models using
# Bayes Factors' (Beerli 2010)
 mod.comp <- BF(c(-4862.85, -4860.58, -4863.08, -4887.25))
 mod.comp

carlopacioni/mtraceR documentation built on Nov. 3, 2023, 4:30 a.m.