diff --git a/R/describe_posterior.R b/R/describe_posterior.R index 42e9e9a52..d22114c5e 100644 --- a/R/describe_posterior.R +++ b/R/describe_posterior.R @@ -54,9 +54,14 @@ #' #' if (require("logspline")) { #' x <- rnorm(1000) -#' describe_posterior(x) -#' describe_posterior(x, centrality = "all", dispersion = TRUE, test = "all") -#' describe_posterior(x, ci = c(0.80, 0.90)) +#' describe_posterior(x, verbose = FALSE) +#' describe_posterior(x, +#' centrality = "all", +#' dispersion = TRUE, +#' test = "all", +#' verbose = FALSE +#' ) +#' describe_posterior(x, ci = c(0.80, 0.90), verbose = FALSE) #' #' df <- data.frame(replicate(4, rnorm(100))) #' describe_posterior(df, verbose = FALSE) @@ -763,7 +768,7 @@ describe_posterior.emmGrid <- function(posteriors, BF = 1, ...) { if (any(c("all", "bf", "bayesfactor", "bayes_factor") %in% tolower(test)) || - "si" %in% tolower(ci_method)) { + "si" %in% tolower(ci_method)) { samps <- .clean_priors_and_posteriors(posteriors, bf_prior) bf_prior <- samps$prior posteriors <- samps$posterior @@ -832,7 +837,7 @@ describe_posterior.stanreg <- function(posteriors, BF = 1, ...) { if ((any(c("all", "bf", "bayesfactor", "bayes_factor") %in% tolower(test)) || - "si" %in% tolower(ci_method)) && is.null(bf_prior)) { + "si" %in% tolower(ci_method)) && is.null(bf_prior)) { bf_prior <- suppressMessages(unupdate(posteriors)) } @@ -1030,7 +1035,7 @@ describe_posterior.brmsfit <- function(posteriors, component <- match.arg(component) if ((any(c("all", "bf", "bayesfactor", "bayes_factor") %in% tolower(test)) || - "si" %in% tolower(ci_method)) && is.null(bf_prior)) { + "si" %in% tolower(ci_method)) && is.null(bf_prior)) { bf_prior <- suppressMessages(unupdate(posteriors)) } diff --git a/README.Rmd b/README.Rmd index 66823f18b..819de2ca6 100644 --- a/README.Rmd +++ b/README.Rmd @@ -342,7 +342,7 @@ prior <- as.data.frame(density(distribution_normal(10000, mean = 0, sd = 1))) ggplot(posterior, aes(x = x, y = y)) + geom_ribbon(aes(ymin = 0, ymax = y), fill = "#FFC107") + - geom_line(data = prior, size = 1, linetype = "dotted") + + geom_line(data = prior, linewidth = 1, linetype = "dotted") + geom_segment(x = 0, xend = 0, y = 0, yend = max(prior$y), color = "#2196F3", size = 1) + geom_point(x = 0, y = max(prior$y), color = "#2196F3", size = 5) + geom_segment(x = 0, xend = 0, y = 0, yend = density_at(posterior$x, 0, bw = "nrd0"), color = "#E91E63", size = 1) + diff --git a/README.md b/README.md index ab13edfec..083229aba 100644 --- a/README.md +++ b/README.md @@ -161,9 +161,9 @@ describe_posterior( ) ## Summary of Posterior Distribution ## -## Parameter | Median | 95% CI | pd | ps -## -------------------------------------------------- -## Posterior | -0.01 | [-1.96, 1.96] | 50.27% | 0.46 +## Parameter | Median | 95% CI | pd | ps +## ---------------------------------------------------- +## Posterior | 1.15e-03 | [-2.01, 1.92] | 50.07% | 0.46 ``` `describe_posterior()` works for many objects, including more complex diff --git a/man/describe_posterior.Rd b/man/describe_posterior.Rd index 56f6fc0e4..e190a61c7 100644 --- a/man/describe_posterior.Rd +++ b/man/describe_posterior.Rd @@ -144,9 +144,14 @@ library(bayestestR) if (require("logspline")) { x <- rnorm(1000) - describe_posterior(x) - describe_posterior(x, centrality = "all", dispersion = TRUE, test = "all") - describe_posterior(x, ci = c(0.80, 0.90)) + describe_posterior(x, verbose = FALSE) + describe_posterior(x, + centrality = "all", + dispersion = TRUE, + test = "all", + verbose = FALSE + ) + describe_posterior(x, ci = c(0.80, 0.90), verbose = FALSE) df <- data.frame(replicate(4, rnorm(100))) describe_posterior(df, verbose = FALSE)