Skip to content

Add vignette to explore MAP priors from RBest #137

Closed

Description

@wlandau

As @andrew-bean pointed out in our meeting this week, RBest takes care of the stanvars injection required to use MAP priors, and this may even extend to the multivariate case if we use mixmvnorm instead of mixnorm. This could be a really useful vignette for the package. Sketch from Andrew:

if(!weak){
  prior_label <- prior_label |>
    brms.mmrm::brm_prior_label(code = "mixnorm(map_w, map_m, map_s)",group = "pbo", time = "Month_36")
  stanvars <- mixstanvar(map = control_prior)
} else if(weak){
  prior_label <- prior_label |>
    brms.mmrm::brm_prior_label(code = "student_t(4,  0, 5)", group = "pbo", time = "Month_36")
  stanvars <- NULL
}

prior <- brms.mmrm::brm_prior_archetype(label = prior_label, archetype = archetype)
formula <- brms.mmrm::brm_formula(archetype)

stanvars <- RBesT::mixstanvar(map = control_prior)

options("brms.backend" = "cmdstanr")
model <- brms.mmrm::brm_model(
  data = archetype,
  formula = formula,
  prior = prior,
  stanvars = stanvars,
  refresh = 0,
  cores = 1,
  iter = iter,
  chains = chains
)

Activity

  1. added a commit that references this issue on Mar 20, 2026
    878dcf1
  2. wlandau commented on Mar 20, 2026

    @wlandau
    MemberAuthor

    Thanks again for the example code, @andrew-bean. I drafted a new vignette at #138.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions