simulate_prior {bayestestR} | R Documentation |
Returns Priors of a Model as Empirical Distributions
Description
Transforms priors information to actual distributions.
Usage
simulate_prior(model, n = 1000, ...)
## S3 method for class 'brmsfit'
simulate_prior(
model,
n = 1000,
effects = "fixed",
component = "conditional",
parameters = NULL,
verbose = TRUE,
...
)
Arguments
model |
A |
n |
Size of the simulated prior distributions. |
... |
Currently not used. |
effects |
Should variables for fixed effects ( For models of from packages brms or rstanarm there are additional options:
|
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. |
See Also
unupdate()
for directly sampling from the prior
distribution (useful for complex priors and designs).
Examples
library(bayestestR)
if (require("rstanarm")) {
model <- suppressWarnings(
stan_glm(mpg ~ wt + am, data = mtcars, chains = 1, refresh = 0)
)
simulate_prior(model)
}