Overview on Priors for brms Models
Get information on all parameters (and parameter classes) for which priors may be specified including default priors.
get_prior( formula, data, family = gaussian(), autocor = NULL, data2 = NULL, knots = NULL, sparse = NULL, ... )
formula |
An object of class |
data |
An object of class |
family |
A description of the response distribution and link function to
be used in the model. This can be a family function, a call to a family
function or a character string naming the family. Every family function has
a |
autocor |
(Deprecated) An optional |
data2 |
A named |
knots |
Optional list containing user specified knot values to be used
for basis construction of smoothing terms. See
|
sparse |
(Deprecated) Logical; indicates whether the population-level
design matrices should be treated as sparse (defaults to |
... |
Other arguments for internal usage only. |
A data.frame with columns prior
, class
, coef
,
and group
and several rows, each providing information on a
parameter (or parameter class) on which priors can be specified. The prior
column is empty except for internal default priors.
## get all parameters and parameters classes to define priors on (prior <- get_prior(count ~ zAge + zBase * Trt + (1|patient) + (1|obs), data = epilepsy, family = poisson())) ## define a prior on all population-level effects a once prior$prior[1] <- "normal(0,10)" ## define a specific prior on the population-level effect of Trt prior$prior[5] <- "student_t(10, 0, 5)" ## verify that the priors indeed found their way into Stan's model code make_stancode(count ~ zAge + zBase * Trt + (1|patient) + (1|obs), data = epilepsy, family = poisson(), prior = prior)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.