Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Feb 4, 2024
1 parent 6f67e7b commit ffd511f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: bayestestR
Title: Understand and Describe Bayesian Models and Posterior Distributions
Version: 0.13.1.8
Version: 0.13.1.9
Authors@R:
c(person(given = "Dominique",
family = "Makowski",
Expand Down
3 changes: 1 addition & 2 deletions R/bayesfactor_parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,8 @@ bayesfactor_parameters.stanreg <- function(posterior,
component <- match.arg(component)

samps <- .clean_priors_and_posteriors(posterior, prior,
verbose = verbose,
effects = effects, component = component,
parameters = parameters
parameters = parameters, verbose = verbose
)

# Get BFs
Expand Down
7 changes: 3 additions & 4 deletions R/si.R
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,8 @@ si.stanreg <- function(posterior, prior = NULL,
component <- match.arg(component)

samps <- .clean_priors_and_posteriors(posterior, prior,
verbose = verbose,
effects = effects, component = component,
parameters = parameters
parameters = parameters, verbose = verbose
)

# Get SIs
Expand Down Expand Up @@ -318,7 +317,7 @@ si.rvar <- si.draws
x_supported <- stats::na.omit(x_axis[crit])
if (length(x_supported) < 2) {
return(c(NA, NA))
} else {
range(x_supported)
}

range(x_supported)
}
12 changes: 7 additions & 5 deletions R/utils_bayesfactor.R
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# clean priors and posteriors ---------------------------------------------

#' @keywords internal
.clean_priors_and_posteriors <- function(posterior, prior,
verbose = TRUE, ...) {
.clean_priors_and_posteriors <- function(posterior, prior, ...) {
UseMethod(".clean_priors_and_posteriors")
}

#' @keywords internal
.clean_priors_and_posteriors.stanreg <- function(posterior, prior,
effects, component,
parameters = NULL,
verbose = TRUE,
effects, component, ...) {
...) {
# Get Priors
if (is.null(prior)) {
prior <- posterior
Expand Down Expand Up @@ -65,7 +66,8 @@
#' @keywords internal
.clean_priors_and_posteriors.emmGrid <- function(posterior,
prior,
verbose = TRUE) {
verbose = TRUE,
...) {
insight::check_if_installed("emmeans")

if (is.null(prior)) {
Expand Down Expand Up @@ -126,7 +128,7 @@
}

.clean_priors_and_posteriors.emm_list <- function(posterior, prior,
verbose = TRUE) {
verbose = TRUE, ...) {
if (is.null(prior)) {
prior <- posterior
insight::format_warning("Prior not specified! Please provide the original model to get meaningful results.")
Expand Down
1 change: 0 additions & 1 deletion man/bayestestR-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ffd511f

Please sign in to comment.