Validate priors supplied by the user. Return a complete set of priors for the given model, including default priors.
validate_prior(
prior,
formula,
data,
family = gaussian(),
sample_prior = "no",
data2 = NULL,
knots = NULL,
...
)
An object of class formula
,
brmsformula
, or mvbrmsformula
(or one that can
be coerced to that classes): A symbolic description of the model to be
fitted. The details of model specification are explained in
brmsformula
.
An object of class data.frame
(or one that can be coerced
to that class) containing data of all variables used in the model.
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 link
argument allowing to specify the link function to be applied
on the response variable. If not specified, default links are used. For
details of supported families see brmsfamily
. By default, a
linear gaussian
model is applied. In multivariate models,
family
might also be a list of families.
Indicate if samples from priors should be drawn
additionally to the posterior samples. Options are "no"
(the
default), "yes"
, and "only"
. Among others, these samples can
be used to calculate Bayes factors for point hypotheses via
hypothesis
. Please note that improper priors are not sampled,
including the default improper priors used by brm
. See
set_prior
on how to set (proper) priors. Please also note
that prior samples for the overall intercept are not obtained by default
for technical reasons. See brmsformula
how to obtain prior
samples for the intercept. If sample_prior
is set to "only"
,
samples are drawn solely from the priors ignoring the likelihood, which
allows among others to generate samples from the prior predictive
distribution. In this case, all parameters must have proper priors.
A named list
of objects containing data, which
cannot be passed via argument data
. Required for some objects
used in autocorrelation structures to specify dependency structures
as well as for within-group covariance matrices.
Optional list containing user specified knot values to be used
for basis construction of smoothing terms. See
gamm
for more details.
Other arguments for internal usage only.
An object of class brmsprior
.
# NOT RUN {
prior1 <- prior(normal(0,10), class = b) +
prior(cauchy(0,2), class = sd)
validate_prior(prior1, count ~ zAge + zBase * Trt + (1|patient),
data = epilepsy, family = poisson())
# }
Run the code above in your browser using DataLab