View source: R/simulate_priors.R
simulate_prior | R Documentation |
Transforms priors information to actual distributions.
simulate_prior(model, n = 1000, ...)
## S3 method for class 'brmsfit'
simulate_prior(
model,
n = 1000,
effects = "fixed",
component = "conditional",
parameters = NULL,
verbose = TRUE,
...
)
model |
A |
n |
Size of the simulated prior distributions. |
... |
Currently not used. |
effects |
Should results for fixed effects ( |
component |
Which type of parameters to return, such as parameters for the conditional model, the zero-inflated part of the model, the dispersion term, etc. See details in section Model Components. May be abbreviated. Note that the conditional component also refers to the count or mean component - names may differ, depending on the modeling package. There are three convenient shortcuts (not applicable to all model classes):
|
parameters |
Regular expression pattern that describes the parameters
that should be returned. Meta-parameters (like |
verbose |
Toggle off warnings. |
unupdate()
for directly sampling from the prior
distribution (useful for complex priors and designs).
library(bayestestR)
if (require("rstanarm")) {
model <- suppressWarnings(
stan_glm(mpg ~ wt + am, data = mtcars, chains = 1, refresh = 0)
)
simulate_prior(model)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.