describe_prior: Describe Priors

View source: R/describe_prior.R

describe_priorR Documentation

Describe Priors

Description

Returns a summary of the priors used in the model.

Usage

describe_prior(model, ...)

## S3 method for class 'brmsfit'
describe_prior(model, parameters = NULL, ...)

Arguments

model

A Bayesian model.

...

Currently not used.

parameters

Regular expression pattern that describes the parameters that should be returned. Meta-parameters (like lp__ or prior_) are filtered by default, so only parameters that typically appear in the summary() are returned. Use parameters to select specific parameters for the output.

Examples


library(bayestestR)

# rstanarm models
# -----------------------------------------------
if (require("rstanarm")) {
  model <- rstanarm::stan_glm(mpg ~ wt + cyl, data = mtcars)
  describe_prior(model)
}

# brms models
# -----------------------------------------------
if (require("brms")) {
  model <- brms::brm(mpg ~ wt + cyl, data = mtcars)
  describe_prior(model)
}

# BayesFactor objects
# -----------------------------------------------
if (require("BayesFactor")) {
  bf <- ttestBF(x = rnorm(100, 1, 1))
  describe_prior(bf)
}


DominiqueMakowski/bayestestR documentation built on March 29, 2025, 4:17 p.m.