View source: R/core_bayes_estimate.R
| get_default_prior_settings | R Documentation |
This function creates prior distribution functions for each model parameter in a drift diffusion model (DDM), depending on the specified hierarchical level. It returns both log-density functions and, where applicable, random-sample generators based on the user-defined prior settings.
get_default_prior_settings(
drift_dm_obj,
level,
means = NULL,
sds = NULL,
lower = NULL,
upper = NULL,
shapes = NULL,
rates = NULL
)
drift_dm_obj |
a drift_dm model object. |
level |
a character string, specifying the modeling level. Must be one
of: |
means |
a named numeric vector or list, specifying the prior means for
each parameter. Missing values will be filled up from the first matching
parameter in |
sds |
a named numeric vector or list of standard deviations. Missing or
|
lower, upper |
optional numeric vectors or lists specifying the lower
and upper truncation bounds for each prior distribution. Defaults to |
shapes, rates |
optional numeric vectors or lists specifying the shape and
rate parameter for group-level standard deviations (used at the hyper-level).
Defaults to |
Each prior is parameter-specific and wrapped using purrr::partial() so
that downstream sampling or density evaluation can be performed easily.
At the hyper-level, the functions d_default_prior_hyper() and
r_default_prior_hyper() are used. At the lower-level, the
functions dtnorm() and rtnorm() are used.
The input arguments means, sds, lowers, uppers, shapes, and rates
are handled by the function get_parameters_smart().
A named list with two elements:
log_dens_priors: A named list of functions. Each function returns the
log-density for a parameter value, based on the chosen prior settings.
r_priors: A named list of functions for sampling from the specified
prior distributions.
get_parameters_smart(), dtnorm(),
rtnorm(), d_default_prior_hyper(),
r_default_prior_hyper()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.