Repository navigation
next release - #64
Merged
Merged
next release#64
Conversation
Collaborator
Author
|
I also now tried the centering and auto centering options as implemented in the respective brms branch... and the auto centering technique seems to buy further improvements. These are not yet in this PR, but I will add these once I have them documented, tested and have my head around it - which is worth it as it looks to me. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The main point about the upcoming release is planned to be the sum to zero parametrization trick for hierarchical models. This removes a parameter from the over-parametrized hierarchical model and has shown in benchmarks to be easier to the sampler. Essentially I can drop the default adapt_delta setting for NUTS from 0.99 to 0.95 for common models fitted with RBesT. Below is are instructions for running the attached benchmark, which is a fake data simulation fitted with priors which are rather weak, but used in practice. This benchmark used to be a challenge for RBesT which is now not any longer the case as one can see from a medium sized job - the new implementation has essentially no more divergent transitions while the old one struggles:
Instructions and code here (Opus vibe coded):
benchmark-divergent-map_R.txt
Reproducing the s2z vs. legacy benchmark
The
benchmark-divergent-map.Rscript in the package root compares the newsum-to-zero (s2z) parametrization of
gMAP()against the legacy centred one onthe "divergent MAP" fake data simulation: a two-arm trial with a
covariate-by-treatment interaction, analysed as a random-effects meta-analysis
of the within-level treatment contrasts. With
J = 2groups tau is informed bytwo numbers only, which leaves the long funnel that makes this a fair stress
test rather than a favourable one.
Both arms come from the same installed model — the legacy arm sets the user
facing opt-out (
use_s2z = 0, i.e.options(RBesT.MC.s2z = FALSE)), the s2z arm isthe default — driven with identical data, seeds and control arguments. So one
install of this branch is all that is needed, and nothing has to be compiled per
arm.
Run it
Run it from the package root.
--lib build/installedputs the dev install onthe library path; drop it if that library is already on
R_LIBS_USER.Useful variations
Settings ladder:
shipped(each arm at its own default, 0.99 legacy / 0.95s2z),
matched99,matched95,tuned,hard. Thetarget*settings varyonly
adapt_deltaand are meant for--arms s2zalone.A handful of trials cannot separate a 2% from a 5% divergence rate, so keep
local runs as smoke tests and use a worker pool for the numbers you want to
quote. Results are bit-identical across backends: trial data and Stan seed are
determined by the grid row.
Output
The script prints, per setting and arm, divergence rates, ESS per 1000
gradients, runtime and a paired per-trial contrast, and writes the raw results
to
benchmark-divergent-map.rds(override with--out). Re-report a saved runwithout refitting:
The headline claim to check is that the s2z row at a mild
adapt_deltamatchesor beats the legacy row at a harsher one.