Learn R Programming

extRemes (version 2.1-1)

BayesFactor: Estimate Bayes Factor

Description

Estimate Bayes factor between two models for two “fevd” objects.

Usage

BayesFactor(m1, m2, burn.in = 499, FUN = "postmode", 
    method = c("laplace", "harmonic"), verbose = FALSE)

Arguments

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 colMeans is actually used.

method

Estimation method to be used.

verbose

logical, should progress information be printed to the screen (no longer necessary).

Value

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.

Details

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.

References

Kass, R. E. and Raftery, A. E. (1995) Bayes factors. J American Statistical Association, 90 (430), 773--795.

See Also

fevd

Examples

Run this code
# NOT RUN {
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")

# }

Run the code above in your browser using DataLab