https://github.com/cran/bayestestR
Revision 68a979e69aa2a1e57017730e1397470d5614d216 authored by Dominique Makowski on 02 September 2021, 23:10:30 UTC, committed by cran-robot on 02 September 2021, 23:10:30 UTC
1 parent 85d0a04
Raw File
Tip revision: 68a979e69aa2a1e57017730e1397470d5614d216 authored by Dominique Makowski on 02 September 2021, 23:10:30 UTC
version 0.11.0
Tip revision: 68a979e
model_to_priors.Rd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/model_to_priors.R
\name{model_to_priors}
\alias{model_to_priors}
\title{Convert model's posteriors to priors (EXPERIMENTAL)}
\usage{
model_to_priors(model, scale_multiply = 3, ...)
}
\arguments{
\item{model}{A Bayesian model.}

\item{scale_multiply}{The SD of the posterior will be multiplied by this amount before being set as a prior to avoid overly narrow priors.}

\item{...}{Other arguments for \code{insight::get_prior()} or \code{\link{describe_posterior}}.}
}
\description{
Convert model's posteriors to (normal) priors.
}
\examples{
\dontrun{
# brms models
# -----------------------------------------------
if (require("brms")) {
  formula <- brms::brmsformula(mpg ~ wt + cyl, center = FALSE)

  model <- brms::brm(formula, data = mtcars, refresh = 0)
  priors <- model_to_priors(model)
  priors <- brms::validate_prior(priors, formula, data = mtcars)
  priors

  model2 <- brms::brm(formula, data = mtcars, prior = priors, refresh = 0)
}
}
}
back to top