Extract prior draws of specified parameters
1 2 3 4 5 6
A character vector providing the variables to extract. By default, all variables are extracted.
Deprecated alias of
Arguments passed to individual methods (if applicable).
To make use of this function, the model must contain draws of
prior distributions. This can be ensured by setting
TRUE in function
brm. Priors of certain parameters cannot be saved
for technical reasons. For instance, this is the case for the
population-level intercept, which is only computed after fitting the model
by default. If you want to treat the intercept as part of all the other
regression coefficients, so that sampling from its prior becomes possible,
... ~ 0 + Intercept + ... in the formulas.
data.frame containing the prior draws.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
## Not run: fit <- brm(rating ~ treat + period + carry + (1|subject), data = inhaler, family = "cumulative", prior = set_prior("normal(0,2)", class = "b"), sample_prior = TRUE) # extract all prior draws draws1 <- prior_draws(fit) head(draws1) # extract prior draws for the coefficient of 'treat' draws2 <- prior_draws(fit, "b_treat") head(draws2) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.