Correct Jacobian for the initial Rt prior - #1478
Merged
Merged
Conversation
Co-authored-by: sbfnk <sebastian.funk@lshtm.ac.uk>
sbfnk
marked this pull request as ready for review
July 16, 2026 12:25
Co-authored-by: sbfnk <sebastian.funk@lshtm.ac.uk>
Contributor
sbfnk
previously approved these changes
Jul 16, 2026
Contributor
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 7e9c085 is merged into main:
|
Co-authored-by: sbfnk <sebastian.funk@lshtm.ac.uk>
Contributor
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 1be44b4 is merged into main:
|
sbfnk
previously approved these changes
Jul 16, 2026
sbfnk
enabled auto-merge
July 16, 2026 17:51
# Conflicts: # NEWS.md
sbfnk
approved these changes
Jul 22, 2026
sbfnk
disabled auto-merge
July 22, 2026 08:46
Contributor
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 629739c is merged into main:
|
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.
Description
This PR closes #1475.
Since #1396 the user's prior on the initial reproduction number is applied to the derived initial Rt,
R[1], ininit_priors_lp().R_meanis declaredreal<lower = 0>, so Stan already addslog(R_mean)for the lower-bound transform, and the hand-writtentarget += log(R[1])then double-counts it, leaving a spurious+log(R_mean)in the target. The prior is shifted upwards byexp(sdlog^2)— aLogNormal(mean = 2, sd = 1)prior behaves as if its mean were 2.5.The correction relative to the sampled parameter is
log(R[1]) - log(R_mean). This PR makes that change, corrects the derivation in the GP implementation vignette (which assumed the internal parameter was sampled on the log scale), and adds a prior-recovery regression test.A prior-only fit recovers the requested prior after the change:
R[1]LogNormal(mean = 2, sd = 1)Initial submission checklist
lintr::lint_package()).