BayesFactor | R Documentation |
Estimate Bayes factor between two models for two “fevd” objects.
BayesFactor(m1, m2, burn.in = 499, FUN = "postmode",
method = c("laplace", "harmonic"), verbose = FALSE)
m1 , m2 |
objects of class “fevd” giving the two models to be compared. |
burn.in |
numeric how many of the first several iterations from the MCMC sample to throw away before estimating the Bayes factor. |
FUN |
function to be used to determine the estimated parameter values from the MCMC sample. With the exception of the default (posterior mode), the function should operate on a matrix and return a vector of length equal to the number of parameters. If “mean” is given, then |
method |
Estimation method to be used. |
verbose |
logical, should progress information be printed to the screen (no longer necessary). |
Better options for estimating the Bayes factor from an MCMC sample are planned for the future. The current options are perhaps the two most common, but do suffer from major drawbacks. See Kass and Raftery (1995) for a review.
A list object of class “htest” is returned with components:
statistic |
The estimated Bayes factor. |
method |
character string naming which estimation method was used. |
data.name |
character vector naming the models being compared. |
Eric Gilleland
Kass, R. E. and Raftery, A. E. (1995) Bayes factors. J American Statistical Association, 90 (430), 773–795.
fevd
data(PORTw)
fB <- fevd(TMX1, PORTw, method = "Bayesian", iter = 500)
fB2 <- fevd(TMX1, PORTw, location.fun = ~AOindex,
method = "Bayesian", iter = 500)
BayesFactor(fB, fB2, burn.in = 100, method = "harmonic")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.