Overview on Priors for
Get information on all parameters (and parameter classes) for which priors may be specified including default priors.
get_prior(formula, data = NULL, family = gaussian(), autocor = NULL, partial = NULL, threshold = c("flexible", "equidistant"), internal = FALSE)
- An object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted. The details of model specification are given under 'Details'.
- An optional data frame, list or environment (or object coercible by
as.data.frameto a data frame) containing the variables in the model. If not found in data, the variables are taken from
environment(formula), typically t
- A description of the error 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.
Currently, the following families are supported:
- An optional
cor_brmsobject describing the correlation structure within the response variable (i.e. the 'autocorrelation'). See the documentation of
- A one sided formula of the form
~expressionallowing to specify predictors with category specific effects in non-cumulative ordinal models (i.e. in families
- A character string indicating the type of thresholds
(i.e. intercepts) used in an ordinal model.
"flexible"provides the standard unstructured thresholds and
"equidistant"restricts the distance between consecutive thresh
- A flag indicating if the names of additional internal parameters should be displayed. Setting priors on these parameters is not recommended
- A data.frame with columns
groupand several rows, each providing information on a paramter (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 ~ log_Age_c + log_Base4_c * Trt_c + (1|patient) + (1|visit), data = epilepsy, family = poisson())) ## define a prior on all fixed effects a once prior$prior <- "normal(0,10)" ## define a specific prior on the fixed effect of Trt_c prior$prior <- "student_t(10, 0, 5)" ## verify that the priors indeed found their way into Stan's model code make_stancode(count ~ log_Age_c + log_Base4_c * Trt_c + (1|patient) + (1|visit), data = epilepsy, family = poisson(), prior = prior)
Looks like there are no examples yet.