Skip to content

Instantly share code, notes, and snippets.

@crsh
Last active June 13, 2017 15:12
Show Gist options
  • Save crsh/ff4a59bd22403d83c5e94155d96f9f1b to your computer and use it in GitHub Desktop.
Save crsh/ff4a59bd22403d83c5e94155d96f9f1b to your computer and use it in GitHub Desktop.
Function to minimize estimate error of Bayes factors in BayesFactorBF objects
minimizeError <- function(x, max_error, multicore = TRUE) {
while(any(x@bayesFactor$error > max_error)) {
message("Current error: ", x@bayesFactor$error)
x <- recompute(x, multicore = multicore)
}
x
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment