Trying to get the Bayes Factor for a correlation between two variables in my data, I tried three different functions. All implement the Jeffreys–Zellner–Siow (JZS) prior, but I get quite different results with the three approaches. Two questions:
Is this suspicious, or is it reasonable that they produce different values, as the implementations are slightly different?
Is there a consensus on the best measure to use?
a=rnorm(100,1,2) b=rnorm(100,.8,1.5) myData <- data.frame(a=a, b=b)
cor.resu.a_b <- cor.test(myData$a, myData$b, method=c("pearson")) cor.resu.a_b$estimate n = 100 r = cor.resu.a_b$estimate jzs_corbf(r,n)  0.08206358
I also tried the convenience function from the
require(BayesFactor) regressionBF(b ~ a, data = myData, progress=FALSE) Bayes factor analysis --------------  a : 0.2181081 ±0% Against denominator: Intercept only --- Bayes factor type: BFlinearModel, JZS
bf10JeffreysIntegrate(n=100, r=r) cor 0.1297927
While in this case the differences are only numerical, in my real data I get quite big differences that make it more difficult to decide on an interpretation.