Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

simulate_prior

Returns Priors of a Model as Empirical Distributions


Description

Transforms priors information to actual distributions.

Usage

simulate_prior(model, n = 1000, ...)

Arguments

model

A stanreg, stanfit, or brmsfit object.

n

Size of the simulated prior distributions.

...

Currently not used.

See Also

unupdate for directly sampling from the prior distribution (useful for complex priors and designs).

Examples

## Not run: 
library(bayestestR)
if (require("rstanarm")) {
  model <- stan_glm(mpg ~ wt + am, data = mtcars, chains = 1, refresh = 0)
  simulate_prior(model)
}

## End(Not run)

bayestestR

Understand and Describe Bayesian Models and Posterior Distributions

v0.10.0
GPL-3
Authors
Dominique Makowski [aut, cre] (<https://orcid.org/0000-0001-5375-9967>, @Dom_Makowski), Daniel Lüdecke [aut] (<https://orcid.org/0000-0002-8895-3206>, @strengejacke), Mattan S. Ben-Shachar [aut] (<https://orcid.org/0000-0002-4287-4801>, @mattansb), Indrajeet Patil [aut] (<https://orcid.org/0000-0003-1995-6531>, @patilindrajeets), Michael D. Wilson [aut] (<https://orcid.org/0000-0003-4143-7308>), Paul-Christian Bürkner [rev], Tristan Mahr [rev] (<https://orcid.org/0000-0002-8890-5116>), Henrik Singmann [ctb] (<https://orcid.org/0000-0002-4842-3657>), Quentin F. Gronau [ctb] (<https://orcid.org/0000-0001-5510-6943>), Sam Crawley [ctb] (<https://orcid.org/0000-0002-7847-0411>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.