R/plot.estimate_density.R
plot.see_estimate_density.RdThe plot() method for the bayestestR::estimate_density() function.
# S3 method for class 'see_estimate_density'
plot(
x,
stack = TRUE,
show_intercept = FALSE,
n_columns = 1,
priors = FALSE,
alpha_priors = 0.4,
alpha_posteriors = 0.7,
linewidth = 0.9,
size_point = 2,
centrality = "median",
ci = 0.95,
...
)An object.
Logical. If TRUE, densities are plotted as stacked lines.
Else, densities are plotted for each parameter among each other.
Logical, if TRUE, the intercept-parameter is included
in the plot. By default, it is hidden because in many cases the
intercept-parameter has a posterior distribution on a very different
location, so density curves of posterior distributions for other parameters
are hardly visible.
For models with multiple components (like fixed and random,
count and zero-inflated), defines the number of columns for the
panel-layout. If NULL, a single, integrated plot is shown.
Logical. If TRUE, prior distributions are simulated
(using bayestestR::simulate_prior()) and added
to the plot.
Numeric value specifying alpha for the prior distributions.
Numeric value specifying alpha for the posterior distributions.
Numeric value specifying size of line geoms.
Numeric specifying size of point-geoms.
Character specifying the point-estimate (centrality index)
to compute. Can be "median", "mean" or "MAP".
Numeric value of probability of the CI (between 0 and 1) to be
estimated. Default to 0.95.
Arguments passed to or from other methods.
A ggplot2-object.
if (FALSE) { # identical(Sys.getenv("NOT_CRAN"), "true") && require("rstanarm")
library(rstanarm)
library(bayestestR)
set.seed(123)
m <<- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0))
result <- estimate_density(m)
plot(result)
}