| default_prior.default | R Documentation | 
Get information on all parameters (and parameter classes) for which priors may be specified including default priors.
## Default S3 method:
default_prior(
  object,
  data,
  family = gaussian(),
  autocor = NULL,
  data2 = NULL,
  knots = NULL,
  drop_unused_levels = TRUE,
  sparse = NULL,
  ...
)
| object | 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
 | 
| drop_unused_levels | Should unused factors levels in the data be
dropped? Defaults to  | 
| sparse | (Deprecated) Logical; indicates whether the population-level
design matrices should be treated as sparse (defaults to  | 
| ... | Other arguments for internal usage only. | 
A brmsprior object. That is, a data.frame with specific
columns including 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.
default_prior, set_prior
# get all parameters and parameters classes to define priors on
(prior <- default_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
stancode(count ~ zAge + zBase * Trt + (1|patient) + (1|obs),
         data = epilepsy, family = poisson(),
         prior = prior)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.