Calculate Bayes factors and posterior model probabilities
list of marginal likelihood objects, see details
numeric, the prior model probabilities
logical, whether to perform parametric boostrap of probabilities
numeric, number of bootstrap samples
numeric, the probability used to calculate the boostrap CI
Input is a list of marginal likelihood objects, with each object generated by
TRUE, parametric bootstrap is performed by assuming the log-marginal
likelihood estimates are normally distributed with standard deviation equal
to the standard error. The re-sampled
n marginal log-likelihoods are
used to estimate re-sampled posterior probabilities, and to calculate an
equal-tail bootstrap confidence interval for these.
Note that the length of
prior should be the same as the number of
models being compared. The
prior is rescaled so that
sum(prior) == 1.
A list with elements
bf, the Bayes factors;
pr, the posterior
prior the prior model probabilities and, if
boot = TRUE,
pr.ci the equal-tail bootstrap confidence interval.
Mario dos Reis
1 2 3 4 5 6 7 8 9 10
# See Table 5 in dos Reis et al. (2018, Syst. Biol., 67: 594-615) # Bayesian selection of relaxed clock models for the 1st and 2nd sites # of mitochondrial protein-coding genes of primates # Models: strick clock, independent-rates, and autocorrelated-rates sc <- list(); sc$logml <- -16519.03; sc$se <- .01 ir <- list(); ir$logml <- -16480.58; ir$se <- .063 ar <- list(); ar$logml <- -16477.82; ar$se <- .035 bayes.factors(sc, ir, ar) bayes.factors(sc, ir, ar, prior=c(.25,.5,.25)) bayes.factors(sc, ir, ar, prior=c(0,1,0))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.