% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/check_priors.R
\name{check_priors}
\alias{check_priors}
\alias{check_priors.stanreg}
\title{Prior predictive checks}
\usage{
check_priors(model = NULL, ...)

\method{check_priors}{stanreg}(model = NULL, predictors = NULL, ...)
}
\arguments{
\item{model}{A Bayesian model of class \code{stanreg} or \code{brmsfit}. Note that
this model should include draws from the prior predictive distribution. This
can be achieved, e.g., by using \code{\link[bayestestR:unupdate]{bayestestR::unupdate()}} on the fitted
model, or setting \code{prior_PD = TRUE} (when using \strong{rstanarm}) or
\code{sample_prior = "only"} (when using \strong{brms}).}

\item{...}{Currently not used.}

\item{predictors}{Character vector with names of one or more model predictors
for which prior predictive checks should be visualized.}
}
\value{
A \code{ggplot2} object visualizing the prior predictive distribution,
overlaid with boxplots indicating where the probability mass of the prior
distribution is located.
}
\description{
Simulates from the prior marginal distribution of the data to assess the
consistency of the chosen priors with domain knowledge (\emph{Gabry et al. 2019},
\emph{Lüdecke et al. 2026}) and creates a visualization from the prior predictive
checks.
}
\details{
Prior predictive checks allow researchers to verify whether the mathematical
definitions of their priors accurately reflect the assumed underlying reality.
Data are sampled from the model using only the prior distributions (the prior
predictive distribution), before any observed data are considered. By visualizing
the prior predictive distribution, researchers can assess whether their chosen
priors generate plausible data. This provides a crucial sanity check on the
model's assumptions and their consistency with domain knowledge.
}
\examples{
\dontrun{
# model with correctly defined priors. outcome is binary, prior
# predictive checks indicate the predicted probability mass based
# on the prior distributions - the resulting pattern aligns with
# our real-world assumptions
model <- insight::download_model("stan_prior_checks_1")
check_priors(model, "mmse")

# model with default (weakly informative) priors, which is poorly
# calibrated. It pushes probability mass almost exclusively to the
# extremes of 0 and 1, leaving the plausible middle range largely
# unsupported
model <- insight::download_model("stan_prior_checks_2")
check_priors(model, "mmse")
}
}
\references{
Gabry, J., Simpson, D., Vehtari, A., Betancourt, M., & Gelman, A. (2019).
Visualization in Bayesian Workflow. Journal of the Royal Statistical Society
Series A: Statistics in Society, 182(2), 389–402. \doi{10.1111/rssa.12378}

Lüdecke D, Makowski AC, Klein J, Ben-Shachar MS and Makowski D (2026)
Choosing informative priors in Bayesian regression models: a simulation study
and tutorial using Stan and R. Front. Psychol. 17:1856582.
\doi{10.3389/fpsyg.2026.1856582}
}
\seealso{
See documentation of
\href{https://easystats.github.io/see/reference/plot.see_check_priors.html}{\code{?see::plot.see_check_priors}}
for available arguments to change the plot appearance.
}
