set.seed(57)
grp1=rnorm(50,0,1.5)
grp2=rnorm(50,0.3,3.2)
p = as.vector(BayesFactor::ttestBF(x=grp1,y=grp2,
posterior = TRUE, iterations = 3000,
rscale = "medium")[,4])
# flat reference function, nu = 0
res = fbet(p, interval = c(-0.1,0.1), nu=0, FUN=NULL, par=NULL)
summary(res)
plot(res)
# flat reference function, nu = 1
res = fbet(p, interval = c(-0.1,0.1), nu=1, FUN=NULL, par=NULL)
summary(res)
plot(res)
# medium Cauchy C(0,1) reference function, nu = 1
res_med = fbet(posteriorDensityDraws = p, interval = c(-0.1,0.1), nu = 1,
FUN = dcauchy, par = list(location = 0, scale=sqrt(2)))
summary(res_med)
plot(res_med)
# posterior as function argument
fbet(posterior=dbeta, par_posterior = list(shape1 = 3, shape2 = 4),
interval = c(0.2,1), nu = 1, FUN=dbeta, par = list(shape1 = 1, shape2 = 1))
Run the code above in your browser using DataLab