get_prior_standard {EMC2} | R Documentation |
Prior specification or prior sampling for standard estimation.
Description
To get the default prior for a created design: get_prior_standard(design = design, sample = FALSE)
Usage
get_prior_standard(
prior = NULL,
n_pars = NULL,
sample = TRUE,
N = 1e+05,
selection = "mu",
design = NULL
)
Arguments
prior |
A named list that can contain the prior mean ( |
n_pars |
Often inferred from the design, but if |
sample |
Boolean, defaults to |
N |
How many samples to draw from the prior, the default is 1e5 |
selection |
Character. If |
design |
The design obtained from |
Details
For details see Huang, A., & Wand, M. P. (2013). Simple marginally noninformative prior distributions for covariance matrices. Bayesian Analysis, 8, 439-452. https://doi.org/10.1214/13-BA815.
Note that if sample = FALSE
, prior$theta_mu_invar (the inverse of the prior covariance matrix on the group-level mean)
is also returned, which is only used for computational efficiency
Value
A list with a single entry of type of samples from the prior (if sample = TRUE) or else a prior object
Examples
# First define a design for the model
design_DDMaE <- design(data = forstmann,model=DDM,
formula =list(v~0+S,a~E, t0~1, s~1, Z~1, sv~1, SZ~1),
constants=c(s=log(1)))
# Now get the default prior
prior <- get_prior_standard(design = design_DDMaE, sample = FALSE)
# We can change values in the default prior or use `prior`
# Then we can get samples from this prior e.g.
samples <- get_prior_standard(prior = prior, design = design_DDMaE,
sample = TRUE, selection = "mu")