View source: R/model_to_priors.R
model_to_priors | R Documentation |
Convert model's posteriors to (normal) priors.
model_to_priors(model, scale_multiply = 3, ...)
model |
A Bayesian model. |
scale_multiply |
The SD of the posterior will be multiplied by this amount before being set as a prior to avoid overly narrow priors. |
... |
Other arguments for |
# 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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.