Skip to contents

Resolve selectors against the same Gaussian or binomial design builders used by drmTMB(). Models require complete data and unit weights. Gaussian identity models can include one independent mean random intercept; other random effects and random-effect SD formulas are not supported with priors. A Gamma SD prior identifies the exact group and intercept and reports shape and rate on the natural SD scale. The native and Julia engines support this prior for the Gaussian mean random-intercept model described above. The Julia bridge does not yet accept factor predictors in this mixed model. No automatic centring or scaling is performed.

Usage

drm_resolve_priors(formula, family = stats::gaussian(), data, priors)

Arguments

formula

A drm_formula() or bf() specification.

family

Gaussian identity or binomial logit family.

data

A data frame with complete model variables.

priors

A collection created by drm_priors().

Value

A data frame identifying the resolved targets. Fixed-effect rows report the distributional parameter, coefficient, matrix column, prior mean, SD, precision and selection reason. An SD-prior row reports the distributional parameter, group, random-effect block, coefficient, SD scale, shape and rate. Mixed results combine these fields, with unavailable fields recorded as NA.

Examples

d <- data.frame(y = c(1, 2, 1, 3), x = c(0, 1, 2, 3))
p <- drm_priors(drm_prior_normal("mu", "x", sd = 2))
drm_resolve_priors(bf(mu = y ~ x, sigma = ~ 1), gaussian(), d, p)
#>   dpar coefficient matrix_column mean sd precision       reason   kind
#> 1   mu           x             2    0  2      0.25 exact column normal
d$group <- factor(c(1, 1, 2, 2))
drm_resolve_priors(bf(mu = y ~ x + (1 | group), sigma = ~ 1), gaussian(), d, p)
#>   dpar coefficient matrix_column mean sd precision       reason   kind
#> 1   mu           x             2    0  2      0.25 exact column normal