Bayes.factor: Bayes factor of the two models

Description Usage Arguments Details References Examples

View source: R/Bayes.factor.R

Description

Compares two models by evaluating their Bayes factor

Usage

1
Bayes.factor(model1, model2, inter=TRUE)

Arguments

model1

object of the class model "Bayesthresh"

model2

object of the class model "Bayesthresh"

inter

If TRUE, print to scale for interpretation of the Bayes factor

Details

At each step during the Markov chains, the marginal likelihood for a model is evaluated, conditioning on actual values for the parameters in that step. Bayes factor is then estimated by the ratios of the arithmetic means of marginal likelihoods from both models. Details of the implementation can be found in Sorensen and Gianola (2004). For a discussion of the possible interpretation of Bayes factors, see Jeffreys(1961)

References

SORENSEN, D.; GIANOLA, D. Likelihood, bayesian and MCMC methods in quantitative genetics. United States of America: Springer, 2004. 740 p.

JEFFREYS, H. Theory of probability. Oxford: Claredon Press, 1961. 470 p.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
data(sensory)

Consumer <- factor(sensory$consumer)
Sacarose <- factor(sensory$sacarose)

# Not run

#### Model 1

# Model with Gaussian link

dex1 <- Bayesthresh(flavor ~ (1|Consumer) + Sacarose, burn = 0, jump = 1,
        ef.iter = 10, data=sensory) 
summary(dex1)

#### Model 2

# Model with t-Student link

dex2 <- Bayesthresh(flavor ~ (1|Consumer) + Sacarose, burn = 0, jump = 1,
        ef.iter = 10, algor=list(algorithm="NC", link="t"),data=sensory) 
summary(dex2)

Bayes.factor(dex1,dex2)

Bayesthresh documentation built on May 30, 2017, 6:24 a.m.