get_prior_single {EMC2} | R Documentation |
Prior specification or prior sampling for single subject estimation
Description
With this type of estimation, one or multiple subjects are estimated independently, without any hierarchical constraint.
Usage
get_prior_single(
prior = NULL,
n_pars = NULL,
sample = TRUE,
N = 1e+05,
selection = "alpha",
design = NULL,
map = FALSE
)
Arguments
prior |
A named list containing 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 |
map |
Boolean, defaults to |
Details
To specify a (multivariate normal) prior, prior$theta_mu_mean
and prior$theta_mu_var
an entry
is needed for each parameter.
Value
A list with a single entry named "alpha"
and 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_single(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_single(prior = prior, design = design_DDMaE,
sample = TRUE, selection = "alpha")