Skip to content

New vignette on MAP priors#138

Merged
wlandau merged 18 commits into
mainfrom
137
Apr 15, 2026
Merged

New vignette on MAP priors#138
wlandau merged 18 commits into
mainfrom
137

Conversation

@wlandau

@wlandau wlandau commented Mar 20, 2026

Copy link
Copy Markdown
Member

This PR adds a new vignette on MAP priors. vigntettes/map.Rmd.source is the true source, and vignettes/map.Rmd is entirely pre-rendered for efficiency.

RBesT makes univariate MAP priors super easy, and thanks to the smooth integration with brms, they're easy to use with brms.mmrm. @andrew-bean and @weberse2, thanks for the example code.

At the end, I added a section on robust multivariate mixture priors. I'm wondering if there's an easier way to do this using gMAP() + automixfit() + robustify() as in the univariate case.

@wlandau
wlandau requested review from andrew-bean and chstock March 20, 2026 19:03
@wlandau wlandau self-assigned this Mar 20, 2026
Comment thread vignettes/map.Rmd Outdated
Comment thread vignettes/map.Rmd
Comment thread vignettes/map.Rmd
Comment thread vignettes/map.Rmd Outdated
Comment thread vignettes/map.Rmd
Comment thread vignettes/map.Rmd Outdated
Comment thread vignettes/map.Rmd Outdated
Comment thread vignettes/map.Rmd Outdated
@chstock

chstock commented Mar 24, 2026

Copy link
Copy Markdown
Collaborator

Thank you very much for this vignette, @wlandau, and others for the inspiration and the basis, especially in RBesT. It is excellent that (multivariate) mixture priors can now be used here, and the technical implementation even appears quite straightforward.

@weberse2

Copy link
Copy Markdown
Collaborator

Really nice to see this going into brms.mmrm... the RBesT::mixstanvar magic is a bit under the radar of people, but it is quite powerful from my view - so it is great to see this landing here. Just two points: Can you update the tau.prior=1 to follow the recommendations from RBesT vignetts (https://opensource.nibr.com/RBesT/articles/introduction.html). Specifically, one needs to make the scale proportional to sigma (taken usually to be the pooled sampling sd as estimated from the data). The conservative choice is sigma/2, but whenever data is somewhat homogeneous to a level common when selecting data sets for meta-analysis sigma/4 is better, I think.

For the multivariate case you could point out to use brms directly with multiple random effects, for example as demonstrated here: https://opensource.nibr.com/bamdd/src/02ad_meta_analysis_covariate.html#sec-impl-complete-only ... not sure if you want to link that section directly... but a link to https://opensource.nibr.com/bamdd/ and hist data with a covariate you could consider.

The robust component for the multi variate normal should also be a unit information prior... so using sigma here again. The choice of the robust component is a topic (if you make the sigma too large in comparison of the sampling sd, then the robustification is never kicking in).

Last point: The mixstanvar has been written so that the brms function prior can be used; I see that you make people specify the actual code for the prior... fine... I did like the priors functions more, but both works.

Great work!

@weberse2

Copy link
Copy Markdown
Collaborator

Two more small things:

  • please do not use sigma = mean(data_historical_visit4$sd), but rather average variances instead
  • also ensure that the color code is consistent for the different fits in the two plots (the diffuse fit changes color)

@wlandau

wlandau commented Apr 7, 2026

Copy link
Copy Markdown
Member Author

I really appreciate your comments, @weberse2. Sorry for the long delay in responding. I am starting to look at your comments now.

@wlandau

wlandau commented Apr 7, 2026

Copy link
Copy Markdown
Member Author

please do not use sigma = mean(data_historical_visit4$sd), but rather average variances instead

Fixed in ed2ab34. I used the pooled standard deviation.

@wlandau

wlandau commented Apr 7, 2026

Copy link
Copy Markdown
Member Author

also ensure that the color code is consistent for the different fits in the two plots (the diffuse fit changes color)

Fixed in 855e26a

@wlandau

wlandau commented Apr 7, 2026

Copy link
Copy Markdown
Member Author

Can you update the tau.prior=1 to follow the recommendations from RBesT vignetts (https://opensource.nibr.com/RBesT/articles/introduction.html). Specifically, one needs to make the scale proportional to sigma (taken usually to be the pooled sampling sd as estimated from the data). The conservative choice is sigma/2, but whenever data is somewhat homogeneous to a level common when selecting data sets for meta-analysis sigma/4 is better, I think.

423ee1b sets tau.prior in gMAP() to pooled_external_data_sd / 4 (at most "substantial" study-to-study heterogeneity according to https://opensource.nibr.com/RBesT/reference/gMAP.html#details, which was a really helpful read). The external data I made up for the univariate MAP prior (data_historical_visit4) seems relatively homogeneous.

@wlandau

wlandau commented Apr 7, 2026

Copy link
Copy Markdown
Member Author

For the multivariate case you could point out to use brms directly with multiple random effects, for example as demonstrated here: https://opensource.nibr.com/bamdd/src/02ad_meta_analysis_covariate.html#sec-impl-complete-only ... not sure if you want to link that section directly... but a link to https://opensource.nibr.com/bamdd/ and hist data with a covariate you could consider.

Yes, the evidence synthesis piece is really important here. Referenced in b8ea816.

@wlandau

wlandau commented Apr 7, 2026

Copy link
Copy Markdown
Member Author

The robust component for the multi variate normal should also be a unit information prior... so using sigma here again. The choice of the robust component is a topic (if you make the sigma too large in comparison of the sampling sd, then the robustification is never kicking in).

Since that section doesn't conduct any data synthesis, I'm not sure we have access to to sigma (unless we're constructing a MAP prior from a single historical study). But b96fdf7 does restate the general recommendation.

@wlandau

wlandau commented Apr 7, 2026

Copy link
Copy Markdown
Member Author

Last point: The mixstanvar has been written so that the brms function prior can be used; I see that you make people specify the actual code for the prior... fine... I did like the priors functions more, but both works.

I mildly prefer the consistency and predictability of having a single input type for the code argument of brm_prior_label(), but we could weigh the pros and cons in another thread if you decide you have strong feelings about this.

@wlandau

wlandau commented Apr 7, 2026

Copy link
Copy Markdown
Member Author

Thanks again @chstock and @weberse2 for your insightful feedback. I believe I have addressed your comments so far. Please let me know if you have more.

It would be great to merge this on April 15 when the brms.mmrm team next meets.

@wlandau
wlandau merged commit 4df83a2 into main Apr 15, 2026
14 checks passed
@wlandau
wlandau deleted the 137 branch April 15, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants